RNB Blockchain whitepaper
9th May 2021
OVERVIEW
Generating secure random numbers is a challenging task. By fast numbers, I mean that a) predicting what the next number is impossible, and b) It generates numbers without putting them in favor of one of the stakeholders.
The nature of public blockchain, with its decentralized p2p architecture, is ideal for producing secure numbers.
This whitepaper discusses the implementation of secure random numbers using blockchain.
GOALS OF THE PROJECT
- Free public random number generator
- Secure, where numbers are not predictable.
- Generated numbers are stored in the database permanently for checking in the future
- Generated numbers are not programmed to drop specific numbers with high probability.
RNG V 0.0 User-generated numbers
Since the creation of the blockchain takes some time, we decided to make a quick version of the RNG. This short version of the RNG blockchain is versioned as 0.0.
In this version, the nodes accessing the RNG send a random number in their transactions. The sum of all random numbers divided by all senders within the block is defined as a new Random number for the block.
The RNG V 0.0 will have the following transitions:
- Request a new Random number (DONE)
- accepts (one random number) in byte32 format. This number is used to generate a random number. To get a random number, the caller should stake some tokens.
- returns another random number in byte32 format. It requires 0.01 RNG tokens to be cut from the staked RNG tokens. - Send a random number
- accepts (one random number) in byte32 format. This transaction could be sent by participating validators only. - Stake a token
- Stake 100 RNG tokens. It will register a user to generate a random number. A new stake will be added to the previous ones if a user has already staked tokens. - Get a staked token amount
- accepts a wallet address
- returns an amount of staked tokens for the user. - Change fee
- accepts a new fee for requesting a Random Number and deadline (up to 24 hours in seconds and a minimum of 1 hour).
- whether this was accepted.
If ⅔ of the users call this transaction with the same fee, the fee for requesting payment will be updated.
RNG V 1.0 THEORETICAL SPECIFICATIONS
How does the RNG blockchain work without going to the programming language and technology used in it?
The idea is that the RNG blockchain generates random numbers in every block of the blockchain.
All validators of the RNG blockchain must provide a unique wallet address for every block for consensus voting. The sum of all unique wallet addresses divided by the number of voters is the Generated Random number of that block.
We came up with three solutions to prove that the signature is nondeterministic.
- Any node that participates in the generation of random numbers also has a representative signature. This signature stakes 100 RNG tokens, which allows this node to participate in number generation. Any unique signature used once can be used to withdraw 50% of the staked RNG tokens per user from the blockchain within the next 30 days after usage of the signature. Suppose the unique signature is used for withdrawing a token. In that case, the representative node is kicked out from the participation of random number generation, while the rest of 50% of staked RNG tokens are redistributed among other stakeholders.
So, it is in the interest of all stakeholders to try to find the signature or guess it for the other stakeholders to prevent them from cheating. - The node client should always be public, meaning everyone could join the blockchain for random number generation without anyone’s permission. Since the sum of the hash of all wallets is changing dramatically even after the addition of one more signature, it will allow the blockchain to be unpredictable if many nodes connect to the blockchain from around the world.
- There is the option where anyone, whether a unique signature or representative signature or not related to the RNG signature, can put 1 RNG token, the future block number, and the possible value. If the value generated in the future in the block number is correct, the wallet address could take 50% of all stake RNGs in the blockchain. This will keep all stakes trying to put unpredictable signatures, while those who want to earn money will always try to check the blockchain for prediction. This will ensure that generated random numbers are safe.
RNG Blockchain Technical Requirements
It is a blockchain in Cosmos Network created with Cosmos SDK on the tendermint core. RNG blockchain has the following features:
- A lightweight client
- States in key-value format:
2.1. A list of all unique addresses of every representative address.
Representative Account => array of unique addresses
Unique address => representative
2.2 List all random numbers since block one, including unique addresses and their numbers.
Block number => struct(random_address, array(unique addresses), unique_address_amount, proposer)
2.3 A list of representative addresses with their staked RNG tokens amount.
Representative stake => stake amount
2.4 A balance of each address of RNG tokens that are not used for staking:
Wallet address => balance
2.5 A prediction list for each block
Block number => array of Structs(predicted_address, payment_address)
Prediction reserves => balance. - Functions such as
3.1 Stake RNG tokens to add a representative token to the data structure 2.3
3.2 A function to push unique address for generating random numbers,
3.3 Generating random number by the sum of all unique addresses pushed to the server,
3.4 Unstaking tokens with the representative address
3.5 Unstaking tokens with a unique address, which automatically distributes 50% of staked tokens to other token holders, while 50% goes to the individual address
3.6 claim additional tokens for stakes that they got from other stake token distribution,
3.7 Spend 1 RNG with the random number and the block to predict the upcoming number to withdraw 50% of all staked tokens. - An easy RPC to fetch the random number by event broadcast or rest API.
- A bridge to the Ethereum blockchain where RNG tokens are minted. Bridge to transfer into or out from rng blockchain rng tokens.
- an intelligent contract on the Ethereum blockchain locks RNGs transferred to the RNG blockchain.
RNG blockchain Technical implementation
We edit the voter module by adding additional features, such as auto-generating the private keys that voters submit to the block (automatically by the module). The voter module will store the private keys in the local storage, encrypted by the voter’s primary signature.
We will also create a new rng-history module to store all the rng states. This module is connected to the voter module to get the voter’s signatures.
Finally, we edit the consensus module to connect to the rng-history module to write data into rng states.
RNG token
RNG tokens are erc20 tokens on the Ethereum blockchain. USDT tokens back them.
1 usdt = 10 rng token.
If a user wants to mint 100 RNG tokens, he has to call the mint function of the RNG token. The mint function will lock ten USD on behalf of the user to issue RNG tokens.
If a user wants to take back his USDT tokens used to mint RNG tokens, then the user calls the burn method in the RNG token, which will burn RNGs while transferring the locked USDTs to the user.
MILESTONES
Write the whitepaper
Till 16th May, write all technical aspects of the RNG blockchain and RNG token.
Write the Demo blockchain (without bridge)
Till the end of May 2021, write the RNG blockchain using Cosmos SDK.
Write the RNG token
Till 10th June 2021, write the RNG token with mint and burn functions.
Write the Bridge blockchain.
Till 20th June 2021, write the RNG bridge between the RNG blockchain and the Ethereum blockchain.
Launch of the product
Till 30th June 2021, test the system and launch it.
Write the Whitepaper 2.0 for the profitable version of the RNG blockchain
How do RNG blockchain nodes earn money? In the next version of the blockchain, this should be possible.