Kryptografen wants to learn more about the different aspects of crypto and blockchain. A very important aspect of a decentralized blockchain is an oracle. That is why we sat down with product lead in Nahmii, John Derbyshire, to learn more about oracles and how they are implementing this technology in their scaling solution.
Key feature of decentralization
To start, let’s learn about the basics. What is an Oracle and why do you need it on a decentralized blockchain?
“Oracle is simply a method of entering data onto a blockchain trustfully. Instead of relying on a trusted third party to tell us who won the football match or what the weather was like on a given day, an Oracle can answer these questions using a decentralized consensus. This avoids relying on a trusted intermediary, preserving one of blockchain’s key features: trustlessness.” Derbyshire explains.
Oracles have a particularly important role to play in smart contracts. A smart contract is simply some code which is run on a blockchain. Oracles allow smart contracts to access reliable information from outside the blockchain network, making smart contracts far more useful.
Oracles can fulfill a number of different roles, with both software and hardware-based variants. Similarly, Oracles can provide inbound and outbound data.
“The Nahmii Oracle product is designed to answer true/false questions using a staking consensus. This means that participants in the Oracle staking game are individuals or bots.”
Token staking into the Oracle generates data, which they use to inform rules. These rules determine when the Oracle ‘resolves’, i.e. when the current round of token staking ends and a result is generated. Other Oracles draw on different data sources, such as websites or IoT sensors.
How does Nahmii’s Oracle work?
“The Oracle uses token ‘staking’ to determine whether a statement is true or false. To participate in the Oracle, users must risk their tokens by staking them against options they believe to be correct. The Oracle then uses the data generated by this token staking process to decide when to close the current staking round and return an answer of true or false.” He states.
The staking process is handled entirely on-chain using smart contracts, which calculate how much each participant should be paid out at the end of a staking round. If a user stakes their tokens on true for a given round and the final outcome is false, that user will lose their tokens. If a user stakes their tokens correctly, they will receive a proportional share of the tokens staked incorrectly along with a share of the bounty fund.
This is best illustrated by an example. If we ask the Oracle to test the statement ‘1/1/2020 is a Monday’, there are two options for people to stake their tokens against: true or false. As people stake their tokens into the smart contract, this generates staking data known as metrics. We can use this data to determine when to end the staking round and generate a result. For example, we can close the staking market when staking on either option reaches 10 tokens.
This is a simple example of how Hubii’s Oracle product can work, but for Nahmii the Oracle will monitor individual settlement requests for the protocol. When a user deposits into Nahmii, their tokens are transferred into a shared contract which holds all deposited funds.
When a user wants to withdraw from Nahmii, they need to prove that they are entitled to take those funds from the shared contract. This requires a receipt, which has been signed by the user and the operator of the system.
“For Nahmii, we need to make sure that all the relevant data is available to check that a withdrawal is legitimate. That is the role of the Oracle; to check individual settlement requests and ensure that no data is missing. This is our proposed solution to the Data Availability Problem.”
12 months of rigorous testing
“Before the Oracle is connected to Nahmii, it must first go through a process of rigorous testing. Eventually, the Nahmii Oracle will monitor all user settlement and withdrawal requests. If data is missing, the Oracle will prevent settlement for that user. If data is missing across multiple settlement requests, the Oracle will be able to pause the entire protocol. To test the Oracle, we have decided to run a series of experiments over a 12 month period. Each experiment will use a different ‘resolution engine’, which is simply our technical name for the rules which decide when to close a staking round. For example, our first experiment used a very simple resolution engine where the market would close when staking on either true or false reached a certain number of tokens. This is clearly very easy to exploit, as anyone with sufficient tokens could simply decide the outcome on their own.”
Their second experiment used a more complicated resolution engine, which required three conditions to be met before it would ‘resolve’. This has proven more difficult to exploit, as we expected, with 35 completed staking phases versus the 120 rounds for the first experiment. Derbyshire explains.
As the year progresses, they will test different combinations of rules to determine the optimal configuration for the Nahmii Oracle. In the meantime, Nahmii will be monitored by the Nahmii Foundation while we continue to test the Oracle.
“Please note that we may not require the full 12 months to test the Oracle; once our assumptions have been confirmed by empirical data, we may launch the Nahmii version at any time,” Derbyshire adds.
Incentives for users to test oracle
“The Oracle game will have a total bounty fund of 100 million NII tokens over a period of 12 months. This equates to 1 million USD at the recent NII token IEO price. As an illustration, we have posted bounties of 5,000 and 10,000 USD respectively for the first two resolution engines. This represents only 1.5% of the total that will eventually be distributed during the game.”
In addition, participants in the Oracle game have the opportunity to receive significant additional rewards due to the adversarial nature of token staking. If a user stakes their tokens on true and the Oracle resolves as true, they will win a share of all tokens staked on false. As the bounty amounts for the Oracle game increase over time, we expect that the number of tokens available for ‘stealing’ in this way will rise considerably.
The roll-out
“The Nahmii protocol does not require the Oracle to function; nor is the Oracle an essential part of Nahmii’s path to trustlessness. While we continue to test the Oracle, Nahmii will be monitored both by Hubii (the operator of the protocol) and the Nahmii Foundation. We believe the Oracle is the best way for us to solve the Data Availability Problem in the most efficient manner, however, there are countless (perhaps simpler) ways this could be solved eg. Delegated Proof of Stake.”
Users of Nahmii should not notice a difference when the protocol switches to being monitored by the Oracle.