如何通过以太坊私钥或助记词生成DID wallet?
在https://www.arcblock.io/docs/blockchain/en/create-account 没有示例
const mnemonic = 'exist vibrant interest scrub nephew solve thumb seven wrist panic journey produce'; const ethWallet = ethers.Wallet.fromPhrase(mnemonic); console.log(ethWallet); const wallet = fromSecretKey(toUint8Array(ethWallet.privateKey), { role: types.RoleType.ROLE_ACCOUNT, pk: types.KeyType.ETHEREUM, hash: types.HashType.SHA3 });
不知是否正确
首先,你这个私钥发出来 = 已经泄漏了,请不要在社区的帖子、回复、私信中贴任何助记词、私钥。
你把 Eth Wallet 打印出来之后,获取到其 secretKey,然后
const wallet = fromSecretKey(secretKey, 'eth');
嗯,在写测试
4 replies
不知是否正确
首先,你这个私钥发出来 = 已经泄漏了,请不要在社区的帖子、回复、私信中贴任何助记词、私钥。
你把 Eth Wallet 打印出来之后,获取到其 secretKey,然后
嗯,在写测试