basic priciple
2019-02-25 22:54:42 9 举报
AI智能生成
HD钱包java实现
作者其他创作
大纲/内容
椭圆曲线加密
公式:y2 = x3 + ax + b, 4a3 + 27b2 != 0
K=k*G
ETH
BIP39
熵
SecureRandom.nextBytes(byte[16])
ECKeyPair(web3j)
private key(BIGINTEGER)
public key(BIGINTEGER)
Numeric.toHexStringWithPrefix == 0x + biginteger.toString(radix)
BIP32
DeterministicKeyChain.build from DeterministicSeed
DeterministicKeyChain deterministicKeyChain = DeterministicKeyChain.builder().seed(deterministicSeed).build();
DeterministicSeed种子
DeterministicHierarchy分层确定性实现
DeterministicKey分层确定性密钥对
HDKeyDerivation.deriveChildKey从pubk prik求导的核心方法
BIP44
m / purpose' / coin_type' / account' / change / address_index
M/44'/0'/0'/0/2
address
助记词
MnemonicCode.toMnemonic(entropy)(bitcoinj)
DeterministicSeed(bitcoinj)
ERC20BIPENTRY
FunctionEncoder.encode(Function)
RawTransaction.createTransaction
TransactionUtils.generateTransactionHashHexEncoded(rawTransaction, credentials)
TransactionEncoder.signMessage(rawTransaction, credentials)
Numeric.toHexString(bytes)
ETHBIPENTRY
RawTransaction.createEtherTransaction
TransactionUtils.generateTransactionHashHexEncoded
TransactionEncoder.signMessage(rawTransaction, credentials)
Numeric.toHexString(bytes)
BTCBIPENTRY
Transaction transaction = new Transaction(btcParams);
UTXOGetter.getBTCUTXOs
transaction.addOutput 发送和找零
transaction.addSignedInput 添加utxo
HexUtil.toHex(transaction.unsafeBitcoinSerialize())
0 条评论
下一页