CommitmentRevealed
Event v257 → current #2Emitted when a timelocked commitment is auto-revealed.
View events on chainThe Big Picture
This is the 'reveal' phase of commit-reveal. When the drand beacon reaches the specified round, timelocked data automatically decrypts and becomes readable. This event signals that previously hidden data is now available for consumption.
Why This Matters
When a commitment reveals, hidden data becomes accessible. For weight commit-reveal schemes, this is when validator weights are published. Applications waiting on revealed data should watch this event to start processing.
Example Scenario
A validator submitted timelocked weights at reveal_round 12345. The drand beacon reaches round 12345, triggering auto-reveal. CommitmentRevealed fires with (netuid=1, who=validator). Query RevealedCommitments to access the now-decrypted weight data.
Common Questions
- How do I get the revealed data?
- Query RevealedCommitments(netuid, who) to retrieve the list of revealed data items with their decryption timestamps.
- Is the reveal guaranteed to happen?
- Yes, as long as the drand beacon produces the round and the chain processes it. Drand is a distributed, reliable beacon.
- What happens to the original commitment?
- The timelocked portion is decrypted in place or moved to RevealedCommitments. The TimelockedIndex entry for this commitment is removed since it's no longer pending.
Use Cases
- Track when commit-reveal data becomes available
- Trigger processing of newly revealed data
- Verify commit-reveal scheme fairness
- Build real-time reveal notification services
How to Use This Event
- → Subscribe to trigger processing when expected reveals occur
- → Monitor for reveals from specific validators/miners
- → Track reveal timing for commit-reveal analytics
- → Index revealed data for search/discovery
From Chain Metadata
A timelock-encrypted commitment was auto-revealed
Triggers
Preconditions
- Timelocked commitment exists for the account/subnet
- Drand reveal round has been reached
- Decryption successful with drand beacon entropy
Effects
Postconditions
- Commitment data is now readable in plaintext
- RevealedCommitments storage updated
- TimelockedIndex entry removed
Side Effects
- Revealed data may trigger downstream processing
Event Data
Code Examples
import { ApiPromise, WsProvider } from "@polkadot/api";
import { stringCamelCase } from "@polkadot/util";
const provider = new WsProvider("wss://entrypoint-finney.opentensor.ai:443");
const api = await ApiPromise.create({ provider });
// Subscribe to CommitmentRevealed events
api.query.system.events((events) => {
events
.filter(({ event }) =>
event.section === stringCamelCase("Commitments") &&
event.method === "CommitmentRevealed"
)
.forEach(({ event }) => {
console.log("CommitmentRevealed:", event.data.toHuman());
});
});On-Chain Activity
Occasional use
#46 most emitted event
As of block 7,429,232
Runtime Info
View Source- Pallet Index
- 18
- Event Index
- 2
- First Version
- v257
- Current Version
- v393