Bitcoin graphical address generation
Download bitcoin wallet, open the wallet, and the wallet address will be generated automatically. Your bitcoin is in your "wallet". A wallet can contain many... Many addresses. The form of the address is the form
bitcoin
trades directly through the wallet. Detailed can go to cnfol bitcoin network to learn how to trade, I don't know.
First of all, you should imagine a concept of "wallet" in your brain. Your bitcoin is in your wallet. A wallet can contain many... Many addresses. The form of the address is the form
with the bitcoin address generated in the bitcoin wallet, you can receive bitcoin from others, and you can also transfer the bitcoin in your account to the bitcoin address of others. Bitcoin address, like bank card number, has the functions of payment, transfer and withdrawal. However, when transferring money, you can only transfer money by knowing someone else's bitcoin address
if we simply compare a bitcoin wallet to a bank card account, then the address of the bitcoin wallet can be regarded as a bank card account number. The difference is that bitcoin addresses can not be stored on the network, but also exist independently of your wallet
< H2 > extended data:
bitcoin address is a string of 26 to 34 letters and numbers. It looks like a lot of messy code. To put it bluntly, it's just like your bank card number. All transfer records of each bitcoin address can be checked through blockchain query, which is open and transparent
address generation of bitcoin Wallet: 256 binary digits are randomly selected to form the private key, and then the address is generated by encryption function. This generation direction is unidirectional. That is, you know that the address cannot be decrypted to calculate the private key. At present, the computing power of human computer can't be cracked, so you can publish the address on the Internet with ease
reference link: bitcoin | network
bitcoin address generation process
(Note: some numbers are marked with & quot; 0x" Begin with, meaning that the number is in hexadecimal notation& quot; 0x" It doesn't have any meaning in itself. It's a conventional writing method handed down from C language. For example, 0xa is 10 in decimal system. In addition, 1 byte = 8-bit binary = 2-bit hexadecimal)
in the first step, randomly select a 32 byte number and size from 1 to 0xFFFF ffff ffff ffff ffff ffff ffff fffe baae dce6 af48 a03b BFD2 5e8c d036 4141 as the private key
in the second step, the elliptic curve encryption algorithm (ecdsa-secp256k1) is used to calculate the uncompressed public key corresponding to the private key A total of 65 bytes, 1 byte is 0x04, 32 bytes are x coordinates, and 32 bytes are y coordinates
the third step is to calculate the SHA-256 hash value of the public key
the fourth step is to take the previous step result and calculate the ripemd-160 hash value
the fifth step is to take the previous step result and add the address version number (bitcoin main network version number "0x00")
00
the sixth step is to take the previous step result, Calculate the SHA-256 hash value
Step 7, take the result of the previous step, and then calculate the SHA-256 hash value (HA HA)
Step 8, take the first four bytes (8-bit hexadecimal)
d61967f6
Step 9 of the result of the previous step, and add these four bytes after the result of step 5, As a check (this is the hexadecimal form of the bitcoin address)
00d61967f6
Step 10: change the address with base58 notation (this is the most common form of bitcoin address)< br />
What is the sub address of bitcoin
the wallet of bitcoin is based on the HD (hierarchical certainty) framework, which has the methods of generating different addresses and managing addresses. Each public address of your wallet will be generated from your wallet's xpub (extended public key)
if you use the same address every time you receive a BTC, anyone can easily track all your payment records. This address generation method improves privacy by generating a new address (sub address) when you collect money
how to find the sub address of bitcoin
1; Assets & quot; Page, after switching to BTC wallet, click the QR code style button in the upper right corner to enter the collection interface
public key and private key are terms in asymmetric encryption of modern cryptography. They usually encrypt information with public key and decrypt information with private key. Why? Because when you watch TV dramas, telegrams are encrypted symmetrically. The disadvantages of this encryption method are obvious. If someone knows the key and encryption method, they can decrypt the telegrams according to the encryption method. Until asymmetric encryption, the situation has changed. Public key is the key that can be made public all over the world. For example, when you communicate with Google, you encrypt with the 1024 bit public key given by Google and send it to Google. Only he has the corresponding private key, and only he can decrypt it, so the communication security is ensured
2. Bitcoin mainly uses ECDSA, which is the elliptic curve signature algorithm, This algorithm has two characteristics. Note that these two points are very important to the following
A. as long as you know the private key, you can calculate the corresponding public key
B. If you have signed something with the private key, you can use the public key to calculate whether you signed it or not
3. After knowledge preparation, let's start with the transaction of bitcoin. In fact, bitcoin has no wallet, only transaction bills, and the whole bitcoin is a lot of transaction bills
for example:
bill 1 transfers from a to B to XXX bitcoin
Bill 2 transfers from B to C and D to XXX bitcoin
bill 3 transfers from C to e to XXX bitcoin
.... Anyone who downloads the client can receive all the bills from the day when bitcoin was established, so as long as all the bills are downloaded, they will naturally know how much money should be left on each account (think carefully here)
4. The account of bitcoin is the public key mentioned just now
5, Here is the core part!!! Each bill is a piece of data. After you sign it, it will be sent to the whole network, and the data structure will be reversed into easy to understand Chinese. The explanation is as follows:
from (who sent it, including two parts)
previous TX: the ID of the bill for which you want to spend the money, that is to say, any money you spend should have been transferred to you, You need to show the ID of the bill
scriptsig: your signature for this transaction is to hash the bill with your private key, only you can do this hash
to (who accepts, including two parts)
value: how much to send
scriptpubkey: the public key of the other party, and the bitcoin account is a public key
6, How to send it? Bitcoin communication is not so complicated. You can compare it to IRC channel, but different from ordinary "IRC", any client is an "IRC" server. When you start the client, you will receive the client address with public IP around, that is, the "server" list. This list is constantly refreshed, and it is all other bitcoin users, So when you shout a word in this "IRC", people around you will hear it and spread it all over the world
7. After sending the signature to the whole world, all the clients who receive this list will verify whether your signature is correct, whether you sent it, and whether you have so much money (according to the historical transaction, you can calculate how much money you have to spend)
if you have calculated this transaction, it's OK, Basically, the transfer is successful
8. In fact, the other party has accepted bitcoin, but in order to spend it, he must have the private key corresponding to the address (public key). So he can fill in the from header of a form. Previous TX is the serial number of the transaction just now. Scriptsig fills in the hash signed with his private key...