We describe the simplest case of transactions in Bitcoin. Bitcoin defines a coin as a chain of transactions. When transferring coins from A to B, A gets a hash of the previous transaction. A generates a new asymmetric key pair. A digitally signs using her generated private key the hash of the current transaction. The transaction will now consist of the hash of the previous transaction, the digital signature, A's public key, the hash of B's public key (B's address) and the coins that will be sent. A broadcasts the transaction to other nodes.
All nodes receiving the transaction verifies the ownership of the coins in that transaction. A user only stores private keys in their wallet. However, the public key can be easily generated from the private key in an asymmetric key pair (but not vice versa). So B receiving the transaction generates all her public key. She hashes the each key and compares it to the address in the transaction. If one is equal, this means that she now owns the coins in that transaction.
The first transaction in a transaction chain is the generation transaction, which gives 50 Bitcoins to a node that solves a block. The generation transaction is also the first transaction in a valid block.
No comments:
Post a Comment