Detailed explanation of Bitcoin private key -> public key -> address example (Frost Knife)

Detailed explanation of Bitcoin private key -> public key -> address example (Frost Knife)

Welcome to reprint and quote
If you have any questions, please contact
Email: [email protected]
QQ:2279557541


1. Private key

Simply put, the private key is a random number consisting of 32 bytes, such as
0x25e25210dce702d4e36b6c8a17e18dc1d02a9e4f0d1d31c4aee77327cf1641cc

2. Private key to generate public key

By ellipsometry algorithm, i.e. the bit credits secp256k1 the library, may be converted to a private key public key, here we are using a compressed format will be described, is
0x043f099e71ac2b0ca6ca72b4e00539f6972a5f2769bdbfb7b357691c00815bb33860518bb1a1e047a652fee2a21464b95d8176bdbf66f8f4a07ccad52c74321772

3. Convert public key to address

The process is a little more complicated. . .
1, the operation of the public key is obtained hash256
0x0754b2807f9708a37ed1f66b5b51285e3914e7bec0305d805ceba2c3c4f5b91c
2, then the results of a calculation performed hash160 give
0x3792778b38ec2aee1452984230b05efe74784656
3, the version number of the address applied to the address 0x00 forefront, to give
0x003792778b38ec2aee1452984230b05efe74784656
. 4, 3 is the result of calculation hash256 obtained
0x39a3e5e09bd06ef61f201871bfdf08a4a98cefd857bd75020d2ed5bfd3fe2af1
5, 4 is the result of calculation obtained hash256
0x572eb9fb474946a476565df245d9a1220e4afbeca233c08bff1c44b5393260e5
6, the front 4byte (572eb9fb) in combination with 5 results the results obtained 3
0x003792778b38ec2aee1452984230b05efe74784656572eb9fb
. 7, the results obtained 6 performs calculation base58
164qdFjYmbwPybeXrfFayAgjpp1nsCuWRg

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325218021&siteId=291194637