我正在尝试为以太坊混合BitcoinJ
和Web3j
. 确定性密钥是使用生成BitcoinJ
的,而以太坊凭证使用Web3j
. 但是使用凭证生成的地址Web3j
并不像预期的那样。
String seedCode = "yard impulse luxury drive today throw farm pepper survey wreck glass federal";
// BitcoinJ
DeterministicSeed seed = new DeterministicSeed(seedCode, null, "", 1409478661L);
DeterministicKeyChain chain = DeterministicKeyChain.builder().seed(seed).build();
DeterministicKey key = chain.getKey(KeyPurpose.RECEIVE_FUNDS);
BigInteger privKey = key.getPrivKey();
// Web3j
Credentials credentials = Credentials.create(privKey.toString(16));
System.out.println("Address: " + credentials.getAddress());
输出:0x2c4186d0422d0462a48c92cd559cbc30f528855b
预期:0x72445fcFdEB1Fff79496D7Ce66089d663Ff90E26
代码中的误解在哪里?