在从address生成private key方面,我面临一个问题。
我从主私钥从electrum以及从从
xprv9s21xxxxxxxxxxxxxxxxxxxxxxxxxxxx在bitcoinJ中:
ECKey key=ECKey.fromPrivate(prv); // it accepts bytes[] or BigInteger如何将9s21xxxxxxxxxxxxxxxxx转换为bytes[] or BigInteger。
尝试:
String prvkey=9s21xxxxxxxxxxxxxxxxxxxxx
BigInteger bytes=new BigInteger(priv,16);它抛出异常,因为它不能转换由于数字格式。
尝试2:
byte[] bytes=prvkey.getBytes(StandardCharsets.UTF_16);它从ECKey生成有效地址,我通过electrum向该address发送事务。但钱包没有收到钱。不知道钱去哪了。
如何将主私钥转换为BigInteger or bytes[]
PS:我是cryptocurrency的初学者
发布于 2018-03-21 07:44:39
将字符串私钥转换为bytes[]
ECKey key = ECKey.fromPrivate(prv.getBytes());或者,将字符串私钥转换为BigInteger
BigInteger privKey = Base58.decodeToBigInteger(prv);
ECKey key = ECKey.fromPrivate(privKey);https://stackoverflow.com/questions/49400311
复制相似问题