I tried to derive some receiving address similar to Electrum derivation path (e.g. m/0/<n>) using following snippet, but the generated addresses is different with addresses that generated by Electrum.
type N = Mainnet;
let ext_key = BitcoinExtendedPublicKey::<N>::from_str("xpub....").unwrap();
let path = BitcoinDerivationPath::<N>::from_str("m/0/0").unwrap();
let child_key = ext_key.derive(&path).unwrap();
let addr = child_key.to_address(&child_key.format()).unwrap();
println!("Derived addr: {}", addr);
I tried to derive some receiving address similar to Electrum derivation path (e.g.
m/0/<n>
) using following snippet, but the generated addresses is different with addresses that generated by Electrum.