Cross Shard Communication
Cross Shard Communication
In 2022, MuKn received a grant from Harmony One to develop the Harmony ecosystem.
Harmony is a sharded blockchain with four shards running each running consensus separately.
Increasing usage and adoption of all of the shards was crucial to the Harmony ecosystem, which is the purpose of the technology MuKn developed: to enable smart contracts running on OpenHarmony to pass messages asynchronously, while protecting the network from spam and other attacks.
The design enables smart contract developers to send and receive messages across shards using Solidity (or the EVM targeting language of their choice) to call a new special “precompiled” contract, the “(message) router”. This explicit message passing design is safer than using cross-shard contract calls. To avoid spam attacks, sending messages must both pay for gas on the sending shard, and reserve tokens to pay for gas on the receiving shard. To prevent messages from being stuck with too little gas (possibly due to malicious attack), additional tokens can be contributed to this reserve until the message is received.
The final implementation was built by MuKn and overseen by the Harmony team: MuKn’s goal was to implement of a safe cross-shard communication design (which meant modifying Harmony’s core code to reflect the protocol and messaging changes).
This meant implementing the message router contract, and making corresponding changes to the SDK that allow clients to send messages across shards via the message router contract.
More info about this work: