Gemcash

Gemcash

GEMCash is a diamond backed cryptocurrency and a blockchain system. We were contracted to develop
their blockchain system. Currently they are preparing to launch.The GEMCash cryptocurrency was built utilizing the GEMCash blockchain. The GEMCash blockchain is a lightweight, decentralized, and uniquely permissioned blockchain that runs embedded in hardware devices throughout the network. Retailers who are provided with the GEMX P.O.S. system enable users to make purchases with their GEMCash Coins. The GEMCash Coins are stored as ERC-20 tokens in the ledger. All the participating Retailers in the GEMX system will run a blockchain node (Master-Node) that is embedded in the physical devices provided. These Retailers, running the blockchain nodes, are governed by the GEMNation Governance Body. With the GEMCash cryptocurrency, we bring physical attributes and organized governance for a non-volatile, asset-redeemable coin that has commercial usage. The GEMCash blockchain operates as a scalable, lightweight, closed-loop, and uniquely permissioned
blockchain system. The digital identities of the users (digital identities are bound to the GEMCash cards), vendors, and the user’s coin balances are all recorded on the GEMCash blockchain ledger. The blockchain supports running on specialized lightweight hardware devices. The GEMNation Governance Body determines the parties who will be authorized to run the blockchain nodes. These nodes are bound to the hardware devices that are given to newly onboarded Retailers and GEMNation participants.
There are three types of entities that represent the GEMCash Coins in the marketplace,

1. Retailers
2. Users
3. GEMNation Governance Body

The GEMNation onboards Retailers into the GEMX system and authorizes them to distribute both GEMX
Cards and GEMCash Coins. Users acquire cards and coins to purchase goods \& services at the Retailers.
This is accomplished via adapted P.O.S. Terminals that debit GEMCash Coins from GEMX Cards as
payment. Users also buy and sell GEMCash Coins at the Retailers. GEMX Cards act as a digital “cold”
wallet for coins. GEMCash Coins can also be held and transferred via a cellphone “hot” wallet(Fig1)

The Retailers also run lightweight GEMCash blockchain nodes embedded in a hardware device, provided b GEMNation. These devices run the Linux operating system. These devices can verify digital identities in the GEMX Cards in order to complete transactions (GEMX Cards have unique digital identities). The GEMX Card bonds the public/private key pair and is used to store digital identities. The Governance Body of GEMNation handles both the oversight and release of GEMCash Coins. The public keys associated with GEMX Cards are pre-registered in the GEMCash blockchain ledger. The governance body defines the number of GEMCash Coins issued into the marketplace. Prior to their release, GEMCash Coins are collateralized (“Backed”) by depositing diamonds in third-party custody (banks). Newly issued coins are priced based on a value to price parity with the diamonds backing them. At any point in time, users can redeem these diamonds in exchange for their GEMCash Coin holdings

Architecture

The Retailers also run lightweight GEMCash blockchain nodes embedded in a hardware device, provided b GEMNation. These devices run the Linux operating system. These devices can verify digital identities in the GEMX Cards in order to complete transactions (GEMX Cards have unique digital identities). The GEMX Card bonds the public/private key pair and is used to store digital identities. The Governance Body of GEMNation handles both the oversight and release of GEMCash Coins. The public keys associated with GEMX Cards are pre-registered in the GEMCash blockchain ledger. The governance body defines the number of GEMCash Coins issued into the marketplace. Prior to their release, GEMCash Coins are collateralized (“Backed”) by depositing diamonds in third-party custody (banks). Newly issued coins are priced based on a value to price parity with the diamonds backing them. At any point in time, users can redeem these diamonds in exchange for their GEMCash Coin holdings

1. Storage service – Blocks, Transactions, and Assets storage
2. GEMCash CA – Certificate authority of the GEMCash blockchain
3. Kafka – Message broker and local consensus service
4. Lokka service – Transaction execution, block creating and global consensus service
5. Distributed cache – Configuration store of GEMCash blockchain.

Blocks, transactions, and assets on the GEMCash blockchain are kept in the storage service, CouchDB. GEMCash CA is the certificate authority in the GEMCash blockchain. The blockchain peers and clients’ public key certificates are issued by the GEMCash CA. CouchDB storage service has been used as the certificate storage in GEMCash CA. Etcd-based distributed key-value pair storage has been used as the configuration storage of the GEMCash blockchain. There are two types of blocks in the GEMCash blockchain, local blocks, and global blocks. Local blocks contain the transaction in the local shards. The global block will aggregate the transactions in local blocks into a single global block. Lokka service in the GEMCash blockchain handles these local and global block generation functions. Apache Kafka has been used for the local shard consensus in the GEMCash blockchain. Every blockchain node, in the local shard, runs its own Lokka service. There is a Kafka topic that the service listens to. Lokka services consume transactions from the Kafka message broker as a batch and execute them concurrently via Aplos smart contracts using Validate-Execute-Group blockchain architecture. Then it creates blocks with executed transactions and distributes them with other nodes in the local shard via the storage service. Finally, the generated block will be submitted for global consensus. Depending on the transaction load, the GEMCash blockchain can run multiple Lokka services, in a single blockchain node, with partitioned Kafka topics.

The Kafka cluster in the GEMCash blockchain is deployed amongst the shards. There is a global Kafka topic that consumers order the blocks generated from the local shards. Each local shard publishes the generated blocks to this Kafka topic. The blocks generated in the shards are ordered in this Kafka topic. Once the shards publish their local blocks, one Lokka node among the shards will take the ordered blocks in the Kafka topic and create a global block. Here, all the transactions in the blocks will be ordered into one block and then create a global block. The Lokka node, for each global block, will be selected via the Raft consensus-based leader election process. Once the global block is created, it needs to be approved
by other Lokka services amongst the shards. The global block approving process is done via a majority vote federated consensus implemented among the Lokka services running on the shards. There is an endorsement policy defined in the GEMCash blockchain. This policy defines how many Lokka nodes in different shards need to vote to approve a block. Once the block is approved by the Lokka services, it will
be broadcast and available to all other blockchain nodes in the different shards

Following are the main properties and features of the GEMCash blockchain.

● GEMCash blockchain is a lightweight, scalable blockchain system that supports running on embedded hardware devices. The vendors using the GEMX System run the blockchain nodes that are embedded in devices that are provided by the GEMNation Governance Body. To support the lightweight features, we have added several design changes to the GEMCash blockchain,
i)The storage of the blockchain designed with a lightweight CouchDB distributed database,
ii) The deployment of the GEMCash blockchain done with lightweight container orchestration system K3s,
iii) Use of sharding-based consensus which supports running isolated clusters in the
blockchain.

● GEMCash blockchain supports sharding-based consensus and storage in the blockchain network. Blockchain shards can be deployed in isolated network clusters. Each shard can perform consensus and transaction handling, independently. They can reach a global consensus based on connectivity. Shards use Apache Kafka for local consensus and Raft for global consensus.

● Local Consensus- The consensus in local shards happens via Apache Kafka. The transactions published by the clients are ordered in Kafka. Lokka service consumes ordered transactions from Kafka message broker as streams and executes them based on the “Validate-Execute-Group” architecture. In the local consensus phase, the local blocks will be generated by one of the Lokka nodes in the shard. Block generating Lokka nodes will be selected via the round-robin distributed scheduler. The block approval will be done via a federated consensus implemented among the
Lokka nodes in the shard.

● Global Consensus – Once shards generate local blocks, these blocks will be further validated and aggregated into a single global block. These functions are implemented in the inter-shard Global consensus phase. There is a separate Kafka topic to publish the local blocks in the shards. Each local shard publishes the generated blocks to this Kafka topic. Once all shards publish their local blocks, one Lokka node in a shard will take the ordered blocks in the Kafka topic and create a global block. The global block generating Lokka node will be selected via the Raft consensus-based leader election process.

● Concurrent Smart Contracts – GEMCash blockchain introduces a concurrent transaction enabled Aplos smart contract platform. This smart contract platform is built using functional programming. By supporting concurrent transaction execution with smart contracts, the GEMCash blockchain produces high transaction throughput and high scalability.

● Real Time Transactions – GEMCash blockchain introduces real-time transactions enabled “Validate-Execute-Group” blockchain architecture to address the issues of Order-Execute architecture in traditional blockchain platforms. The Order-Execute architecture based systems validate and execute transactions on each peer multiple times. But in Validate-Execute-Group based systems, transactions will be validated and executed only once in one peer when the client submits them to the blockchain. The client does not need to wait until creating a block to commit the transaction.