• No results found

2. THEORY

2.1 BLOCKCHAIN

2.1.1 Blockchain components

The ledger in a blockchain network contains every transaction done since the inception of the blockchain. Through the use of a consensus protocol and robust cryptography, there is no need for a central authority, and every node in the network has its copy of the updated ledger at all times. This aspect removes the need for an intermediary to record all transactions, and participants can do transactions with each other "directly," effectively removing the traditional middlemen. Centralized systems have the problem of a single point of failure, and therefore redundancies are introduced. On the other hand, a decentralized system can function even if a large part of the nodes are failing, effectively eliminating most of this redundancy. The technology behind this invention is intricate, but by breaking it down into components, the concepts are easier to understand.

Cryptography

"Cryptography is the science of protecting information by transforming it into a secure format"

(Christensson, 2015). While the concept of cryptography has been around for thousands of years, from simple substitution ciphers like the Caesar cipher to more advanced versions discovered by Arab mathematicians, the modern computer has changed the field entirely (Sidhpurwala, 2013). The immense computing power at our fingertips has fueled the

development of more advanced cryptographic techniques, which today is one of the underlying principles of blockchain. It makes it both transparent and secure.

Cryptographic hash

“Hashing is a method of applying a cryptographic hash function to data which calculates a relatively unique output for an input of nearly any size”.(Yaga, Mell, Roby, & Scarfone, 2018, pg.7) If two entities where to hash the same data they would derive the same result, however, if some third party had corrupted one of the entities data the hash would be completely different and the entities would conclude that the data was tampered with. So a small change in the input data yields a completely different hash. The phrase “Central Bank Digital Currency” using the SHA-256 algorithm hashes to:

“978e4c2bed936b8acfac77a710f983e9207f6c023a865b5923ac3d67ac9454b4”

“Central Bank Digital currency” on the other hand hashes to:

“f440420cb6023085a0cd62eee7635e9a3b121477f3fdaa0b4fce800ce7f3fef8”

While the difference is just the capitalization of the last word, the output is completely different.

Cryptographic hashing has three important security properties (Yaga et.al., 2018):

1. Preimage resistant. It is a one-way hash, which makes it close to impossible (computationally infeasible) to compute the input value from the output value.

2. Second preimage resistant. One cannot find an input that hashes to a specific output.

The only way is through a complete search of every combination, which computationally, is infeasible.

3. Collision resistant. There are never two inputs that hash to the same output.

In the blockchain network this hashing is used for:

1. Address derivation

2. Creating unique identifiers

3. Securing the block data - The blocks data is hashed and stored in the block header.

4. Securing the block header - The current block headers hash digest is stored in the next blocks header, securing and linking the blocks to each other. One can check that the hash digest is, in fact, the same in the header as in the block.

Cryptographic nonce

A nonce is a random number used once, added to the end of the block information, before hashing it. In the Bitcoin network, the miner then checks if this hash starts with 17 "0" s. If it does, then the miner has found a hash that satisfies the current rule and appends the block. If the hash does not fulfill these requirements, then a new nonce is tried. This measure lets the same data that everyone possesses differ when hashed, and finding the correct hash is computationally expensive (Nonce, 2019).

Asymmetric-key cryptography

Blockchain technology uses asymmetric-key cryptography that is a pair of keys: a public and a private key that are related to each other. The public key is used to make the address that all participants in the network can see, while the private key is only available to the owner.

Although anyone can see the address, this does not reduce the security associated with the blockchain. An attacker cannot derive the private key from the public key (A Deep, 2019).

The owner can use one to encrypt and the other to decrypt. This process enables trust between users by allowing users to verify the integrity and authenticity of the transaction while allowing the same transactions to remain public. A private key is used to encrypt a transaction so that anyone with the public key can decrypt it. By signing with the public key, the owner proves it has access to the private key. Private keys are used to digitally sign transactions while public keys are used to verify the signature (A Deep, 2019).

Address

Transactions are made more straightforward by blockchain networks using addresses that work as a public identifier for a user. This process involves hashing the user's public key along with some other data determined by the blockchain. This implementation could be done through QR-codes, as they can be easily made to work with mobile devices. This feature simplifies the transaction process as connecting with others is quickly done through a mobile interface. It is also central for smart contracts as addresses are used to determine where to transfer funds (A Deep, 2019).

Blocks

A block in a blockchain contains a block header and block data. The header contains metadata for the block, including the hash of the previous block header and a hash of the block data.

The data contains a list of validated and authentic transactions. Validating and authenticating the block is done by ensuring the transaction is formatted correctly and that each party has signed the transaction. These blocks connect by storing the hash digest of the previous block's header. This chain of hashed headers makes changing a previous block impossible, as this would alter the following headers (Frankenfield, 2019). Through consensus-mechanisms such as proof-of-work, going back through each block and altering the headers is both computational and time-consuming, to the point of being practically impossible.

Figure 1: The process of connecting blocks Based on Rosic, 2019