In this part, the theoretical basis and the concepts used in this study are discussed. The concepts explained include theories and applications about Halal Supply Chain, Blockchain, Permissioned Blockchain, and Hyperledger Fabric.
Halal Supply Chain Management
Halal Supply Chain Management may be defined as a network in assuring the entire process of procurement, distribution, handling, and processing materials, spare parts, livestock, work-in-process or finished inventory to be well documented and performed fit to the Halal and Toyyib [
6]. Halal itself is something that is permitted in accordance with the rules that already exist in the Qur’an and the Hadith, while the term Toyyib means healthy and good [
8]. The Toyyib concept can also be used to enrich society with spiritual, moral, and humanitarian values, as well as food safety regulations [
9]. However, the gray area (located between halal and haram) causes doubt in the application of the Halal concept. Therefore, the opinion of the academic, religious regulations (fatwas), and local customs in assessing and determining the product is needed to determine which product is prohibited or allowed to be consumed [
10].
Halal Supply Chain carry five fundamental issues, which are traceability (ability to discover information about location and origin of the product); regulation for product withdrawal related to halal prerequisites; end-to-end Halal Supply Chain integrity from producer into customer; contradictory systems and different interpretations regarding Halal Supply Chain; and lack of integration of technology and information with the Halal Supply Chain [
11].
Blockchain
Blockchain technology is one of the alternative solutions that can improve Halal Supply Chain. This technology could resolve these problems since it could act as a distributed ledger and entitle all transactions to be completely open, yet confidential, immutable, and secured. Blockchain provides security as protection and prevention from duplication, or distortion of data from outside noise. The participants (in decentralized-computer-terminal form) are connected by using key-access system enabling direct transactions between sellers and buyers without intermediaries [
12]. Because blockchain nature is a distributed ledger database, there are many things that can be improved by using blockchain such as big data for data analysis [
13,
14].
Supply Chain transactions will be gathered in a set of blocks when each set of new transactions is added successfully. The block will be added to the Blockchain Network in a linear chronological order with timestamp [
12]. Each supply chain participant, known as peer node on Supply Chain Network, receives a copy of blockchain which can be downloaded automatically. Peer nodes would have access to all information which includes supply chain participant’s address and supply chain path, hence even the user will know the flow of the manufacturing process of a particular product [
15].
Permissioned Blockchain
Permissioned Blockchain, which is a specialized form of blockchain for private transactions and having sufficient speed of transactions in real time basis [
16,
17], is the most suitable type of Blockchain Network for Halal Supply Chain. The role of each Supply Chain participant will be determined by the administrator to decide what information can be seen and added. Intrinsic configuration of the blockchain manages transaction nodes and defines the role of the nodes in accessing or making changes to the Blockchain, including maintaining the identity of each Supply Chain participant in the Blockchain Network [
18]. Supply chain participants such as suppliers, distributors, wholesalers, and retailers focus solely on their respective parts. Thus, regulators are essential to determine the role of each supply chain participant even though in determining each role, must also be made by consensus so that no one feels disadvantaged [
16,
19].
Halal Supply Chain and Blockchain
Halal Supply Chain needs transparency thus authenticity and reliance of halal brands can be ensured. Blockchain combines distributed ledgers and smart contracts so that the performance of the Halal Supply Chain will be increased. The improvement will generate more dependable information and assurance of Halal Supply Chain; smooth and effective halal process from beginning of production process to consumer’s point of purchase; Halal Supply Chain sustainability; consumer trust in the halal brand; and acknowledgment from worldwide of the halal Blockchain [
6].
Fundamental principle of Halal Blockchain is to combine all different Mazhab in targeted markets with Islamic schools, religious regulations (fatwas), and local traditions. Halal Blockchain must be pertinent for all countries (be it Muslim or non-Muslim). Halal Supply Chain participants are given information automatically about the process compliance based on specific product market scenarios. Halal Blockchain’s authenticity and security is a priority to secure confidential data and minimize the opportunities of cyber-attack [
5].
Halal Blockchain gives some benefit to producers, distributors, retailers, logistic service providers, and halal certification agencies. Halal certification agencies must adopt Blockchain technology to gain more trust and authenticity of the halal brand. They need to support halal certification of all Halal Supply Chain Instances to encourage the application of more obedient transportation and warehousing downstream the Supply Chain. Harmonizing the standards of Halal Supply Chain in various countries will be critical to support the Halal Industry and their global supply chain [
5,
11].
Prior research related to Blockchain and Halal Supply Chain stated that there are three issues faced by the Halal Supply Chain globally, which are: contamination, disobedience, and perception. In this case, Blockchain technology is potential in resolving the first two problems (i.e., contamination and disobedience). However, the application of Blockchain needs to combine with Halal Certificate from each Supply Chain participant to get a better outcome [
6].
Hyperledger Fabric
Hyperledger Fabric is an open-source Distributed Ledger Technology platform which is widely used for various company-related cases. This platform is very interactive to create a blockchain framework due to its modular and configurable architecture. The explanation of Hyperledger Fabric documentation is also very comprehensive compared to other platform and there are many developers contributed to developing this platform.
Hyperledger Fabric V.1.x distinguish the transaction into two types, execution transaction and ordering transaction. Whereas, there are three steps of transaction flow, which are execution, order, and validation. Each transaction can be executed in separated peer and can be executed before consensus from the ordering service is executed [
20].
In the Blockchain system, there are some key terms such as nodes, data structures, transactions, ordering services, and channels [
16]. Blockchain Networks must consist of several nodes. These nodes are usually defined as a virtual entity because it could run on physical hardware. Peers, orderers, and clients, in general are a set of nodes in the Blockchain Network [
21]. Peers make transactions and distribute ledgers. In general, all peers are committers. On the other hand, orderers keep all the orders from the transaction that has been committed, creating new blocks, and search for consensus.
Clients are a set of nodes that act as end users of Blockchain Networks. The roles of client are sending a transaction proposal to peers, coordinating the results of the execution, verifying whether the transaction is valid, and sending the transaction that has been verified by peers to the ordering service. Furthermore, the data structure maintains global status in all associates using key value storage and ledgers (KVS). KVS manages and maintains the system to be updated, while the ledger provides a valid and verified history of all state changes [
21].
In Hyperledger v1.4.x there are several types of transactions, such as init (deploy), invoke, and query. Init or deploy is useful for installing and instantiating chaincodes hence the transactions can be run. While invoke are useful for invoking transactions from chaincodes that have been installed and instantiated, query can be used for checking what transactions were successfully carried out in the process [
22].
The transaction flow on v1 fabric follow the following steps:
1.
The client makes a transaction and sends it to all endorser peers according to the chain.
2.
Each endorser peers authorizes transaction execution and makes endorsement signatures.
3.
Clients collect support signatures from endorser peers and collect them through the ordering service.
4.
Ordering services create transaction blocks and maintain orders with a timestamp.
5.
When supporting partners receive a block of transactions, they will assess the transaction against its authorization policy, then determine the validity of the transaction.
Ordering Services Nodes provided by Hyperledger Fabric have the role of managing and maintaining channel configuration as well as executing the transaction process. In the channel configuration section, ordering services nodes has the power to control the basic channel access section along with a consortium, which is configured in advance through the configuration file. Ordering service nodes can control which nodes, according to the previously defined consortium, are able to read and write transaction data [
23].
Ordering Services Nodes also have some functions for each process of transaction flow (Order, Execute, Validate). In the Order Phase, the ordering service node will collect endorsed transactions (transactions that have already been endorsed by endorsing peers) from clients. After the collected transaction process hit batchSize (the limit of transactions that can be collected per batch) or batchTimeout (the time limit for collecting transactions per batch) [
24], ordering service nodes will set batch transactions in a strict order and turn them into a block in the execute phase. Since transactions inside the block are in strict order, all successful and validated transactions will not be thrown away (there will be no ledger forks). Last but not least, in the validation step, the order will allocate blocks to all peers that are connected to the same channel (depending on the configuration of the channel) [
23].
There are three types of Ordering Services Nodes Implementation, which are Solo, Kafka, and Raft:
Solo is one of Ordering Service Implementation to evaluate the Blockchain that has been developed. Solo operates without a consensus algorithm and contains only one ordering node [
23].
Kafka is one of the ordering service implementations originated from the Crash Fault Tolerant (CFT), where the process can proceed even though some of the current nodes encounter N failures while N/2 + 1 nodes still able to run [
24]. This consensus mechanism uses “leader and follower” in the configuration node and is handled by Zookeeper Ensembled. However, the method of seeking offset numbers is from the ordering service node (the ordering service node has already been configured to preserve local logs) and not via Kafka partitions like the usual process of kafka. The process is slower than straight from Kafka but duplication of the block is unlikely to occur [
10,
22,
23].
In fact, Raft is similar to Kafka because the implementation of the ordering service also uses CFT. Raft uses the Raft consenter as ordering services nodes to implement the “leader and follower” process. The raft is also used by Hyperledger Fabric as a bridge connector to create a consensus of Practical Byzantine Fault Tolerant since they have a similar procedure in the integration of Hyperledger Fabric [
23,
25].
Kafka and raft have the same consensual mechanism, but there is an apparent difference in the operation of the two ordering service node implementations. These aspects are the main reason for driving the use of Raft rather than Kafka in this paper.
1.
General comparison
Kafka and Zookeeper not compatible for massive networks. However, there are several organizations and channels on the Blockchain Network, the mechanism almost like one organization only which is not too decentralized. Raft on the other hand, uses ordering service nodes as a state replication machine (Raft Consenter) directly. Thus, all organizations in the Blockchain Network will have their own ordering service node and the Blockchain Network will be more decentralized [
23].
Kafka also requires docker images to run for the CFT since Kafka was developed by Apache. This is overly complex, and its application needs to be further studied. On the other hand, Raft was natively developed by Hyperledger Fabric itself to make it easier [
23].
2.
Difference in terms of configuration
Overall, Raft is simpler than Kafka in terms of configuration. Raft is designed directly from the ordering service node [
25] while Kafka must use Kafka brokers and Zookeeper Ensemble to make CFT process work [
22]. However, Raft is more difficult than Kafka when configuring the individual channel because Raft must set up the transport layer security (TLS) certificate for client and server [
25]. While Kafka only needs to decide the number of Kafka brokers and Zookeepers [
22].
When building a docker container, Raft only uses ordering services nodes that have already been configured by the previous network configuration [
25,
26]. On the other hand, Kafka must separate the work of Kafka and Zookeeper containers and must specify the amount of Kafka and Zookeeper containers in the docker compose file. That is why the process of running CFT using Kafka is getting trickier [
22].
All nodes, such as peers, can interact with other peers by using channels or using private data. The channel is private in terms of making transactions; only users who are on the same channel can only make transactions. Yet, users in a different channel can see the data due to the transparency concept. In contrast, private data makes transactions private in the channel and specific peers. Only peers that are already configured with it can do the transactions, even though it will eventually be distributed to others when the block is distributed [
27].