# A Time Bank System Design on the Basis of Hyperledger Fabric Blockchain
## 4 The Proposed Time Bank System
### Phase 1: Service Posting and Matching  
Phase 1 includes the three stages of member enrollment, service posting, and service matching. In this phase, users always connect to SC and invoke service Chaincodes. 1. _Enrollment Processes:_ At first, a user has to participate in the time bank system. He or she needs to enroll to become a valid system member since our time bank is a permissioned blockchain-based system. The enrollment process is depicted in the gray block of Figure 3.  
A candidate user has to access one peer of the system and sends an enrollment request to the fabric-CA with his or her certificate, which contains the user's name and some personal related attributes. Then, fabric-CA (which usually represents the time bank committee) checks the applicant's name and all other related attributes on the certificate. Once the validation is a success, the fabric-CA will sign the certificate. Any certificate without fabric-CA's signature is viewed as invalid. The returned messages from fabric-CA include not only a signed certificate but also a private-and-public key pair. These keys are used for providing digital signatures to the on-chain blocks. Moreover, fabric-CA is equipped with its own database for recording all the names that were enrolled. This design prevents users from enrolling duplicated names in a time bank. After an applicant is enrolled as a valid member, with the associated certificate and key pair, he or she can invoke a transaction to TC for creating his or her wallet, which is the place to save time credits (see Figure 4 for details). In our system, a valid member who creates a new wallet will get 10 free initial time credits. In order to promote the pre-described core values of time banks, this work tends to encourage participants to accept other services being offered. Getting free tokens without any service offering, in the beginning, can also attract people to join our time bank system. In GC, the enrollment of a new member will also initialize a zero grade for him or her. Figure 3: The information flow and processing procedures of the proposed time bank system. 2. _Service Posting:_ On-chain enrolled members can now start posting their service-related data (i.e., service proposals) on the blockchain. They can use their key pairs to access the peer, upload their service proposals, and invoke the PostService function on service Chaincodes in SC. Users can access different peers which implies they could go to different time bank centers on the premise that these peers belong to the same channel. In our current design, it is assumed that the involved service attributes include service type, name, date, service class, location, and time period. These attributes are the basis for service matching. 3. _Service Matching:_ After the service proposals are posted on SC, the proposed system tries to find matches as much as possible. Without a loss of the generality, this paper just uses a simple (intuitive) matching scheme to find matches while there are other complicated matching algorithms [13; 14; 15], whose adoption would enhance the matching performance. Either SP or SR needs to take all the attributes (except the location-related one) into comparison so as to find the matched services. Figure 5 shows the adopted service0 matching scheme in SC. In addition, to take various attributes into account for finding a match, there is another important factor, i.e., the service grade involved in our matching process. As previously described, GC allows participants to grade each other after they exchanged services. The value of a grade roughly indicates  
Figure 4: The information flow and the processes in the token channel (TC). Figure 5: The service-matching process in the service channel (SC). the quality of the service provided by an SP or the degree of temperateness to the service an SR receives. Those low-grade members should get punishment from the system so as to retain the time bank's core values. A possible solution to this is to make those low-grade members getting a match much harder.