ledgerhq / app-zilliqa Goto Github PK
View Code? Open in Web Editor NEWZilliqa wallet application for Ledger Nano S
License: MIT License
Zilliqa wallet application for Ledger Nano S
License: MIT License
Your uint256 library has issues with multiplication.
The simplest reproduction I can do is
uint256_t a;
// 10e425c56daffabc35c1
clear128(&UPPER(a));
assert(UPPER(UPPER(a)) == 0);
assert(LOWER(UPPER(a)) == 0);
UPPER(LOWER(a)) = 0x10e4;
LOWER(LOWER(a)) = 0x25c56daffabc35c1;
mul256(&a, &a, &a);
// 11d500bfaf40ac5044981798db5fb39f2c17b81
assert(UPPER(UPPER(a)) == 0);
assert(LOWER(UPPER(a)) == 0x11d500b);
assert(UPPER(LOWER(a)) == 0xfaf40ac504498179);
assert(LOWER(LOWER(a)) == 0x8db5fb39f2c17b81);
I find:
square 0000000000000000000000000000000000000000000010e425c56daffabc35c1 -> 000000000000000100000000011d500afaf40ac5044981798db5fb39f2c17b81
It looks like the 1 in the upper upper word should have instead been added to lower upper word.
My understanding is that, for account #n, on Ledger, Zilliqa uses the derivation path m/44'/313'/n'/0'/0' while the other BIP39-compatible Zilliqa wallets use m/44'/313'/0'/0/n.
Is there a valid reason for this discrepancy? (other that Zilliqa devs using a quick cut-and-past from a boilerplate ledger app sample when they made the Zilliqa ledger app)
It is hard for users to try to decode the contents of the JSON blob with transaction content on the Ledger Display and determine if the info is correct. This is made worse by the fact that addresses are shown on Legacy address format inside the tx JSON blob.
E.g. when I swap ZIL to buy GZIL on ZilSwap and use my Ledger, the GZIL token symbol will not be displayed, which is bad as is, but made worse by the fact that not even the GZIL ZIL contract address will be shown as I know it -- on bech32 format -- but rather the legacy address is displayed. Also, the recipient address (my address) is shown on the legacy format.
So I have to go to GZIL in e.g. ViewBlock: https://viewblock.io/zilliqa/address/zil14pzuzq6v6pmmmrfjhczywguu0e97djepxt8g3e
Copy the contract address zil14pzuzq6v6pmmmrfjhczywguu0e97djepxt8g3e
and convert it myself using e.g. Coinhakos Zilliqa Address Tool (which Bech32 encodes and decodes).
I propose the following updates to the Ledger Nano app:
ZIL
instead of QA
denomination (maybe add to settings the possibility to round to 1 or 2 decimal precision)This issue might be split into several issues, which is OK, but this is a start.
I used Pieter Wuille ("Sipa") bech32 encoding code when I wrote Radix DLTs Ledger Nano app, find the bech32_encode.c file here. And an example of usage here
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.