Java

適用於 Java 的 Ethereum HD 錢包庫

  • April 15, 2019

有沒有乙太坊高畫質錢包java庫?我在 Github 上找到了一個流行的 java 庫web3j,它還不支持高畫質錢包。

BitcoinJ 確實支持高畫質錢包:BitcoinJ 高畫質錢包 RestoreFromSeed

您可以實現混合bitcoinjweb3j

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();
List<ChildNumber> keyPath = HDUtils.parsePath("M/44H/60H/0H/0/0");
DeterministicKey key = chain.getKeyByPath(keyPath, true);
BigInteger privKey = key.getPrivKey();

// Web3j
Credentials credentials = Credentials.create(privKey.toString(16));
System.out.println(credentials.getAddress());

引用自:https://ethereum.stackexchange.com/questions/44066