Coder Social home page Coder Social logo

app-zilliqa's Introduction

Zilliqa Ledger App for Nano S and Nano X

Zilliqa wallet application for Nano S and Nano X.

Build environment

To build all elfs, run:

docker run -it -v $PWD:/app --user "$(id -u)":"$(id -g)" ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder-lite:latest ./tools/build-all.sh

To build test environment, run:

docker build .  --tag builder_image

Then run the tests:

docker run -it -v $PWD:/app builder_image:latest ./tools/test-all.sh

Build and load image

To build, start the Docker image with:

docker run -it -v $PWD:/app --user "$(id -u)":"$(id -g)" ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder-lite:latest

and run

make BOLOS_SDK=[SDK]

where [SDK] is ${NANOS_SDK}, ${NANOSP_SDK} or ${NANOX_SDK}. Then exit the docker image. Next load the

docker run -it -v $PWD:/app --user "$(id -u)":"$(id -g)" --privileged builder_image:latest

To load the app:

make load

To uninstall:

make delete

To run tests:

PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python pytest tests/functional/ -v --device [device]

app-zilliqa's People

Contributors

apaillier-ledger avatar cbouvet-ledger avatar cryptoaeon avatar grydz avatar saltari avatar sgliner-ledger avatar tamtamhero avatar troelsfr avatar vaivaswatha avatar vbmithr avatar xchapron-ledger avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

app-zilliqa's Issues

Improve readability of content of TX to sign

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:

  1. Pretty print the JSON TX blob so that only at maximum 1 key-value pair is displayed per Ledger Screen (sometimes a key-value pair might not fit on 1 screen, which is ok)
  2. Make GZIL a first-class citizen of the Ledger Nano App, i.e. do a comparison of the value of the asset, if it matches the address of GZIL, display "token: GZIL" instead of the address
  3. For non-ZIL and non-GZIL assets display the contract address on bech32 format
  4. In general, always display all addresses on bech32 format
  5. Please display the amount in 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

Here are some UInt256 amount denomination conversion code

mul256 sets upper bits incorrectly when multiplying large numbers

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.