Multi-asset Module Available on IRIS Hub V0.15 with DeFi Application Dev Support Coming
IRISnet mainnet IRIS Hub has completed its upgrade on August 29, 2019. It is the first time for an incompatible version in BPoS network to complete a smooth upgrade without hard fork and data purge.
More importantly, many exciting new features that support DeFi applications have been introduced since the upgrade, including:
- Multi-asset Management
- Random Number Generator
- Multi-Sig Accounts and Multi-Sig Transactions
- Use Keystore Files to Backup Keys
- Tendermint Module Upgrade
- Other Optimizations and Bug Revisions
Process Review：Smooth Upgrade without Hard Fork
IRIS Hub had been running steadily for 5 months since it was launched. During this period, it had undergone 2 times of Class-I upgrade (compatible upgrade). The upgrade this time is the first time of Class-II upgrade, which means the new version v0.15.0 cannot co-exist with the old version.
Before the official upgrade, IRISnet submitted the proposal at UTC 13:00 on Aug 22. The validators were invited to vote for the proposal through on-chain governance. The voting period was 5 days. As of UTC 13:15 Aug 27, the proposal was passed with 90.99% participation exceeding the 87.5% quorum. And all the votes were YES.
The detailed info of the proposal: https://www.irisplorer.io/#/ProposalsDetail/2
In the next two days, the mainnet IRIS Hub began to upgrade, and completed the smooth upgrade at 2.29 million blockheight on August 29.
In this upgrade, we have introduced new function modules, so it is incompatible with the previous one. However this time, without a hard fork or historical data purge, IRISnet has smoothly completed the whole process from submitting a proposal through on-chain governance, voting to online upgrading. This is the first time in the history of BPoS network!
Many exciting new functions have been introduced after this upgrade. Here we focus on the introduction of three core functions, namely multi-asset management, random number generator, multi-sig account and transaction.
The multi-asset management module allows assets to be issued, managed and used on IRIS Hub.
Assets are divided into three types on IRIS Hub: Native Asset, Gateway Asset and External Asset. The currently operable assets are native assets and gateway assets after the launch of v0.15 multi-asset module. Later IBC protocol will support the operation of external assets.
Native Asset are the assets issued by users. Individuals and companies can create and issue their own assets on IRIS Hub for any use cases, such as asset tokenization, stablecoins, collateralized debt, etc.
Unlike native assets, gateway assets are assets that rely on gateways to transfer value into and out of IRISnet. Gateway mode is an alternative to InterBlockchain Communication (IBC) protocol before it is ready, which may continue to exist after IBC is enabled.
Gateway can be trusted, basically equivalent to the standard exchange mode. Users exchange cryptocurrencies relying on the exchange’s redemption ability. Gateways usually issue internal assets with prefixes, such as GDEX, OPEN, etc., and these assets are managed and operated by gateways. These assets are the mapping of real BTC, ETH or any other digital assets that people store on the gateway, and the gateway is responsible for the mapping relationship between the assets.
In addition to gateway assets, after the IBC protocol is enabled, we can also create external assets on the IRIS Hub that are native tokens on other blockchains to allow interoperability of those assets in a cross-chain manner. The only way to create external assets is to submit a TokenAdditionProposal through IRIS Hub Governance, but for user convenience, BTC and ETH are pre-set in the system.
Based on the multi-asset module, many DeFi applications can be supported. For example, the combination of multi-asset and interblockchain technology can power DEX. e.g Gateway like GDEX can introduce stablecoins like bitCNY from Bitshares into IRIS Hub through GDEX gateway. Assets in different blockchains can be linked through gateway. After the realization of the IBC, these assets will enter into the entire Cosmos ecosystem via IRIS Hub.
After the IBC is enabled, IRIS Hub can provide a distributed asset custody service for DEX application-specific blockchains. The assets liquidation between DEX will be simpler and quicker, and more and broader multi-asset transactions will be supported, including native and derivative assets of various mainstream public blockchains. All of these are supported by multi-asset modules as the basic infrastructure.
Random Number Generator
Many DApps, including DeFi, need random numbers.
Random number can be divided into two kinds according to the way of generation: true random number and pseudo-random number.
- True random numbers are usually generated by physical processes.
- A pseudo-random number is a number generated by a specific algorithm from “seed” and approximate to a random distribution. For example, in traditional computing, timestamp is usually used to generate a pseudo-random number with the required distribution.
On blockchains in distributed environments, many DApps only choose blockhash data as a seed to generate pseudo-random numbers to ensure the consistency of random results among nodes and the openness and simplicity of the random number verification process. But this way can be easily manipulated and attacked by miners or hackers.
IRIS Hub v0.15 Random Number Generator calculates random numbers by using multiple parameters generated by blockchains as “seed” to increase randomness. At the same time, it makes the random numbers transparent and easy to verify. Although it is still pseudo-random number, manupulation to it will be difficult and also attributable.
The random number “seed” contains the following parameters:
- Hash of the previous block: The generation of blockhash depends on many factors of the block, such as blockheight, number of transactions, timestamp and so on, so blockhash itself has certain unpredictability.
- Current block timestamp: Block timestamp uses BFT time, that is, according to the weight of the validator, using each Precommit time in the previous block. The weighted distributed timestamp (millisecond level) also has a certain degree of unpredictability [BFT Time].
- Account Address Requesting Random Numbers: Its main purpose is to have different people at the same blockheight get different random numbers.
The formula is:
seed = sha256(timestamp + int(sha256(blockhash)) / timestamp + int(sha256(consumer)) / timestamp)
rand = seed mod 10^20 / 10^20
Since blockhash and BFT time are calculated based on the information of the previous block, in order to avoid pre-calculation before requesting random numbers, we enhance the unpredictability of random numbers through “future blocks”.
However, unpredictability does not mean that it cannot be manipulated. This module is in its Beta stage. Please assess the risk before using it. In the next version, we plan to use oracle to introduce external sources of trusted random numbers and generate true random numbers.
Multi-Sig Accounts and Transactions
Multi-sig account is an account managed and controlled by multiple keys. It is the critical technology to realize the scenarios such as large amount of assets storage and transaction co-processing.
The process of a multi-sig account involves on IRIS Hub includes transaction generation and initiation.
- The minimum number of signatures is required to set when creating a multi-sig account.
- The threshold of the minimum number of signatures must be exceeded at the time of initiating a transaction, in order to build the signed transaction data and it is broadcast through the network.
Multi-sig accounts and transaction functions can support DeFi applications well. For example, in collateralized debt platforms, users collateralize their assets in a multi-sig account sharing with the platform and coordinate the management of this account. When redemption or default occurs, more than the minimum number of signatures is needed to make transactions, which avoids the risk of centralization of single-signature accounts.
IRIS Hub is built with Cosmos SDK. As we can see, Cosmos SDK can be added and modified in a highly modular way. The IRISnet smooth upgrade not only demonstrates the advanced governance module of IRISnet, but also provides better support for DeFi applications including DEX and Staking.
For more info: On-chain Governance of IRIS Hub: The Start of Self-evolution
Join our Telegram channel: https://t.me/irisnetwork