Random Number Generation
Inco Lightning provides on-chain encrypted random number generation through thee_rand function. This enables use cases like lotteries, games, fair distribution, and any application requiring unpredictable values.
Overview
The generated random value is encrypted and cannot be predicted or known until decrypted by an authorized party.
Basic Usage
The second parameter identifies whether the operand is ciphertext (
0) or plaintext (1). Always pass 0 when working with encrypted handles.Account Structure
Use Cases
Fair Lottery Selection
Random Game Outcomes
Security Properties
- Unpredictable: Random values cannot be predicted before generation
- Encrypted: Results are encrypted and only visible to authorized parties
- Verifiable: Decryption requires attestation from the covalidator network