Locking and unlocking bitcoins anonymously
If Alice wants to transfer bitcoins to Bob, she needs to construct a transaction to make the correct sum available to him. In the most frequently used transaction type (Pay-to-Public-Key-Hash), ‘make available’ means securing the sum using a locking script that can only be unlocked by the person who controls the private key corresponding to the public key communicated by Bob. The locking script contains the hash value H from Bob’s public key. This hash value is Bob’s bitcoin address.
Unlocking script
If Bob wants to use the bitcoins he has received from Alice, he also needs to construct a transaction. This transaction uses an unlocking script to release the bitcoins. The unlocking script contains Bob’s public key K and a signature S. The signature is simply Bob’s public key, encrypted using his private key.
Validation
In order to validate Bob’s transaction, the locking and unlocking scripts are executed by a stack execution engine. The result of this operation is positive if and only if K’s hash value is equal to H and if K is the result when S is decrypted using Bob’s public key. The first condition ensures that Alice’s bitcoins are credited to the correct bitcoin address. The second ensures that the recipient controls the private key.
Anonymity
All transaction information stored in the blockchain is public. In Bob’s case, H, K and S are the only details that are stored. These details could only have come from someone with control over the public key K and the corresponding private key. It is impossible to know whether or not the person in question is Bob, and, if the key pair is only used for this one transaction, it is also impossible to determine their identity on the basis of other transactions.
Transaction chain
While Alice could provide information about Bob, if she is purchasing a movable asset (jewelry, art, etc.) via a middleman, it’s not necessary for her to know Bob’s identity. The transactions in a blockchain can be traced seamlessly; however, the actors are not always identifiable. In traditional financial transactions, only a few of the links in the chain are usually known – those in which an actor was involved. In bitcoin transactions, the full chain is known; however, the actors usually aren’t.