✨ (signer) [NO-ISSUE]: Add signer packages for multiple blockchain networks#1284
✨ (signer) [NO-ISSUE]: Add signer packages for multiple blockchain networks#1284mbertin-ledger wants to merge 21 commits intodevelopfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
There was a problem hiding this comment.
Pull request overview
This PR adds comprehensive signer implementations for 18 blockchain networks, implementing APDU protocols based on their respective Ledger hardware wallet apps. Each signer provides commands for app configuration retrieval, address derivation, transaction signing, and message signing (where supported).
Changes:
- Adds new signer packages for Algorand, Aptos, Canton, Celo, Concordium, Hedera, Helium, Icon, Kaspa, Multiversx, Near, Polkadot, Stellar, Sui, Tezos, Tron, Vechain, and XRP
- Integrates all new signers into the sample app with corresponding providers and views
- Updates documentation references to include all new signers
Reviewed changes
Copilot reviewed 288 out of 994 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/signer/signer-*/package.json | Package configuration for each new signer |
| packages/signer/signer-*/src/internal/app-binder/*Command.ts | APDU command implementations per chain |
| packages/signer/signer-*/src/internal/app-binder/*Task.ts | Transaction/message signing tasks with chunking |
| apps/sample/src/providers/Signer*Provider/index.tsx | React providers for sample app integration |
| apps/sample/src/app/signers/*/page.tsx | Sample app pages for each signer |
| package.json | Root package scripts for signer packages |
| apps/docs/pages/docs/references/signers/_meta.js | Documentation metadata |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| let hash = 0; | ||
| for (let i = 0; i < publicKey.length; i++) { | ||
| const char = publicKey.charCodeAt(i); | ||
| hash = (hash << 5) - hash + char; | ||
| hash = hash & hash; | ||
| } | ||
| const address = "canton_" + Math.abs(hash).toString(16); |
There was a problem hiding this comment.
The Canton address generation uses a simple hash function on the hex string representation of the public key rather than the actual bytes. This implementation appears incorrect - Canton addresses should be derived from the public key bytes using a proper cryptographic hash function and encoding scheme specific to Canton.
|
|
||
| canton: "Signer Canton", | ||
|
|
||
|
|
||
|
|
||
| celo: "Signer Celo", | ||
|
|
||
|
|
||
|
|
||
|
|
||
| concordium: "Signer Concordium", | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
| hedera: "Signer Hedera", | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
| helium: "Signer Helium", | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
| icon: "Signer Icon", | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
| kaspa: "Signer Kaspa", | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
| multiversx: "Signer Multiversx", | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
| near: "Signer Near", | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
| polkadot: "Signer Polkadot", | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
| stellar: "Signer Stellar", | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
| sui: "Signer Sui", | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
| tezos: "Signer Tezos", | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
| tron: "Signer Tron", | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
| vechain: "Signer Vechain", | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
| xrp: "Signer Xrp", | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
There was a problem hiding this comment.
Multiple consecutive blank lines throughout the file create unnecessary whitespace. This file should have consistent spacing between entries, with at most one blank line between items.
| canton: "Signer Canton", | |
| celo: "Signer Celo", | |
| concordium: "Signer Concordium", | |
| hedera: "Signer Hedera", | |
| helium: "Signer Helium", | |
| icon: "Signer Icon", | |
| kaspa: "Signer Kaspa", | |
| multiversx: "Signer Multiversx", | |
| near: "Signer Near", | |
| polkadot: "Signer Polkadot", | |
| stellar: "Signer Stellar", | |
| sui: "Signer Sui", | |
| tezos: "Signer Tezos", | |
| tron: "Signer Tron", | |
| vechain: "Signer Vechain", | |
| xrp: "Signer Xrp", | |
| canton: "Signer Canton", | |
| celo: "Signer Celo", | |
| concordium: "Signer Concordium", | |
| hedera: "Signer Hedera", | |
| helium: "Signer Helium", | |
| icon: "Signer Icon", | |
| kaspa: "Signer Kaspa", | |
| multiversx: "Signer Multiversx", | |
| near: "Signer Near", | |
| polkadot: "Signer Polkadot", | |
| stellar: "Signer Stellar", | |
| sui: "Signer Sui", | |
| tezos: "Signer Tezos", | |
| tron: "Signer Tron", | |
| vechain: "Signer Vechain", | |
| xrp: "Signer Xrp", |
| <SignerXrpProvider> | ||
| <SignerVechainProvider> | ||
| <SignerTronProvider> |
There was a problem hiding this comment.
The deeply nested provider structure creates code that's difficult to read and maintain. Consider refactoring to compose providers using a higher-order component or a provider composition utility.
|
Generate signer scaffolds for multiple blockchains (algorand, aptos, canton, celo, concordium, hedera, helium, icon, kaspa, multiversx, near, polkadot, stellar, sui, tezos, tron, vechain, xrp) using ldmk-tool generate-signer. Fully implement XRP signer with APDU protocol: - GetAppConfigCommand: Retrieve app version - GetAddressCommand: Get XRP address with Ed25519/secp256k1 support - SignTransactionCommand: Sign transactions with chunked data handling - SignTransactionTask: Orchestrate multi-chunk transaction signing - XRP-specific error handling following signer-eth patterns Co-authored-by: Cursor <cursoragent@cursor.com>
Implement full APDU command handling for Algorand signer: - GetAddressCommand: Get public key with account index (CLA=0x80, INS=0x03) - SignTransactionCommand: Sign msgpack-encoded transactions with chunking - SignTransactionTask: Orchestrate chunked signing (250-byte chunks) - GetAppConfigCommand: Basic app config retrieval - SignMessageCommand: Mark as unsupported (Algorand only supports msgpack) - Error handling following signer-eth patterns Co-authored-by: Cursor <cursoragent@cursor.com>
Implement full APDU command handling for Tron signer: - GetAppConfigCommand: Get app version and flags (CLA=0xe0, INS=0x06) - GetAddressCommand: Get address with full derivation path (INS=0x02) - SignTransactionCommand: Sign transactions with chunking (INS=0x04) - SignTransactionTask: Orchestrate chunked signing (250-byte chunks) - SignMessageCommand: Sign personal messages (INS=0x08) - SignMessageTask: Handle chunked message signing - Error handling following signer-eth patterns Co-authored-by: Cursor <cursoragent@cursor.com>
Implement full APDU command handling for NEAR signer: - GetAddressCommand: Get public key/address (CLA=0x80, INS=0x04/0x05) - SignTransactionCommand: Sign transactions with chunking (INS=0x02) - SignTransactionTask: Orchestrate chunked signing (255-byte chunks) - GetAppConfigCommand: Basic app config retrieval - SignMessageCommand: Mark as unsupported (NEAR only supports transactions) - Error handling following signer-eth patterns Co-authored-by: Cursor <cursoragent@cursor.com>
Implement full APDU command handling for ICON signer: - GetAppConfigCommand: Get app version (CLA=0xe0, INS=0x06) - GetAddressCommand: Get address with chaincode option (INS=0x02) - SignTransactionCommand: Sign transactions with chunking (INS=0x04) - SignTransactionTask: Orchestrate chunked signing (150-byte chunks) - SignMessageCommand: Mark as unsupported (ICON only supports transactions) - Error handling following signer-eth patterns Co-authored-by: Cursor <cursoragent@cursor.com>
Implement full APDU command handling for Stellar signer: - GetAppConfigCommand: Get version and hash signing status (CLA=0xe0, INS=0x06) - GetAddressCommand: Get raw Ed25519 public key (INS=0x02) - SignTransactionCommand: Sign transactions with chunking (INS=0x04) - SignTransactionTask: Orchestrate chunked signing (255-byte chunks) - SignMessageCommand: Sign messages with chunking (INS=0x0c) - SignMessageTask: Orchestrate chunked message signing - Error handling following signer-eth patterns Co-authored-by: Cursor <cursoragent@cursor.com>
Implement the Aptos signer with proper APDU commands based on hw-app-aptos: - GetAppConfigCommand: retrieves app version (CLA=0x5b, INS=0x03) - GetAddressCommand: retrieves public key, chain code, and address (INS=0x05) - SignTransactionCommand: handles chunked transaction signing (INS=0x06) - SignMessageCommand: marked as unsupported for Aptos - SignTransactionTask: orchestrates chunked transaction data Co-authored-by: Cursor <cursoragent@cursor.com>
Implement the Canton signer with proper APDU commands based on hw-app-canton: - GetAppConfigCommand: retrieves app version (CLA=0xe0, INS=0x03) - GetAddressCommand: retrieves public key and address (INS=0x05) - SignTransactionCommand: handles chunked signing with P2 flags (INS=0x06) - SignMessageCommand: marked as unsupported (Canton uses signTransaction) - SignTransactionTask: orchestrates chunked transaction signing Co-authored-by: Cursor <cursoragent@cursor.com>
Implement the Celo signer with proper APDU commands (Celo extends Ethereum): - GetAppConfigCommand: retrieves app version and config flags (CLA=0xe0, INS=0x06) - GetAddressCommand: retrieves public key, address and chain code (INS=0x02) - SignTransactionCommand: handles chunked transaction signing (INS=0x04) - SignMessageCommand: handles chunked message signing (INS=0x08) - SignTransactionTask: orchestrates chunked transaction signing - SignMessageTask: orchestrates chunked message signing Co-authored-by: Cursor <cursoragent@cursor.com>
Implement the Concordium signer with proper APDU commands based on hw-app-concordium: - GetAppConfigCommand: placeholder (GET_VERSION not implemented on device yet) - GetAddressCommand: retrieves public key (CLA=0xe0, INS=0x01) - SignTransactionCommand: handles chunked transfer signing (INS=0x02) - SignMessageCommand: marked as unsupported (use signTransfer) - SignTransactionTask: orchestrates chunked transaction signing Co-authored-by: Cursor <cursoragent@cursor.com>
Implement the Hedera signer with proper APDU commands based on hw-app-hedera: - GetAppConfigCommand: placeholder (no version command available) - GetAddressCommand: retrieves public key (CLA=0xe0, INS=0x02) - SignTransactionCommand: signs transaction (INS=0x04, only index 0) - SignMessageCommand: marked as unsupported - SignTransactionTask: wraps single transaction signing Co-authored-by: Cursor <cursoragent@cursor.com>
Implement the Helium signer with proper APDU commands based on hw-app-helium: - GetAppConfigCommand: retrieves app version (CLA=0xe0, INS=0x01) - GetAddressCommand: retrieves address and public key (INS=0x02) - SignTransactionCommand: signs PaymentV2 transactions (INS=0x08) - SignMessageCommand: marked as unsupported - SignTransactionTask: wraps single transaction signing Co-authored-by: Cursor <cursoragent@cursor.com>
Implement the Kaspa signer with proper APDU commands based on hw-app-kaspa: - GetAppConfigCommand: retrieves app version (CLA=0xe0, INS=0x04) - GetAddressCommand: retrieves public key and address (INS=0x05) - SignTransactionCommand: handles multi-step transaction signing (INS=0x06) - SignMessageCommand: signs personal messages (INS=0x07) - SignTransactionTask: orchestrates transaction signing flow Co-authored-by: Cursor <cursoragent@cursor.com>
Implement the MultiversX signer with proper APDU commands based on app-multiversx: - GetAppConfigCommand: retrieves version and config flags (CLA=0xed, INS=0x02) - GetAddressCommand: retrieves public key and bech32 address (INS=0x03) - SignTransactionCommand: handles chunked tx hash signing (INS=0x07) - SignMessageCommand: handles chunked message signing (INS=0x06) - SignTransactionTask: orchestrates transaction signing - SignMessageTask: orchestrates message signing Co-authored-by: Cursor <cursoragent@cursor.com>
Implement the Polkadot signer with proper APDU commands based on hw-app-polkadot: - GetAppConfigCommand: retrieves version (CLA=0xf9, INS=0x00) - GetAddressCommand: retrieves public key and ss58 address (INS=0x01) - SignTransactionCommand: handles chunked transaction signing (INS=0x02) - SignMessageCommand: marked as unsupported - SignTransactionTask: orchestrates transaction signing with metadata Co-authored-by: Cursor <cursoragent@cursor.com>
Implement the Sui signer with proper APDU commands based on app-sui: - GetAppConfigCommand: retrieves version (CLA=0x00, INS=0x00) - GetAddressCommand: retrieves public key and address (INS=0x02/0x01) - SignTransactionCommand: handles chunked transaction signing (INS=0x03) - SignMessageCommand: marked as unsupported - SignTransactionTask: orchestrates transaction signing Co-authored-by: Cursor <cursoragent@cursor.com>
Implement the Tezos signer with proper APDU commands based on hw-app-tezos: - GetAppConfigCommand: retrieves version and baking flag (CLA=0x80, INS=0x00) - GetAddressCommand: retrieves public key with curve support (INS=0x02/0x03) - SignTransactionCommand: handles chunked operation signing (INS=0x04) - SignMessageCommand: marked as unsupported - SignTransactionTask: orchestrates transaction signing with curve selection - Supports ED25519, SECP256K1, and SECP256R1 curves Co-authored-by: Cursor <cursoragent@cursor.com>
Implement the VeChain signer with proper APDU commands based on hw-app-vet: - GetAppConfigCommand: retrieves version (CLA=0xe0, INS=0x06) - GetAddressCommand: retrieves public key and address with chain code support (INS=0x02) - SignTransactionCommand: handles chunked transaction signing (INS=0x04) - SignMessageCommand: marked as unsupported - SignTransactionTask: orchestrates transaction signing with v/r/s extraction Co-authored-by: Cursor <cursoragent@cursor.com>
Export GetAppConfigDA*, GetAddressDA*, SignTransactionDA*, and SignMessageDA* types from all new signer packages to fix the sample app build which imports these types. Co-authored-by: Cursor <cursoragent@cursor.com>
Replace placeholder BTC icons with correct crypto icons for each signer: - ALGO for Algorand - APT for Aptos - ADA for Canton (based on Cardano) - CELO for Celo - HBAR for Hedera - ICX for ICON - EGLD for MultiversX - NEAR for Near - DOT for Polkadot - XLM for Stellar - XTZ for Tezos - TRX for Tron - VET for VeChain - XRP for XRP (already correct) Use GENERIC icon for chains without specific icons: Concordium, Helium, Kaspa, Sui Co-authored-by: Cursor <cursoragent@cursor.com>
Update the default derivation path for XRP signer in the sample app to use the correct XRP coin type (144) instead of Bitcoin's (0). Co-authored-by: Cursor <cursoragent@cursor.com>
926d564 to
a57872b
Compare
Summary
Add new signer packages for multiple blockchain networks, implementing APDU protocols based on their respective
hw-app-xxxpackages from ledger-live. Each signer provides:GetAppConfigCommand: Retrieves app version from the deviceGetAddressCommand: Derives public key and address from BIP32 pathSignTransactionCommand/Task: Signs transactions with chunking supportSignMessageCommand: Message signing (where supported by the chain)New Signer Packages
Implementation Details
CommandErrorHelperfrom@ledgerhq/signer-utilsfor consistent error handlingTest Plan
pnpm turbo build --filter="@ledgerhq/device-signer-kit-*")pnpm typecheck)Notes
Made with Cursor