Читать книгу Bitcoin For Dummies - Peter Kent - Страница 52

Sending a transaction message to the Bitcoin ledger

Оглавление

So, here’s how cryptography is used when you want to send a transaction to the blockchain, to transfer a Bitcoin balance within the ledger to another person. Let’s say you own the address 1L7hHWfJL1dd7ZhQFgRv8ke1PTKAHoc9Tq. This is a real Bitcoin ledger address, by the way; when we checked, it had a balance of 0.10701382 Bitcoin.

You can see this address for yourself in a blockchain explorer. (Use this link to get to it: 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.

Bitcoin For Dummies

Подняться наверх