Название: Bitcoin For Dummies
Автор: Peter Kent
Издательство: John Wiley & Sons Limited
Жанр: Личные финансы
isbn: 9781119602149
isbn:
1L7hHWfJL1dd7ZhQFgRv8ke1PTKAHoc9Tq
. This is a real Bitcoin ledger address, by the way; when we checked, it had a balance of 0.10701382 Bitcoin.
https://blockstream.info/address/1L7hHWfJL1dd7ZhQFgRv8ke1PTKAHoc9Tq
.) By the time you see it, of course, the balance associated with the address may be different.
Now, let’s say this is your Bitcoin, and you want to send, perhaps, 0.05 Bitcoin to a friend, an exchange, or a merchant from whom you are buying goods or services.
You send a message to the blockchain saying, essentially, “I own address 1L7hHWfJL1dd7ZhQFgRv8ke1PTKAHoc9Tq
, and I want to send 0.05 Bitcoin to address 1NdaT7URGyG67L9nkP2TuBZjYV6yL7XepS
.”
If you just sent a plain text (unencrypted) message to the blockchain, there would be a huge problem of verification and validity. How would the Bitcoin node receiving this message know that you do indeed own this address and the money associated with it? You could just be spoofing this information and making it up, right?
What we do is use the wallet to sign the message using the private key associated with the address. In other words, we use the private key to encrypt the message. Then we take the public key, add it to the encrypted message, and send it all out across the Bitcoin network.
MESSAGE TO THE BLOCKCHAIN
How do you send a message to the blockchain? That’s what your wallet software does. In fact, wallet software is less like a wallet — your wallet contains no Bitcoin — and more like an email program. Your email program sends messages across the email network. Your wallet sends messages (about transactions) across the Bitcoin network. More on wallets soon.
Unraveling the message
So, the node — a computer containing a copy of the Bitcoin blockchain — receives the message. It takes the public key that has been attached to the encrypted message, and decrypts the message. The node “learns” something: “This message must have been encrypted — signed — by the private key associated with the public key.” Of course, that’s not really saying much. It’s virtually a tautology! By definition, if the public key can decrypt a message, the message must have been encrypted with the matching private key. Whoop-de-doo.
But remember, the public key must be mathematically associated with the address 1L7hHWfJL1dd7ZhQFgRv8ke1PTKAHoc9Tq
. So now the node can examine the address specified in the message, along with the public key sent with the message, asking, in effect, “Is the public key associated with the address?” If the answer is yes, then the node also knows that the private key held by the person sending the message is associated with the address (all three are uniquely associated with each other).
So, what does the node tell itself? It says, in effect: “This message, sending money from the address 1L7hHWfJL1dd7ZhQFgRv8ke1PTKAHoc9Tq
, was sent by the private key that was used to create this same address so the address must have been sent by the person who owns the address and therefore owns the money associated with the address.”
So that’s the crypto in cryptocurrency! You can control money in the Bitcoin blockchain ledger anonymously through the use of cryptography, using public and private key pairs and associated addresses, by cryptographically signing messages.
THE HOLDER OF THE PRIVATE KEYS OWNS THE MONEY
Okay, so maybe more people have access to the key. But as far as the technology is concerned, it doesn’t matter. Whoever has access to the private key has the cryptographic right to control the money assigned to the blockchain address associated with the key. You may hear the phrase, “whoever has the private key owns the money” or “not your private key, not your Bitcoin.” They may not have acquired the private key legitimately or legally own it, but they can control it nonetheless. So, protect your private keys!
But you’ll need a wallet
After you have an address, you have a way to store Bitcoin. You can give the address to someone from whom you’re buying Bitcoin or to an exchange, for example, and they can send the Bitcoin to that address — in other words, they send a message to the blockchain saying, “Send x amount of Bitcoin from address x to address y.” Now the address exists in the blockchain, and it has Bitcoin associated with it.
A wallet program is a messaging program that stores your keys and addresses in a wallet file. The wallet program does these primary things:
It retrieves data from the blockchain about your transactions and balance.
It stores your private and public keys.
It sends messages to the blockchain transferring your crypto from your addresses to other addresses, such as when you make a purchase using your Bitcoin.
It uses your public keys to create addresses you can give to other people when they need to send Bitcoin to you.
There’s lots more to find out about wallets; you can discover more about them in Chapter 4.
1 Bitcoin is stored in the blockchain.
2 Your Bitcoin is associated with an address in the blockchain.
3 That address is mathematically associated with a public key.
4 The public key is СКАЧАТЬ