• No se han encontrado resultados

4.8. TIPOGRAFÍA 95

4.8.1. BREVE HISTORIA 96

To better understand what the BlockChain is and the role it can play in Self-Sovereign Identities, it is essential to understand the basic building blocks of any BlockChain. To this effect, we have provide Figure 2.5. which shows a layered view of the BlockChain.

Figure 2.5: Blockchain

Physical Layer

This layer is quite similar to the physical layer of the OSI [BP04]. However, in the blockchain perspective, it is made up of disorganized computers. These devices are not limited to Per- sonal computers.

Peer to Peer (P2P) Layer

This is the first level of organization in a blockchain. At this layer a protocol for a peer to peer network is established for communication between disorganized computers [DW13]. This protocol achieves objectives such as adding new peers and assigning GUIDs, remov- ing peers, routing data through the network, routing table management, and many more. There are several algorithms for peer to peer networks. They include Chord, Pastry, etc.

If a BlockChain is open for any computer can join in at this P2P layer and perform any actions (transactions & mining), this is called a permissionless BlockChain. Two typical examples are Bitcoin and Ethereum. However, in some cases, it is desired that some special privileges be reserved for special nodes, and not everyone can join in the physical layer of the block. This kind of BlockChain is called a permissioned BlockChain. A typical example is HyperLedger.

Content Layer

This layer is concerned with the data structures that hold BlockChain data on each node in the peer to peer network. In Bitcoin and Ethereum data is stored in blocks with each block pointing to the previous block. The first block points nowhere and is called the genesis block. Typically this block is hard coded. This data structure is quite similar to a linked list. In other blockchains like IOTA [DB18], a Directed Acyclic Graph(DAG) [SdSSW95] is used which is commonly known as a Tangle. Whatever data structure at the content layer acts as the ledger that is distributed among nodes in the BlockChain.

The content layer may also denote the type of storage (usually Distributed Hash Tables (DHT)) [KK03] used by the BlockChain. For example SWARM [DMH17] architecture used by Ethereum.

Consensus Layer

The consensus layer ensures that every peer in the network agrees on the same content at any given time using algorithms called consensus protocols. Some of these protocols include Proof of Work, Proof of Stake, etc. [ZXDW16] More about consensus is discussed in the next section.

Primitives (State, transactions, and state Transition function)

A BlockChain can be viewed as a State transitioning system. In a BlockChain there exists a conceptual state transition functionF, such thatF(S, T[n])→SI, whereS is a valid old state and SI is a valid new state.T is an array of n transactions to be added to the new block.[Woo14] The state transitioning functioning enforces the properties of the consensus layer. In Bitcoin,F ensures that each transaction inT is unspent, has a signature matching the public address of the UTXO, and that transactions do not create value, thus, the sum of all input UTXO is greater or equal to the sum of all output UTXO in the transaction.

Only coinbase transactions create value in the form of miner rewards. Also, if input UTXO is greater than output UTXO, the difference is considered the transaction fee.

Lastly, each transaction has a unique ID which is usually a cryptographic hash [4] of the content of the transaction. This unique ID can be used to verify the validity of any transaction. However, not every node has the luxury of maintaining a database of all trans- actions (and state). Such a node is called a full node. A majority of nodes, known light nodes, instead of maintaining a database of all transactions (and state) use a technique called a Merkle tree, so named after its creator Ralf Merkle. to validate transactions.

Merkle trees perform consecutive hashes of transactions (which are the leaves of the tree), iteratively pairing and rehashing, until one hash is formed. This is known as the root hash. Therefore, for a light node to verify a transaction, all they need is the transaction ID and the Merkle Proof of the transaction. This information can be obtained from a full node.

Merkle trees are extremely efficient and secure depending on the Hash function used. In Bitcoin a double SHA256 hash function is used mainly to provide a higher collision resis- tance [XLD05]. After the successful attack (collisions found at 2ˆ65 instead of expected 2 ˆ

80), there was a growing fear among the Bitcoin designers that SHA256 had inherited the same weaknesses since the design of SHA256 is also based on the same Merkle-Damgard construction as SHA1. Therefore two rounds of SHA256 is expected to provide a higher collision resistance.

Ethereum, however, uses a different hash function altogether called Keccak256, which is based on sponge functions[BDPVA09]. It should be noted that Keccak256 is strictly dif- ferent from SHA3[Cona].

Advanced Protocols

At this layer the primitives are used in innovative ways to create value in use cases. A few of these use cases are:

• Smart contracts – accounts that are controlled by program code (autonomous agent) such that each transaction to the Smart contract executes the code in the contract on all nodes [Woo14]. Input data may be provided in the transactions to Smart contracts.

• Atomic swap – Exchanging currency between two blockchains [But16]

• Payment Channels – Creating an offchain way to make transactions and executing settlements on the BlockChain.

Documento similar