Название: The New Advanced Society
Автор: Группа авторов
Издательство: John Wiley & Sons Limited
Жанр: Программы
isbn: 9781119884378
isbn:
Figure 2.4 Representation of the RT contract.
Figure 2.5 Representation of the TT contract.
2.3.3.3 Transfer of Cash (TT) Contract
According to this contract, the client can send the amount requested, in the form of cash, to the main contractor. Therefore, the client is the only participant who can initiate this contract. The cash state is paired with this contract.
As mentioned in Figure 2.5, this contract requires zero input states and gives one output state. The signatures of the client and the main contractor are mandatory in this contract for a successful transaction. Hence, this transaction is visible only to the client and the main contractor.
2.3.3.4 Updation of the Task (UOT) Contract
According to this contract, the subcontractor can update the status of the task that was assigned to him by the main contractor. Therefore, the subcontractor is the only participant who can initiate this contract. The task state is paired with this contract.
Figure 2.6 Representation of the UOT contract.
As mentioned in Figure 2.6, this contract requires one input state and gives one output state. The signatures of the client, the main contractor, and the subcontractor are mandatory in this contract for a successful transaction. Hence, this transaction is visible to all three participants.
2.3.4 Flows
A flow is a series of steps that tells a node how to attain a specific ledger update thus, automating the process of unison with ledger updates. Communication between nodes occurs only in the accordance of these flows and this happens on a peer-to-peer basis. When a flow waits for messages from other nodes, the flow is suspended, serialized, and check-pointed. If a node fails or restarts, the check-pointed flow is deserialized and started where it left-off. In this case, the flow is suspended and check-pointed until the participant gets a response from the required participants [58]. After the above-mentioned contracts are executed successfully, each contract will be associated with their respective flow.
2.3.4.1 Flow Associated With CAT Contract
The flow associated with the CAT contract describes the interactions that occur between the participants of this contract. Figure 2.7 depicts that the main contractor is the initiator and the subcontractor and the client are the responders.
Figure 2.7 Flow of the CAT contract.
Figure 2.8 Flow of the RT contract.
Figure 2.9 Flow of the TT contract.
Figure 2.10 Flow of the UOT contract.
2.3.4.2 Flow Associated With RT Contract
The flow associated with the RT contract describes the interactions that occur between the participants of this contract. Figure 2.8 depicts that the main contractor is the initiator and the client is the responder.
2.3.4.3 Flow Associated With TT Contract
The flow associated with the TT contract describes the interactions that occur between the participants of this contract. Figure 2.9 depicts that the client is the initiator and the main contractor is the responder.
2.3.4.4 Flow Associated With UOT Contract
The flow associated with the UOT contract describes the interactions that occur between the participants of this contract. Figure 2.10 depicts that the subcontractor is the initiator and the main contractor and the client are the responders.
2.4 Implementation
In the process of completing any construction-related contract, the number of actors and procedures involved is too high, making the system branched and complex. For the sake of simplicity, this solution assumes three main actors: the client, the main contractor and the subcontractor and the procedures involving the creation of tasks by the main contractor and the transfer of money from the client to the main contractor and the subcontractor. The main motive of this solution is to keep the client in loop with all the transactions that occur during the completion of the construction, such that the client is in light regarding the expenditure of every penny spent. To achieve this, the solution utilizes a platform provided by R3, namely Corda [59], where all information is only shared with the remaining nodes on a need-to-know basis.
2.4.1 System Overview