Commit-Reveal²: Randomized Reveal Order Mitigates Last-Revealer Attacks in Commit-Reveal
Suhyeon Lee, Euisin Gee · 2025
Read Commit-Reveal²: Randomized Reveal Order Mitigates Last-Revealer Attacks in Commit-Reveal by Suhyeon Lee, Euisin Gee (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2504-03936.txt.
Introduction
Suhyeon Lee and co-authors secure a randomness beacon design in 2025 for smart contracts. In commit-reveal schemes, players lock in hidden values and then reveal them in turn. The last player to reveal can bias the result, a known weak point.
Their design, Commit-Reveal squared, shuffles the final reveal order by cryptographic means. Routine steps run off chain for speed, while the chain holds the pledges and settles disputes. Rules cover a leader role, on-chain checks, penalties for refusal to play, and a recovery path if off-chain steps fail. The authors define two safety goals and prove both hold under standard hash assumptions. In tests the hybrid design cut on-chain gas cost by more than eighty percent.
Catalog record
| CREATOR | Suhyeon Lee, Euisin Gee |
|---|---|
| YEAR | 2025 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 22 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2504-03936
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
Commit-Reveal²: Randomized Reveal Order Mitigates Last-Revealer Attacks in Commit-Reveal Suhyeon Lee, Euisin Gee Abstract Randomness generation is a fundamental component in blockchain systems, essential for tasks such as validator selection, zero-knowledge proofs, and decentralized finance operations. Traditional Commit-Reveal mechanisms provide simplicity and security but are susceptible to last revealer attacks, where an adversary can manipulate the random outcome by withholding their reveal. To address this vulnerability, we propose the Commit-Reveal² protocol, which employs a two-layer Commit-Reveal process to randomize the reveal order and mitigate the risk of such attacks. Additionally, we introduces a method to leverage off-chain networks to optimize communication costs and enhance efficiency. We implement a prototype of the proposed mechanism and publicly release the code to facilitate practical adoption and further research. I Introduction Secure randomness generation is critical for blockchain applications, including validator selection in Proof-of-Stake (PoS), cryptographic protocols like Zero-Knowledge Proofs (ZKP), and determining fair execution orders in decentralized finance (DeFi). Distributed Randomness Beacons (DRBs) are foundational components designed to provide secure, unbiased randomness in a decentralized manner, ensuring outputs are unpredictable and tamper-resistant, which is crucial for blockchain integrity. However, generating randomness securely in distributed systems faces a key challenge: balancing safety (resistance to manipulation) against liveness (guaranteed availability). Achieving both perfectly is often impractical, and the trade-off significantly impacts system security and efficiency. The Commit-Reveal mechanism, widely adopted for its simplicity, offers strong safety but suffers from poor liveness. If any participant fails to reveal their secret, the process halts. This vulnerability is exploited by the Last Revealer Attack , where the final participant strategically decides whether to reveal based on potential outcomes, a concern amplified when randomness impacts financial incentives. To address this, we introduce Commit-Reveal² , an efficient and secure DRB implementable via smart contracts. It mitigates last revealer attacks by randomizing the reveal order using a two-layer Commit-Reveal process: randomness from the first phase dictates the reveal sequence for the second. This reduces an attacker’s ability to manipulate the order while maintaining security. Our approach also incorporates optimizations like off-chain communication to enhance efficiency. • We design the Commit-Reveal 2 mechanism, an extension of the Commit-Reveal structure, to minimize the risk of Last Revealer Attacks. • We implement a prototype of the Commit-Reveal 2 mechanism and publicly release the code to enhance its practical applicability. The rest of the paper is organized as follows: Section II reviews related works on randomness generation mechanisms. Section III details the Commit-Reveal 2 protocol, describing its structure and operations. Section IV presents the implementation details, contrasting a fully on-chain approach with a more efficient hybrid model and evaluating their gas costs. Section V concludes the paper with proposing future works. II Related Works Distributed Randomness Beacons (DRBs) are crucial for blockchain applications like PoS validation, ZKP, and DeFi ordering, but existing solutions face trade-offs in unbiasability, liveness, cost, and scalability. Commit-Reveal and VDF-Based Schemes. Commit-reveal DRBs, while simple (e.g., RANDAO [ 1 ] ), suffer from poor liveness and manipulation vulnerabilities like the last revealer attack [ 2 ] . Integrating Verifiable Delay Functions (VDFs) [ 3 ] allows recovery from incomplete reveals and enhances fairness [ 4 , 5 , 6 ] . These hybrid approaches improve safety and liveness but can introduce VDF-related complexities or costs. However, VRF and Threshold Cryptography-Based Schemes. Verifiable Random Functions (VRFs), used in Algorand [ 7 ] and Ouroboros [ 8 ] , provide unbiasable, non-interactive randomness, ensuring integrity and scalability. Threshold cryptography schemes (e.g., RandHound [ 9 ] , HydRand [ 10 ] ) leverage techniques like Publicly Verifiable Secret Sharing (PVSS) for high fault tolerance and transparency against collusion, though potentially incurring communication overhead. Our work, Commit-Reveal², focuses on mitigating the last revealer attack within the commit-reveal framework using randomized reveal ordering. III Protocol Description Commit \longrightarrow Reveal-1 \longrightarrow Reveal-2 \begin{aligned} &s_{i}\leftarrow\operatorname{Gen}()\\ &c_{o,i}\leftarrow\operatorname{\mathcal{H}}(s_{i})\\ &c_{v,i}\leftarrow\operatorname{\mathcal{H}}(c_{o,i})\\[0.0pt] &\operatorname{submit}(c_{v,i})\\[21.52771pt] &\textit{On-chain}\end{aligned} \begin{aligned} &\operatorname{submit}(c_{o,i})\\[8.61108pt] &\text{Accept if }c_{v,i}=\operatorname{\mathcal{H}}(c_{o,i})\\[8.61108pt] &\text{Compute reveal order metric}\\ &\Omega_{v}=\operatorname{\mathcal{H}}(c_{o,1}\|\dots\|c_{o,n})\\ &d_{i}=\operatorname{\mathcal{H}}(|\Omega_{v}-c_{v,i}|)\end{aligned} \begin{aligned} &\operatorname{submit}(s_{i})\\[8.61108pt] &\text{Accept if }c_{o,i}=\operatorname{\mathcal{H}}(s_{i})\\ &\quad\text{and }d_{i-1}>d_{i}\\[12.91663pt] &\Omega_{o}=\operatorname{\mathcal{H}}(s_{1}\|\dots\|s_{n})\\[12.91663pt] \end{aligned} T1 T2 T3 Fig. 1: On-chain Protocol Description Commit \longrightarrow Reveal-1 \longrightarrow Reveal-2 \begin{aligned} &s_{i}\leftarrow\operatorname{Gen}(),c_{o,i}\leftarrow\operatorname{\mathcal{H}}(s_{i})\\ &c_{v,i}\leftarrow\operatorname{\mathcal{H}}(c_{o,i})\\ &\operatorname{submit}(c_{v,i},\operatorname{sign}_{i}(c_{v,i}))\\ &\text{and accept if verified}\\[4.30554pt] &M_{v}=\mathcal{M}(c_{v,1},\dots,c_{v,n})\\[17.22217pt] &\textit{Off-chain}\end{aligned} \begin{aligned} &\operatorname{submit}(c_{o,i})\\[8.61108pt] &\text{Accept if }c_{v,i}=\operatorname{\mathcal{H}}(c_{o,i})\\[8.61108pt] &\text{Compute reveal order metric}\\ &\Omega_{v}=\operatorname{\mathcal{H}}(c_{o,1}\|\dots\|c_{o,n})\\ &d_{i}=\operatorname{\mathcal{H}}(|\Omega_{v}-c_{v,i}|)\end{aligned} \begin{aligned} &\operatorname{submit}(s_{i})\\[8.61108pt] &\text{Accept if }c_{o,i}=\operatorname{\mathcal{H}}(s_{i})\\ &\quad\text{and }d_{i-1}>d_{i}\end{aligned} \begin{aligned} &\textit{On-chain}\\[4.30554pt] &\operatorname{submit}(M_{v})\\[17.22217pt] \end{aligned} \begin{aligned} \\[34.44434pt] \ \end{aligned} \begin{aligned} &\operatorname{submit}(s_{1},\operatorname{sign}_{1}(c_{v,1}),\dots)\\ &\text{Accept if }\text{verified and }\\ &M_{v}=\mathcal{M}(\operatorname{\mathcal{H}}(\operatorname{\mathcal{H}}(s_{1})),\dots)\\[4.30554pt] &\Omega_{o}=\operatorname{\mathcal{H}}(s_{1}\|\dots\|s_{n})\\ \end{aligned} T1 T2 T3 Fig. 2: Off-chain Leveraged Protocol Description This section details the Commit-Reveal² protocol, describing its structure and operations. We first outline the baseline on-chain implementation followed by an optimized off-chain leveraged (hybrid) model, as illustrated in Fig. 1 and Figure 2 , respectively. Throughout the protocol description, let \mathcal{H}:\{0,1\}^{*}\to\{0,1\}^{k} denote a collision-resistant cryptographic hash function (e.g., Keccak-256 as commonly used in Ethereum). Furthermore, let \mathcal{M}(L) denote the Merkle root computed from an ordered list of inputs L=(x_{1},\dots,x_{n}) , where the tree is constructed using \mathcal{H} for hashing internal nodes. III-A On-Chain Commit-Reveal 2 Before participating, a node must meet a deposit requirement enforced by the on-chain contract, ensuring economic incentives are in place to deter malicious behavior. Once a participant has deposited the necessary funds, the Commit-Reveal 2 sequence proceeds entirely on-chain: 1. Commit Phase: • Each participant i locally generates a secret s_{i} from a high-entropy source. • Two layers of commitments are computed: c_{o,i}=\operatorname{\mathcal{H}}(s_{i}),\quad c_{v,i}=\operatorname{\mathcal{H}}(c_{o,i}). • Each participant calls \texttt{submit}(c_{v,i}) on-chain, thereby storing the outer commitment for later verification. 2. Reveal-1 Phase: • Participants disclose their first-layer commitment c_{o,i} by calling \texttt{submit}(c_{o,i}) . • The smart contract checks \operatorname{\mathcal{H}}(c_{o,i})=c_{v,i} . A successful match means the commitment is correctly revealed. • Once all \{c_{o,i}\} are revealed, the contract computes \Omega_{v}=\operatorname{\mathcal{H}}(c_{o,1}\,\|\,c_{o,2}\,\|\,\dots\,\|\,c_{o,n}). • This intermediate value \Omega_{v} is used to calculate values of d_{i} for all participating nodes d_{i}=\operatorname{\mathcal{H}}(|\Omega_{v}-c_{v,i}|). • Based on the sequence d_{i} , the order in which participants will reveal their final secrets is decided. Nodes are sorted in descending order of d_{i} , meaning a node with a larger value of d_{i} must reveal its final secret before nodes with smaller values of d_{i} . 3. Reveal-2 Phase: • The full reveal order array is submitted; the contract verifies that d_{i-1}>d_{i} holds for each adjacent pair, then saves it. • Following the reveal order, each participant discloses s_{i} . • The contract confirms \operatorname{\mathcal{H}}(s_{i})=c_{o,i} . • The final randomness is then produced by hashing all revealed secrets: \Omega_{o}=\operatorname{\mathcal{H}}(s_{1}\,\|\,s_{2}\,\|\,\dots\,\|\,s_{n}). By chaining two commit-reveal sequences, participants cannot trivially position themselves last to manipulate the outcome, thus reducing the risk of last-revealer attacks. The final random value \Omega_{o} is stored on-chain, ready for consumption by DApps or external services. III-B Off-Chain Leveraged (Hybrid) Commit-Reveal 2 The hybrid model shifts most storage-related tasks off-chain, reducing on-chain gas costs while preserving key security guarantees via cryptographic proofs. We assume that all communication between the leader node and participants occurs over a secure, authenticated channel—a standard assumption commonly employed in blockchain protocols that integrate on-chain and off-chain communication and achievable with existing standard internet protocols. III-B 1 Preparation (Registration and Activation) The hybrid protocol requires participants to make a one-time deposit and complete off-chain registration with a leader node. Each node verifies the on-chain threshold, provides the deposit, and submits its Ethereum address, signed authentication, and network details (IP address, port)