Iris: A next-gen Decentralized Storage Layer (Part 3)

Tony Riemer
iridium
Published in
3 min readApr 5, 2022

Enabling dapps on top of the iris decentralized storage layer

Read Part 1 here

Read Part 2 here

Iris is a substrate-based proof of authority blockchain with an embedded IPFS network. This creates a dual network topology that allows the network to track calls to the DHT on-chain while storage of data remains off-chain. In general, validator nodes are responsible for acting as an intermediary between a data-owner or data-consumer and the IPFS network, enabling the application of DeFi concepts to data and facilitating a monetization layer on top of IPFS, such as payments for storage and commodification of data stored in the network.

The first part of this series details data-asset creation, management, and retrieval. The second part expands on the storage capabilities of the network to incentivize validator nodes to provide storage, enabling a decentralized pinning service on top of an embedded IPFS network. The third installment of the iris project delivers capabilities to build smart contracts that take advantage of decentralized storage.

Smart Contracts on the Iris Blockchain

The Chain Extension

A chain extension extends the set of functions that are available to call from a smart contract. In particular, the initial release of the iris chain extension exposes function that let contract developers mint and transfer data-assets and to lock, unlock, and transfer native tokens. The functions in the chain extension can be used by any contract deployed on iris. See the official docs for more a guide on using it in your contract:

https://iridium-labs.github.io/contracts_chain_extension.html

The Iris Asset Exchange

The iris asset exchange, the first contract developed on Iris, is a decentralized exchange that allows data-owners to sell access to data (as assets minted from their asset class — see part 1 for more info on this) to data-consumers.

The asset exchange contains two storage maps, we track two important pieces of data for each asset id registered in the contract: ownership and pricing. The initial iteration of the exchange allows data-owners to set a static price for their assets and mint some quantity of them which are assigned to the contract account, which consumers can then purchase. Specifically, there are two functions:

publish token sale

Mint new tokens and gives ownership of them to the contract account. The owner specifies a static price that consumers pay in order to purchase the asset.

purchase tokens

The purchase tokens function uses the lock and unlock functions from the chain extension to ensure that funds are available before transferring an asset as well as laying the groundwork for future dispute handling mechanisms. The general flow is as follows:

  1. lock price*amount tokens, where the price is as specified by a data owner when the token sale was published
  2. transfer the specified quantity of assets to the caller (from the contract account) when the native tokens are locked
  3. unlock tokens and transfer them to the publisher of the token sale

Demo

iris milestone 3 demo

More Information

Official Documentation: https://iridium-labs.github.io

Repositories

The Iris Blockchain: https://github.com/iridium-labs/substrate/tree/iris

Smart contracts on Iris: https://github.com/iridium-labs/contracts

Iris user interface: https://github.com/iridium-labs/ui

Docker Images

Latest docker image for the iris node:

https://hub.docker.com/repository/docker/iridiumlabs/iris

Latest docker image for the user interface

https://hub.docker.com/repository/docker/iridiumlabs/iris-ui

--

--