简单流程
生成HDWallet
let wallet = HDWallet(mnemonic: "shoot island position soft burden budget tooth cruel issue economy destroy above", passphrase: "")
币种类型
let coin = CoinType.XXXCoin
私钥
let privateKey = wallet.getKeyForCoin(coin: coin)
地址
let derivedAddress = coin.deriveAddress(privateKey: privateKey)
DerivationPath 方式
let path = DerivationPath("m/44'/60'/0'/0/0")
let path = DerivationPath(purpose: .bip44, coin: CoinType.ethereum.slip44Id, account: 0, change: 0, address: 0)
HDWallet -》私钥
let key0 = wallet.getKeyBIP44(coin: .ethereum, account: 0, change: 0, address: 0)
网友评论