Ledger Application for interacting with Partisia Blockchain.
Supported use cases:
- Clear-signing of MPC Token transfers, with and without memos.
- Blind-singing of arbitrary transactions of any size on Partisia Blockchain and Partisia Blockchain Testnet. This functionality may put your crypto assets at risk, and must be explicitly enabled through the settings menu.
Based on Ledger app-boilerplate,
commit 7d1c3c39d8c7d3567c5a6650fe339a8e5160b497.
- Targets Partisia Blockchain, with clear signing support for MPC Token, and blind signing support for all other transactions.
- Adjusted rest of the code base to fit this target, including, but not limited
to:
- Parsing logic
- Signing logic
- APDU format
- UI and ícons
- Unit Testing
- Functional Testing
- Fuzz Testing
- Documentation has been updated to reflect Partisia Blockchain.
Trimmed and modified from Ledger app-boilerplate README.
The ledger-app-dev-tools docker image contains all the required tools and libraries to build, test and load an application.
You can download it from the ghcr.io docker repository:
sudo docker pull ghcr.io/ledgerhq/ledger-app-builder/ledger-app-dev-tools:latestYou can then enter this development environment by executing the following command from the directory of the application git repository:
Linux (Ubuntu)
sudo docker run --rm -ti --user root --privileged -v "/dev/bus/usb:/dev/bus/usb" -v "$(realpath .):/app" ghcr.io/ledgerhq/ledger-app-builder/ledger-app-dev-tools:latestWindows (with PowerShell)
docker run --rm -ti --privileged -v "$(Get-Location):/app" ghcr.io/ledgerhq/ledger-app-builder/ledger-app-dev-tools:latestThe application's code will be available from inside the docker container, you can proceed to the following compilation steps to build your app.
Setup a compilation environment by following the shell with docker approach.
From inside the container, use the following command to build the app for all supported Ledger devices:
bash scripts/compile.shYou can test the application on a physical device by loading it onto the device.
Before you can load the application the prerequisite steps must have been follows:
-
Compile the application to the target device. The artifacts are located in
./build/<target>.The target for the Nano S Plus is located in the
./build/nanos2folder. -
Connect the test device and unlock it. It must display the dashboard and not the application itself.
With these two steps, the application loading can be initialized in one of the two following ways.
- Open the pbc-ledger-embedded-app project folder in Visual Studio Code
- Install the Ledger Dev Tools extension
- Open the Ledger Developer Tools menu located on the Primary Side Bar (usually located on the left side)
- Press the "Select Target" option and choose your target device
- Under "Device Operations" press the "Load app on device" option
Inside the docker container run command,
python3 -m ledgerblue.runScript --scp --fileName build/<target>/bin/app.apdu --elfFile build/<target>/bin/app.elfWhere <target> is replaced with your target device, e.g. nanos2.
The terminal should now display two messages, "Generated random root public key" and "Using test master key".
The next steps must be done on the device itself.
- When the device displays the message "Deny unsafe manager", go through the screens and select the "Allow unsafe manager" option.
- When the device displays the message "Uninstall Partisia Blockchain", go through the screens and select the "Confirm action" option.
- When the device displays the message "Install app Partisia Blockchain", go through the screens and select "Perform installation" option.
- Enter the device pin
The app comes with functional tests implemented with Ledger's Ragger test framework.
Install the tests requirements:
pip install -r tests/requirements.txtThen run tests for all Ledger devices using:
bash scripts/test-ui.shHigh level documentation such as application specification, the APDU format in general and transaction serialization are included in developer documentation which can be generated with doxygen
doxygen .doxygen/Doxyfilethe process outputs HTML and LaTeX documentations in doc/html and doc/latex folders.