Table of Contents
Fetching ...

Adding All Flavors: A Hybrid Random Number Generator for dApps and Web3

Ranjith Chodavarapu, Rabimba Karanjai, Xinxin Fan, Weidong Shi, Lei Xu

TL;DR

This work introduces HRNG, a hybrid random-number generator for dApps that fuses TRNG sources from TEEs on IoT devices with cryptographic aggregation to yield unbiased, unpredictable numbers verifiable on-chain. By employing a network of TEEs, gateways, and a $(k,t)$-threshold secret-sharing framework, HRNG tolerates compromised components while keeping on-chain computations to a minimum. A concrete optimization uses the additive homomorphism of Pedersen commitments to perform on-chain aggregation with substantially reduced gas, while preserving verifiability. The approach enables scalable, secure randomness within DePIN-enabled Web3 contexts, with empirical analysis showing meaningful improvements in computation and gas costs over non-optimized designs.

Abstract

Random numbers play a vital role in many decentralized applications (dApps), such as gaming and decentralized finance (DeFi) applications. Existing random number provision mechanisms can be roughly divided into two categories, on-chain, and off-chain. On-chain approaches usually rely on the blockchain as the major input and all computations are done by blockchain nodes. The major risk for this type of method is that the input itself is susceptible to the adversary's influence. Off-chain approaches, as the name suggested, complete the generation without the involvement of blockchain nodes and share the result directly with a dApp. These mechanisms usually have a strong security assumption and high complexity. To mitigate these limitations and provide a framework that allows a dApp to balance different factors involved in random number generation, we propose a hybrid random number generation solution that leverages IoT devices equipped with trusted execution environment (TEE) as the randomness sources, and then utilizes a set of cryptographic tools to aggregate the multiple sources and obtain the final random number that can be consumed by the dApp. The new approach only needs one honest random source to guarantee the unbiasedness of the final random number and a user can configure the system to tolerate malicious participants who can refuse to respond to avoid unfavored results. We also provide a concrete construction that can further reduce the on-chain computation complexity to lower the cost of the solution in practice. We evaluate the computation and gas costs to demonstrate the effectiveness of the improvement.

Adding All Flavors: A Hybrid Random Number Generator for dApps and Web3

TL;DR

This work introduces HRNG, a hybrid random-number generator for dApps that fuses TRNG sources from TEEs on IoT devices with cryptographic aggregation to yield unbiased, unpredictable numbers verifiable on-chain. By employing a network of TEEs, gateways, and a -threshold secret-sharing framework, HRNG tolerates compromised components while keeping on-chain computations to a minimum. A concrete optimization uses the additive homomorphism of Pedersen commitments to perform on-chain aggregation with substantially reduced gas, while preserving verifiability. The approach enables scalable, secure randomness within DePIN-enabled Web3 contexts, with empirical analysis showing meaningful improvements in computation and gas costs over non-optimized designs.

Abstract

Random numbers play a vital role in many decentralized applications (dApps), such as gaming and decentralized finance (DeFi) applications. Existing random number provision mechanisms can be roughly divided into two categories, on-chain, and off-chain. On-chain approaches usually rely on the blockchain as the major input and all computations are done by blockchain nodes. The major risk for this type of method is that the input itself is susceptible to the adversary's influence. Off-chain approaches, as the name suggested, complete the generation without the involvement of blockchain nodes and share the result directly with a dApp. These mechanisms usually have a strong security assumption and high complexity. To mitigate these limitations and provide a framework that allows a dApp to balance different factors involved in random number generation, we propose a hybrid random number generation solution that leverages IoT devices equipped with trusted execution environment (TEE) as the randomness sources, and then utilizes a set of cryptographic tools to aggregate the multiple sources and obtain the final random number that can be consumed by the dApp. The new approach only needs one honest random source to guarantee the unbiasedness of the final random number and a user can configure the system to tolerate malicious participants who can refuse to respond to avoid unfavored results. We also provide a concrete construction that can further reduce the on-chain computation complexity to lower the cost of the solution in practice. We evaluate the computation and gas costs to demonstrate the effectiveness of the improvement.
Paper Structure (14 sections, 4 equations, 2 figures, 4 tables)

This paper contains 14 sections, 4 equations, 2 figures, 4 tables.

Figures (2)

  • Figure 1: Overview of HRNG. Each gateway connects with multiple IoT devices equipped with TEE to provide random sources to the system, and the final random number is generated in a verifiable manner on the blockchain. Although the dApp is demonstrated as a different entity, it is actually deployed on the same blockchain and maintained by the same set of blockchain nodes.
  • Figure 2: The gas costs for non-optimized and improved HRNG. Here both versions use the elliptic curve-based Pedersen commitment scheme but the unoptimized HRNG does not utilize the homomorphic feature. The $x$-axis is the number of values to be aggregated and the $y$-axis is the amount of gas required to finish the work (commitment openings and aggregation).