# Trusted Third Party Application in Durable Medium e-Service
## 3 The Proposed TTP Application
### The Applied Blockchain Structure  
Nowadays, blockchain is one of the most commonly used solutions for storing data in structures that are difficult to manipulate. In the proposed e-service, a private version of the blockchain is used. This means that access to specific data (stored in blocks) is only possible with the appropriate access rights. Moreover, a separate blockchain is created by the TTP for each large entity (e.g., bank, ISP, financial institution). Thanks to this, data from different entities (e.g., bank and their customers) are not stored in the same blockchain.  
It should be noted that the security of a blockchain increases with the number of blockchain nodes. As the presented algorithm shows, the number of created nodes depends on the type of document and the number of clients. Because the presented e-service is dedicated to large entities (mainly financial), a large number of customers causes a large number of transactions. Moreover, it positively affects the security of the blockchain, and significantly reduces the possibility of manipulation (note that the blockchain is stored and managed by the TTP, not by the ISP). It is also worth noting that the generation of documents for clients (and storing documents' hashes in the blockchain) is iterative, and hence predictable in contrast to the clients' decisions (individual clients gain access to the document and make decisions at a random time).  
To effectively store the data in the blockchain, it was necessary to develop the structure of a single block (Figure 3). Several fields in the presented blockchain structure are typical for the blockchain network (e.g., \"index\", \"timestamp\", \"block hash\", \"previous block hash\", etc.), while the authors proposed the remaining fields:  
* customer ID (CID)-this numerical field is used to identify the transaction side that operated on the document (e.g., adding, accepting, rejecting). If an ISP adds a document for processing, this field assumes a value identifying an ISP. In other cases, these are numerical identifiers of the ISP customers;
* document ID (DID)-this is a generated hash of the signed document;
* operation ID (OID)-a numerical field where a specific value is assigned for each operation on the document (e.g., adding, accepting, rejecting);
* additional data-a field added for development purposes, and is not used yet.  
The proposed structure is flexible and allows for easy definition, for example, of new types of document operations (e.g., signing, requiring corrections, withdrawing, etc.)--only the expansion of the OID dictionary is needed. Moreover, the above structure can also be successfully used in an e-service in which the number of parties is not limited to three (e.g., there may be several equal entrepreneurs and each of them can initiate the document processing flow).  
Another important aspect related to the blockchain refers to the choice of the consensus mechanism-i.e., the technique of reaching an agreement on adding new blocks between the nodes of the network maintaining the blockchain. Since the blockchain is managed by the TTP, instead of using the proof-of-work (PoW) mechanism, which requires large computational resources, the more effective proof-of-authority (PoA) mechanism is used to mine blocks. Thanks to this solution, computing power is not required to create new nodes. In particular, the proposed e-service utilizes the Istanbul byzantine fault tolerance (IBFT) PoA algorithm. In private networks, where participants are known and trusted, PoA allows for much faster transaction processing compared to more decentralized consensus algorithms such as PoW or proof-of-stake (PoS). The lack of competition for block mining, as in the case of PoW, eliminates the need to solve complex mathematical problems, which speeds up the transaction verification process. Moreover, PoA is more scalable than PoW, and allows for more controlled blockchain management, making it easier to comply with regulations and legal requirements.