How can you send a transaction?
Let's return to the previous example where the address represents the destination of a specific peer. If you want to send/receive assets yourself, you need two things: an address where the sender can reach you and a private key. The address is randomly generated when you join the blockchain, and it contains a simple sequence of letters and numbers. The address is based on the private key that you supply. The two are paired together. Your private key should be kept secret, and it, too, is a simple sequence of letters and numbers. Both elements will comprise your wallet. Losing your private key also means losing access to all of the assets within your wallet. With blockchain, transactions and assets can be viewed by all peers that join the network. Think of it as a glass safe: everyone can see what's inside, but you can only put something into it or take something out of it if you have the key.
The following diagram shows how the public-key cryptography used by a blockchain works:
The private key is used when you are sending something to another peer. You use your private key to sign the transaction. When the message is signed, it is sent out to the wider network to be verified by what are called miners. I will go into more detail on this subject in the next chapter, where we will examine the verification and consensus mechanisms.