## 4 BIMcontracts Approach
### Concept Description  
The core of the BIMcontracts system is a so-called billing container that enables the processing of payment-relevant transactions via smart contracts (see Figure 1, 1). In addition to the BIM model and the BoQ, the billing container comprises a billing plan that has been designed to automate transactions [56]. Individual billing units are defined on the basis of the BoQ. If a billing unit is completed and confirmed by the client, the contractor will get the agreed payment of the billing unit. The billing units contain inputs about lump sums, unit prices with quantities, and the completion date. Furthermore, they reference the construction work items and building elements to be completed by linking to both the BIM model and the BoQ. All billing units together compose a billing plan, which also has to be agreed upon between the two contracting parties. Depending on the type of the contract and the underlying service description, billing plans can have different details, from a rough trade-oriented structure with lump sums to the mapping of each quantity from the QTO to the billing unit. The grouping of items from the related BoQ is also possible. All linked digital contractual elements (BIM model, BoQ, and billing plan) can be combined into an information container according to the ICDD standard, as presented in [56].  
The workflow of managing smart contracts essentially consists of three phases: the preparation phase, the initialization phase, and the execution phase (Figure 2). The preparation phase primarily includes the arrangement of blockchain identities and registration in the system. The billing container and the paper-based contract are to be coordinated for each contractual relationship during the negotiations and can then be loaded into the BIMcontracts system. Once verified, the execution details of single billing units, control procedures, and the contractual agreement as a whole can be customized as a part of the Smart Contract Configuration (SCC) (Figure 1, 2). The SCC is a machine-readable format of all relevant information and agreed-upon contract terms.  
Figure 2: Three phases of the workflow for managing smart contracts.  
As soon as an agreement has been reached, the linked digital contractual elements (BIM model, BoQ, and billing plan) and the SCC are exported as an information container, referred to as the BIMcontracts Container (BCC), according to the ICDD standard (Figure 1, 3). Figure 3 shows the file structure of the container. The container is stored off-chain in the CDE. The calculated hash values of both container and internal files are included in the confirmed paper contract to identify the billing basis of the contract. In the next step, a scan of the signed paper-based contract and its hash value are also loaded into the system and stored in the CDE (Figure 1, 4). Afterwards, smart contracts are generated based on the SCC, including the hash values of all documents, and finally, the smart contracts are deployed on the blockchain. The contract conclusion is completed once both contracting parties have signed the smart contracts with their blockchain identities, thus initiating the execution phase (Figure 2). If the client checks and confirms the contractor's work result during the execution, the inspection report will also be stored in the CDE (Figure 1, 5), and a direct payment from the client's bank to the contractor's bank will be triggered based on the billing plan data and the smart contract conditions (Figure 1, 6). The following sections discuss each phase in detail and introduce the software architecture of the framework.