Replies: 2 comments 4 replies
-
Hi @LM-CD, AFAIK TrustWallet app (hence WalletCore) is compatible with other ICP wallets. |
Beta Was this translation helpful? Give feedback.
4 replies
-
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm developing a cryptocurrency wallet application with Internet Computer (ICP) support and need technical guidance on correctly implementing the same address format as Trust Wallet.
Implementation Details
My current implementation uses:
bip39 for mnemonic handling
bip32 (with tiny-secp256k1 backend) for hierarchical deterministic key derivation
Standard BIP44 derivation path: m/44'/223'/0'/0/i (where 223 is ICP's coin type)
Compressed secp256k1 public keys
Observed Behavior
Here's the critical compatibility issue:
1.My implementation generates addresses like:
02b462ce188ea5bf8fddd63dfa766b0d25fa231f3cadcbe2e71af65129c05b5578
2.Trust Wallet generates completely different addresses for the same mnemonic:
02e657c775a8404de2fbb282cbb78160100a64516d5d07cfd02796e4e753803
3.Importantly:
When I import the private key from my implementation into Trust Wallet, it generates the same address as when importing the mnemonic into Trust Wallet. This suggests Trust Wallet is applying a consistent custom transformation to derive addresses.
When i create an account on trust wallet with the same mnemonic on my app and trust wallet the private key are identical, just the public keys are different.
Code Example
Here's a simplified version of our address generation code:
const bip39 = require("bip39");
const { BIP32Factory } = require("bip32");
const ecc = require("tiny-secp256k1");
const bip32 = BIP32Factory(ecc);
function generateICPAddress(mnemonic, index = 0) {
const seed = bip39.mnemonicToSeedSync(mnemonic, "");
const root = bip32.fromSeed(seed);
const path =
m/44'/223'/0'/0/${index}
;const child = root.derivePath(path);
// Address as compressed public key
return Buffer.from(child.publicKey).toString('hex');
}
Technical Questions
What is the official ICP address format that Trust Wallet uses? Is it a specific transformation of the public key?
Does the ICP network recognize multiple address formats for the same key?
Are there specific transformation steps (hashing, encoding, prefixing) needed to convert the compressed public key into the format used in Trust Wallet?
Is there documentation on the exact address derivation algorithm for ICP in Trust Wallet?
Should we be using a different library like @dfinity/identity-secp256k1 to ensure compatibility?
Are there any Chain-Key cryptography specific transformations needed for ICP addresses?
Any technical guidance from the Trust Wallet developer community would be greatly appreciated.
Beta Was this translation helpful? Give feedback.
All reactions