Research and implementation for Tendermint and Corestar
The popularity of using blockchain networks as the infrastructure for online and gambling games through Dapps and other services are growing substantially.
Businesswire reports in a recent statistical research material that the global online gambling market is expected to grow from $58.9 billion in 2019 and to $66.7 billion in 2020 at a growth rate of 13.2%. The growth is mainly being attributed to COVID-19, due to which populations are confined to their homes during the lockdown and have free time to participate in a large variety of free and paid leisure activities including online gambling. The market is thus expected to reach $92.9 billion in 2023 at a CAGR of 11.64%.
The global online gambling market size is expected to reach USD 127.3 billion by 2027, registering a CAGR of 11.5% from 2020 to 2027. The market is also expected to gain traction over the forecast period. The growing popularity of betting across the globe and the application of the freemium model in online gambling are among the potential opportunities likely to unfold in the next few years.
The numerous monetization opportunities arising against the background of such heightened interest from the global population towards online gambling are encouraging projects around the world to develop services and applications to cater to the demand. However, the stiff competition is also forcing platforms to continuously develop and perfect the underlying technology necessary for attracting and retaining customers by offering them better quality of services, higher reliability, greater scalability, increased transaction throughputs, and advanced technical tools for improved randomness in the generation of numbers needed for keeping gambling applications running on the basis of customer trust.
Need For a Solution
Both gambling and gaming require fast and verifiable random values. In a distributed network, there is always the risk of having malicious users seeking to beat the system for gaining unfair advantages. As such, the protocol for creating a random value must be resistant to attempts of creating random values needed by the unscrupulous players, and to attempts at hiding a new random value that is not suitable for some other player.
This task leads to the need for a new tool that would be resistant to such attacks and the need for appropriate research on the underlying cryptography that would make the development of such an instrument possible.
In essence, the solution to the problem in both the gaming and gambling industries was the RNG, or Random Number Generator, and the PRNG, or the Pseudorandom Number Generator. However, both technologies were not devoid of shortcomings that made their use problematic in some areas.
Traditionally, random number generation occurs centrally on the basis of local software systems or under the control of a group of individuals or organizations. The existing solutions on the market of RNGs are classified into several groups:
Pseudorandom number generators use deterministic mathematical algorithms. The given RNGs are based on algorithms implemented on a state machine to obtain pseudorandom sequences from the initial numbers in mathematical processes.
True random number generators, or TRNGs, generate result depending on non-deterministic physical phenomena like thermal interference, radio interference. It is well-known that these phenomena behave unpredictably and act as the basis for the randomness logic.
But many projects do not merely need to generate a random number in an unpredictable manner, as it is important to ensure the publicity of this information, while protecting the platform from fraud, data leakage, and various types of external manipulations. Traditional RNGs cannot solve such problems without the use of a blockchain network.
As of the advent of blockchain technologies, a number of approaches were developed for RNGs to ensure their reliability and combine the factors needed to make their application viable in a gaming environment.
Block-Hash
The Block-hash approach uses a hash of blocks or transactions as a source of randomness. Since the hash is deterministic, each block achieves the same result. At the same time, the block that was once added to the blockchain will remain there indefinitely and the correctness of the generated numbers will be publicly available. Unfortunately, such an RNG principle can be manipulated by blockchain miners or administrators. The higher the transaction amount, the greater the risk of manipulation of the hash in order to generate the desired numbers.
Bitcoin Beacon
The Bitcoin beacon approach relies on a natural chain of Bitcoins for the RNG. Timestamps and transactions in Bitcoins act as a source of consistently high entropy, or the randomness of the generated numbers. The higher the randomness, the more difficult it is to predict the result number. However, the issues of increased centralization of Bitcoin mining have placed the given approach at risk.
Oraclize
Oraclize is a data provider for smart contracts and blockchain applications. Oraclize acts as an intermediary that collects data from external sources like WolframAlpha or IPFS, and uploads it into the blockchain. Oraclize simply transfers data from random.org to the blockchain for the generation of random numbers. Potential centralization and the use of trusted parties makes this RNG unsuitable.
RanDAO
RanDAO was an attempt at solving the problem of fairness and reducing the importance of the role of the miners. However, it did not solve the problem of the reliability of obtaining a random number. The work of the service is based on the fact that there is at least one honest party, which guarantees the inviolability of the final result. The concept proved extremely susceptible to human factors, as the last party to reveal the secret number will have full control of the resulting transaction.
At the moment there are no fully viable or reliable solutions for the generation of random numbers, only compromise and intermediary solutions capable of filling the gap.
Corestar Solutions
One of the projects aiming to establish its presence on the growing online gaming and gambling market is Corestar. The project is engaged in building decentralized applications on the Cosmos ecosystem. The development team consists of experienced researchers and developers who have released the OpenMarket flagship product, a marketplace of NFTs over Inter Blockchain Communication protocol. The team was also responsible for the development of the DGaming project.
Among the development team’s achievements are the prize for the Cosmos HackAtom in Berlin with a marketplace MVP, as well as an ICF grant for Arcade – a blockchain framework with a built-in random beacon.
The Corestar project is currently engaged in the development of solutions for the blockchain gambling market in blockchain. The tools being developed include a blockchain framework with a built-in random beacon, a media outlet, a specialized gaming store, a cross-chain NFT market, and a dedicated wallet.
Corestar was approached with the task of developing a better solution for RNG in the gaming and gambling market. Among required cryptographic properties from the generated protocol were:
Availability (or liveness) – any single participant or colluding participants should not be able to prevent a random number generation process;
Unpredictability – any single participant or colluding participants should not be able to obtain any information about future random beacon values;
Unbiasability (or bias-resistance) – any single participant or colluding participants should not be able to influence future random beacon values to their advantage;
Public-Verifiability – third-parties should be able to verify the correctness of generated values using public information only;
Completeness. The Prover can convince the Verifier of a true statement using a witness;
Soundness The Prover cannot convince the Verifier of a false statement;
Zero-knowledge. If a statement is true then the proof does not reveal any useful information about the witness.
Among the testing requirements was that the code is fully covered by both unit and e2e tests. It was thus necessary to develop a separate framework for testing. There were also code requirements, including implementation on Golang written for onchain and offchain versions, and the availability of being portable to different blockchains and frameworks, along with integration with the Cosmos SDK. The timeframe for the development was set at six months.
Underlying Basis
The Cosmos SDK is the next generation of blockchain systems for building multiple related blockchains. Cosmos is an ecosystem that can scale and interoperate, and solved the interoperability issues with a new technical vision based on a set of open-source tools like Tendermint. Cosmos belongs to the same generation as Parity Substrate, Algorand, and Avalanche.
Tendermint is a Byzantine-fault consensus algorithm. The algorithm was invented in 2014 by Jae Kwon, who was concerned about the high power consumption of the Bitcoin’s network. Unlike the Nakamoto consensus, where the chain with the most work is selected, Tendermint selects the chain where 2⁄3 of the network members voted for the block or value.
Homomorphic Encryption Random Beacon
The result of the work done by the Corestar team was the Homomorphic Encryption Random Beacon as a solution to the issues of reliable RNG.
HERB is a publicly verifiable randomness beacon based on the additively homomorphic property of some encryption schemes. The randomness beacon is a cryptographic primitive that regularly outputs an unbiasable, unpredictable random number that is available and verifiable by any party. The numbers may be used for blockchain sharding, gambling, advanced cryptographic schemes, and any other medium one would want a publicly verifiable random number for.
There are multiple cryptographic schemes to make a decentralized random beacon. Unlike the most well-known Dfinity’s deterministic approach, each new HERB’s output is generated as a new random value derived from the participants’ randomness sources allowing for physical sources of entropy. This property allows using HERB for seeding and reseeding such schemes as Dfinity’s BLS-based beacon. Another strong point is that HERB requires less cryptographic assumptions, such as the bilinear pairings.
The main advantages of the HERB include the fact that parties to a transaction cannot bias the output values. HERB does not require bilinear pairings and requires only EC-DDH-assumption for the default settings. The protocol can be modified for usage in the post-quantum model, where lottery participants can send random shares and a group of semi-trusted lottery initiators can decrypt the result. Finally, given that each participant encrypts their own random value, they can be sure of the quality of the randomness source.
The work performed by the Corestar team included the creation of onchain and offchain solutions, as well as a framework for simulating a network with any number of participants and any topology. Test scripts were written and the algorithm was debugged based on the topology with the application of Tendermint source of randomness. The result was the creation of an MVP gaming platform with distributed key generation and source of randomness though a blockchain focused on low latency for gaming solutions.
The resulting onchain and offchain distributed key generation implementations allowed for obtaining a verifiable random number in every block.
The code of the HERB was released as a separate library and is available at https://github.com/corestario/dkglib
The sample random application was also released at#nbsp;Randapp
Conclusion
The availability of reliable RNGs is critical for the successful and ongoing development and growth of the gambling and online gaming industry based on the blockchain. The currently available solutions are interim and need to be either perfected or substituted with new technologies capable of offering both reliability and high levels of trust to both the developers and the gamers.