The random number generator for the IBC world

Simon Warta
4 min readSep 12, 2022

--

Randomness is a basic building block for all sorts of applications. In the blockchain world, the use cases range from lotteries over games to governance applications.

Randomness generated in the off-chain world (Photo by Can Eğridere on Unsplash)

The access to a secure source of public randomness has been growing need. For example, games need randomness to distribute new items as NFTs in game or lottery platforms need true unbiased randomness to draw the winner. Unfortunately, current applications draw randomness from insecure sources such as block hash and timestamp and it is just a matter of time until this weakness will be abused.

Drand is a project that geneates unbiased and unpredictable random beacons through multi-party computation. Random beacons produced by drand can be submitted to blockchains which perform BLS signature verification to securely use randomness on chain. In 2020, I implemented a proof of concept in a CosmWasm contract that verified drand beacons onchain. This was later turned into the production ready service Terrand that powered various onchain applications like lotteries. BLS verification is a computationally heavy operation, but leveraging the strength of the Rust optimizer and WebAssembly’s near native execution speed, drand beacons could be verified for less than $3 in gas fees on Terra. This solution provided the first true unbiasable randomness source for the Terra blockchain

The next step in the evolution is to make drand beacons easily accessible by as many dapps as possible in a way that is easy to use and affordable. In an ideal world, a dapp developer would just do something like this:

The burden of implementing drand verification once per contract or even once per blockchain is probably too much in an ecosystem that is preparing for thousands of independent and interconnected blockchains. Instead, a specialized app-chain can handle the verification and distribute randomness across the IBC ecosystem.

The noise in the Cosmos

Nois was born to become the RNG of the IBC world — a basic infrastructure component that every dapp developer and web3 user can rely on. The project is initiated by experts in the field including the inventor of drand, a CosmWasm core maintainer, the founder of LoTerra and a co-founder of Terra Vegas.

Logo Nois Network

By combining the technology of drand, CosmWasm, Cosmos SDK, Tendermint and IBC the team developed a solution that is convenient to use and affordable without compromising security.

Architecture

You can think of Nois as a gateway between the drand network and the Interchain.

Both the drand network and the Nois chain are decentralized networks that are linked by a permissionless bot system. This ensures no single point of failure is created using this system.

Custom IBC protocol

The Nois appchain will be connected to the user’s chain using contract-2-contract IBC by CosmWasm. For this a custom IBC protocol is developed specifically for the needs of Nois. The user then interacts with a Nois proxy contract on their home chain (such as Juno, Stargaze, Terra, Tgrade, Secret, …). This way, users do not have to work on the IBC layer directly but use execute messages they are used to in CosmWasm.

Nois architecture overview (WIP)

Drand security

Drand relies on honest majority assumption, i.e. more than 50% of the drand operators must be honest, and so far this assumption has held in practice thanks to the variety in terms of nodes: different jurisdictions, platforms, OS, and deployments. Drand has stood up through time as it is being used by multiple projects, including Filecoin for more than 2 years without a single downtime. The drand protocol ensures none of the participants can in any way manipulate the generated randomness. Also no participant can predict anything about the random beacon before it is revealed everyone. This has been confirmed in a security audit.

Project status

Nois is in active development since July this year. The majority of the design and contract work has been done in August. An internal testnet is running that delivers random beacons to the Juno testnet as well as the Stargaze testnet. Nois will be present at the HackWasm Medellin and the Hacker’s Lounge of Cosmoverse.

If you want to learn more about the look and feel of Nois usage today, check out the double dice example contract as well as the nois library. For further updates, find us on Twitter: @NoisRNG.

--

--

Simon Warta

Building CosmWasm and CosmJS at Confio | Ex IOV | Co-Founder of Kullo | Board member prolina Foundation