Blockchain

In this article

The blockchain is a security and certification system that guarantees the integrity of data collections. This technology allows you to check that the data has not been modified retrospectively and to rely on digital content regardless of where it is located, reducing the transmission of data volume. The blockchain arises from the need to ensure the validity of data in electronic form, as well as on paper. Data collections can therefore be transmitted and stored on several computers simultaneously in a reliable way, with the certainty that the data modification is blocked.

Definition of Blockchain

Domenico Zucchetti, the founder of Banana.ch, defines the blockchain as follows:  

"The blockchain is a collection of data than can grow, made up of blocks in sequence, where each block has its own cryptographic hash concatenated with the previous one, so that the hash of the block certifies the integrity of the content of the block and also of the entire collection from the beginning to the block itself". 

It follows from this definition that the blockchain data structure allows new elements to be added without compromising the integrity of existing hashes. In accounting, this is crucial because you need to be able to certify and verify the integrity of accounting transactions entered up to a certain point, but also add new ones.

This feature is also fundamental to manage distributed accounting journals, as in Bitcoin. In fact, the different nodes of the system can be sure to have an exact copy of the data only by exchanging a limited number of information. In fact, the blockchain allows:

  • To make sure that the content of the journal is the same simply by exchanging only the hash of the last block.
  • To know to what extent the collection is the same, exchanging only the hash of the previous blocks.
  • To align the contents, only by transferring the missing blocks.

With traditional databases, it would be necessary to exchange all journal data to verify data integrity. Data verification could be done with a limited number of counterparts. With the Blockchain instead, it is possible to verify the data simply by exchanging the hash. A large number of counterparts can then be queried, making it highly unlikely that anyone could set up a forgery system.

With traditional databases, it would be necessary to exchange all journal data to verify data integrity. Instead, with the Blockchain each node in the network is able to query a large number of counterparts to verify that its journal is the "real" one. In the Bitcoin system, each node in the network thus also takes on the role of content validation, making it extremely difficult for someone to set up a forgery system.

History 

The blockchain is a new technology that has developed in recent decades and is gaining ground in several areas to ensure the authenticity and integrity of data in electronic form. The path that led to the birth of the blockchain can be divided into three main stages. 

The first phase dates back to 1979, when Ralph C. Merkle patented the cryptographic functions of hash and a data structure later called Merkle Tree. The Merkle Tree is a data tree structure that uses the concatenation of cryptographic hashes to ensure integrity and fast access to blocks of data.

In 2000 Stefan Konst presented his diploma work, , Sichere Log-Dateien auf Grundlage kryptographisch verketteter Einträge (Secure log files based on cryptographically concatenated entries).

In 2002 Domenico Zucchetti, founder of Banana.ch, patented a certification system for data collections formed by a sequence of elements, such as the movements of an accounting journal (US Patent No. 7,020,640).

  • For each accounting transaction, a cryptographic hash is calculated that includes the hash of the previous transaction. The hashes concatenate with each other so that the hash of a movement certifies the content of the transaction and also the journal as a whole. This structure allows new movements to be added while maintaining the integrity of the cryptographic hashes of existing movements.
    • Securing Accountable Data (2002, pdf).
      Introduction to the blockchain technology used in the software in Banana Accounting.
  • The method is verified by experts from a leading international auditing company and is considered compliant with the legal regulations in Switzerland and Germany. Historical note the new versions of the software use the SH256 Hash method and no longer the MD5 mentioned in the documents.
  • The Banana Accounting software introduces the system of concatenated cryptographic hashes to ensure the integrity of the accounting movements. The objective is to have a system that offers ease of use and the possibility of modifying the movements, but also the maximum degree of security and conformity with the legal regulations.

In 2008, Satoshi Nakamoto invented Bitcoin's cryptocurrency based on a distributed journal, where each block of transactions is cryptographically linked with the previous one. From this moment, the system of cryptographic chaining of elements in sequence will be called blockchain.

 

Example of a blockchain data structure 

Below is an example of an accounting journal of Banana Accounting. Each transaction is represented by the line of the journal that has a cryptographic hash calculated on the basis of the content of the cryptographic hash of the previous line. The hash of the line is the result of the concatenation of all the hashes of the previous lines and it is also the certificate that guarantees the integrity of the journal data from the beginning of the journal. 
Adding other lines, each with its own hash, will not invalidate the previous hashes.   

blockchain

Collection of historical data 

The blockchain is a data collection designed to preserve data integrity through cryptographic hashes. Therefore it is used for historical data, which once created and validated no longer need to be modified, such as an accounting journal or access register. The blockchain is not suitable for data that need to be continuously updated, such as the line of an account in accounting, with the balance that is recalculated each time you add a new transaction.  

Block data in sequence  

The term "blockchain" is an English word that indicates a "chain of blocks". The collection consists of blocks of data, which have a certain sequence. In the case of an accounting journal each block is a single transaction. In the Bitcoin system, however, each block contains a series of accounting movements organized as Merkel Tree (see above). In the blockchain data structure the order in which the blocks follow each other is as important as the information contained in the block. In fact, the blockchain ensures the immutability of both content and data sequence. 

Each block, as well as transactions, can be consulted, but cannot be altered. Subsequently, new blocks are added, but without changing the previous ones.

Blocks are concatenated with each other, so the hash of a block depends on the content of the previous one, which in turn depends on the previous one and so on. The hash of a block is therefore also the hash of the entire data collection and certifies the integrity of the entire collection. If any content of a block changes, its hash will also change. If the chain is correct, it means that the contents are intact.

Cryptographic hash

The hash sum or  hash is a text calculated through the hash function on the basis of a certain set of data. The hash function is an algorithm that converts a text line into a series of letters and numbers. The term "hash” also means "to chop" or "jumble". As a matter of fact, the function takes a line text (input) and "chops" it, transforming it into a "jumble" of characters (hash sum). 

 

 

(Source: Wikipedia) 

The cryptographic hash is a type of hash that satisfies a number of characteristics that allow it to be used as an identifier and certificate of integrity of the set of data used for its calculation. To be considered a cryptographic hash, it must have the following characteristics: 

 

  • it is deterministic, meaning that the same message always translates into the same hash

  • it is fast in calculating the hash value for any message  

  • it is not possible to generate a message that produces a given hash value, i.e. reverse the process that generated the given hash value (unidirectionality). This implies that the hash can be easily shared with third parties without exposing the original content. 

  • it is not possible to find two different messages with the same hash value (concept called collision resistance)

  • a small change to a message will change the hash value so radically that the new hash value will appear unrelated to the old hash value (called avalanche effect) 

Source

Finally, cryptographic hashes are legally accepted if they meet three main features:

  1. they guarantee the criteria of uniqueness (there are no collisions); 

  1. they guarantee the unidirectionality of the data;

  1. they are difficult to attack.

Concatenation of cryptographic hashes 

In the blockchain each block of data has a cryptographic hash that is calculated based on the contents of the block data and the hash of the previous block. This creates a cryptographic chain. The block hash also becomes the certificate of the entire data collection from the beginning to the last block. 

In Banana Accounting each registration is equivalent to a block which is represented by a cryptographic hash. From the second registration, the data of the block is added to the data of the previous block, thus resulting in a new hash that takes into account all the previous hashes. 

The following image shows the concatenation of the blocks in the accounting journal in Banana. Each block has a sequence number that serves to guarantee the progressiveness of the data. 

 

giornale in Banana Contabilità

 

Modifying the content 

The hash concatenation implies that if the contents are the same the hashes will remain the same. If the contents or the sequence changes, the hashes will be different.  

The following two images show what happens if the value of a single amount is modified in Banana Accounting. The modified ledger shows the amount 40 CHF instead of 30 CHF indicated in the second line of the original ledger. When the data is altered, the cryptographic hashes will also change from the line number that was modified (in this case the second line). The hash will therefore be completely different since its function has been changed significantly. 

cryptographic hash

blockchain

Certified Journal  

For accounting, legislation requires data to be recorded progressively. In accounting, the journal is the collection of all transactions. Each transaction contains all the elements necessary to keep the accounting: date, reference to the documents, description, Debit Account, Credit Account, amount, etc...  

For each transaction a cryptographic hash is then calculated which guarantees the integrity of each transaction and of the entire journal up to that point. As a result, the accounting journal is certified.

The steps of the blockchain creation  

The stages involved in creating the blockchain can be summarised as follows: 

  1. Collection and creation of data blocks. 

  1. Verification of data.

  1. Fixing data sequences. 

  1. Calculation of cryptographic hashes. 

The way you create a blockchain data structure may differ depending on the application.  

In the case of Banana Accounting the sequence is as follows: 

  1. The accountant enters or imports the data in the records table and enters all the necessary information for each transaction.  
  2. The data manager checks that the data is correct from a material point of view (the data corresponds to the actual transaction) and from a formal point of view (the give and take accounts are indicated correctly).  
  3. The verification of the data can take place in several moments. For example, at the end of the period the bank movements and the balance are compared with those of the bank statement. If there are differences, they will have to be completed as long as the accounting values do not correspond to the reality.  The user gives the Command Block Registration lines specifying until which date the movements must be blocked (generally the controlled data are included). When this command is given, the program performs the following operations: 
  • it checks if the movements to be blocked do not contain errors;

  • it verifies that the sequence of previous cryptographic hashes is correct; 

  • it assigns a progressive sequence number to each transaction, starting from the last previous sequence number;  

  • it calculates the cryptographic hashes of each transaction by concatenating them with the one of the previous line.

  • it presents a summary of the blocking operation. 

Demonstrating data integrity  

To be able to verify the integrity of a Banana Accounting journal you should:  

  1. give the verification command in order to recalculate the cryptographic hash of all movements.  
  2. verify that the cryptographic hash of the last line is the same as the one stored. 

The cryptographic hash that resulted at the time of the lock must be saved in order to be able to verify the integrity of the data. The way the cryptographic hash is stored and protected depends on your organization. If you do not keep the hash, you will not be able to verify the integrity of the data.  

Uses of the blockchain  

The Blockchain is used in various ways. First, it is used in the preservation of growing historical data, whose contents must not be changed. The typical example is the accounting journal. 

Secondly, blockchain data collections are particularly suitable for sharing distributed newspapers (e.g. Bitcoins) because they minimize the need for data transfer. You can verify that the data is the same by simply sharing hashes.   

This way you can know up to which number of blocks the two collections are identical.   

In addition, to match the contents, you only need to transmit the data of the missing blocks.  

Blockchain in Accounting 

Banana Accounting was a pioneer in blockchain technology in the financial field. In fact, even before the blockchain acquired its name, Banana had already obtained a patent in 2002 for a security system in an accounting software. Thanks to cryptographic hashes, this method makes it possible to certify the validity of the data in order to comply with legal tax regulations.  

In fact, with the progress of digitalization, it is necessary to transform all paper documents into electronic form. The certification of data through the blockchain allows us to rely on electronic documents, in the same way we relied on signed paper documents. In this way, we can prove that information, in this case all accounting transactions, have not been changed retrospectively and can be transmitted to the authorities without having to print anything.

Features of blockchain data collections  

  • Data collections are structured in blocks and are immutable. 
  • Different contents produce different hashes. Any changes to the contents of the collection will result in different hashes.  
  • Identical contents produce identical hashes. By comparing the hash of the last block of two data collections you can know if the contents and their sequence are the same.   
  • Integrity check. By retracing the sequence of blocks you can recalculate the hashes of all blocks and then verify that the contents of the collection have not changed.  
  • Block sequence. Blocks must contain an element that can define their sequence. Usually it is a progressive number or a reference to the identifier of the previous block.   
  • Adding blocks. When you add a block, the hash of the block is calculated based on its content and the hash of the previous block. The hash of the new block then becomes the hash that also certifies the entire data set. The hashes of previous blocks will remain valid.   
  • Distributed databases. By simply exchanging hashes, you can verify that data collections in different places have the same content.   

Share this article: Twitter | Facebook | LinkedIn | Email