In the article Bitcoin: a question of trust, we referred to the mechanisms for creating new currency. To a certain extent, in relation to some of the conclusions we set out, we performed a leap of faith based on its foundations: Bitcoin is based on a chain of digital signatures implemented in a peer-to-peer network, whose maintenance requires the remuneration through the creation of new bitcoins, to certain nodes in the network. This remuneration is proportional to the work or spending in these nodes supporting the virtual currency, mainly for security.
In this annex we aim to establish a necessarily limited introduction to the technologies and mechanisms that underlie the block chain, or in other words, underlie the bitcoin currency itself.
Public key cryptography
The development of the Internet and the exchange of information on any computer network must be accompanied by security mechanisms that ensure that the information transferred can only be read by its intended recipient, even though the physical message (via cable, fiber or radio) may be captured by third parties, as well as to ensure that the sender of a certain document is really who he claims to be.
These objectives are normally achieved with in the encryption of information through the use of public key cryptography procedures, according to which each participant in a communication has a pair of mathematically linked keys: a private key, only known by him, and a public key which is made available to everyone. The key is used by applying it through mathematical processes on information to be encrypted, so that the encrypted result is computationally irreversible if the decryption key is not available.
The example that tends to be used to give an idea of these kinds of procedures is factoring prime numbers: the multiplication of two prime numbers however big they are, is a very simple and quick computational procedure, while the decomposition of the result obtained back to the initial numbers, without knowing any of these factors, results impossible in computational terms if the number used is enormous (of the order of 10200). Obviously, if we know one of the factors it is trivial to obtain the other. That is the conceptual basis of the use of keys for encryption.
The fundamentals of the digital signature
Anyone who knows a public key can encrypt information with this key, although the result can only be decrypted with the private key matching the public one. In other words, the public key is used to encrypt, but not to decrypt the information encrypted with the same key (which is why it is called asymmetrical cryptography), for which a private key is needed that is only known by the person who has this key. Conversely, information encrypted with a private key can be decrypted with a public key. But what point is the point of encrypted information that everyone can read, as the corresponding public key is easily available? The idea is to ensure that the information has been encrypted by the person in question. Any document that can be decrypted with a public key guarantees that it has been encrypted with the corresponding private key, and the owners of this private key cannot reject or deny that they have encrypted it. That is the essential point of a digital signature.
The hash function
The last tool to look at is also based on mathematical processing of information. It is what is called the hash function. After applying it to a document or other digital information the result is a compact summary of this information (much smaller, of only a few dozen characters). It is irreversible; in other words, using the summary (which is no more than a set of letters and numbers without semantic interpretation) it is impossible to recover the original text. Although it is mathematically possible to obtain the same summary or hash of two different texts, statistically the possibility of arriving at this result is very remote. In any event, there is no effective computational procedure for encryption that ensures a particular summary can be obtained. What is possible through the use of brute-force computational trial and error is to modify an entry until a hash is obtained that, let’s say, begins with on zero, two zeros, or more.
There are many uses of hash functions, but what is of interest here is that when we talk about a digital signature, usually the signature algorithms are not applied directly to the complete information or document, but only to its summary. This involves evident advantages of speed (the text to sign is much smaller) and others that are not so evident, such as statistically reducing the possibilities that a key used in the signature is discovered by an attacker.
Going into more detail, the designers of Bitcoin define the currency, literally, as “a chain of digital signatures”. The literal nature of the definition is important: a chain of signatures. Each transaction is like a certificate that is made up of a hash of the result of the chain of the previous transaction (or title), plus the public key of the new owner, which in turn is signed by the private key of the previous owner, which validates the transaction.
To go a little slower: if an owner transfers a coin to another person, what the Bitcoin support software does is translate the previous transaction into bits (as we have seen, this transaction is the result of a digital signature), combine it with the representation in bits of the public key of the beneficiary of the transfer, obtain the hash of all the previous information, and transfer the signature digitally with its private key. It is precisely this signature that is linked in a chain to the previous signatures and leaves a record of all the transactions during the existence of the coin, as well as to demonstrating publically who the actual owner is, given that the hash has included the owner’s public key.
The above has to be supplemented with additional certification mechanisms of the times in which the transactions are made to prevent the transfer of the same coin to two or more beneficiaries. In this way, the new owner can be completely sure that prior transfers have not taken place before he receives it.
The integrity of the chain of signatures also has to be assured so that it cannot be falsified. In addition, processes are required that allow the public announcement of transactions and that in the last resort, all the participants in the network are in agreement on the history of the transactions. In short, the security of the beneficiary is based precisely on the public nature of the ownership (but not, it is important to note, of his identity: the ultimate ownership of pairs of keys is not necessarily accredited), as well as on the general consensus of the network that the person who transferred the coin did not do so previously to any other beneficiary. All the necessary processes give rise to the distributed network and software on which Bitcoin is based.
A “Proof-of-Work” system
An iteration of the process begins with the combination in what is called a block of the bitcoin transactions made during a particular period of time. Before officially and by agreement including the block in the record or official chain of transactions (the block chain that defines the currency), it has to be worked by network nodes called miners to resolve a computation problem linked to the connection of this block to the chain, in other words to the last validated block. This problem has to meet the requirements of being relatively complex in computational terms, but with a solution in a reasonable time (let’s say a few days).
This mechanism is called Proof-of-Work or PoW, and is based on adding to each new block a field containing a hash that is formed by adding an additional chain to the content of the same field of the previous block; so that, after obtaining a new hash on the link of the chain, it begins with a specific number of zeros. This is a work of brute computational force that adds different arbitrary chains until the solution is found by chance, for which the miner nodes compete to be first. As there the computational power in the network grows, this work is becoming increasingly more complex through the simple solution of requiring increasingly more initial zeros to the hashes that are searched for, so that the addition of blocks to the chain remains at a relatively stable rate (one block every 10 minutes approximately).
The main objective of the PoW is for the chain resulting from the update of the transactions to resistant to attack: anyone who wants to forge the chain by modifying its blocks has to resolve the computational problem on the modified blocks competing against all the rest of the network, which is working on non-falsified blocks. The problem is further aggravated by the possible existence of subsequent blocks, which must also be the object of Proof-of-Work, as each hash of each block is interrelated with the previous block This competition against all the network of honest miners makes forgery statistically improbable unless a computational power is used that is comparable to the rest of the network.
Once the computational problem is resolved the block is added to the chain. It is clear that the block chain grows as transactions increase, and finally after the addition of the block, the result will be submitted to all the nodes in the network for their agreement. By convention, we agree that this chain is, in short, the coin.
- Bitcoin: A Peer-to-Peer Electronic Cash System, S. Nakamoto, 2008,
- https://bitcoin.org/en/bitcoin-paper (the Latin American translation is technically better than the Spanish)
- Source: Bitcoin: A Peer-to-Peer Electronic Cash System, Satoshi Nakamoto, 2008