<< All versions
Skill v1.0.0
currentLLM-judged scan90/100cyotee/cyotee-claude-plugins/chainlink-vrf-architecture
──Details
PublishedOctober 22, 2026 at 03:30 PM
Content Hashsha256:1275366a946dfb57...
Git SHAe73ae78591f0
──Files
Files (1 file, 3.3 KB)
SKILL.md3.3 KBactive
SKILL.md · 71 lines · 3.3 KB
version: "1.0.0" name: chainlink-vrf-architecture description: This skill should be used when the user asks about "Chainlink VRF", "VRF v2.5", "subscription method", "direct funding", "requestRandomWords", "fulfillRandomWords", "VRFCoordinator", "randomness oracle", or needs a high-level understanding of Chainlink VRF design and security. license: MIT
Chainlink VRF Architecture
Chainlink VRF provides onchain-verifiable randomness. A consumer contract requests randomness from a coordinator, and later receives a callback containing random words that are tied to a cryptographic proof.
Request Models (VRF v2.5)
| Model | Funding | Best for | Tradeoff | |
|---|---|---|---|---|
| Subscription | Shared subscription balance (LINK or native, network-dependent) | Frequent requests and multiple consumer contracts | Requires subscription lifecycle management | |
| Direct funding | Consumer pays per request (LINK or native, network-dependent) | Infrequent one-off requests | Higher overhead and per-request funding logic |
Core Lifecycle
- Consumer submits randomness request to coordinator.
- Coordinator emits request metadata (including request ID).
- Chainlink oracle network produces proof and random words.
- Coordinator verifies proof onchain.
- Coordinator calls consumer callback with
requestIdandrandomWords. - Consumer finalizes app state using those words.
VRF v2.5 Request Shape
VRF v2.5 requests are passed as a request struct (via requestRandomWords) with fields such as:
keyHashsubId(subscription path)requestConfirmationscallbackGasLimitnumWordsextraArgs(used for options like native payment where supported)
Security Considerations
- Never use block variables (
block.timestamp,blockhash) as your randomness source. - Treat fulfillment as asynchronous: user action and random resolution occur in separate transactions.
- Do not allow arbitrary callers to execute fulfillment logic; only the coordinator should be authorized.
- Make fulfillment idempotent and store
requestId -> statusto prevent replay-like double-processing bugs. - Keep callback gas bounded and avoid complex loops in fulfillment.
- Separate request initiation from effect execution when possible (store randomness, settle later).
Integration Checklist
- Pick a model: subscription vs direct funding.
- Configure coordinator, key hash, confirmations, callback gas, and word count per network.
- Implement request tracking (
pending,fulfilled,randomWords). - Restrict fulfillment entry point to coordinator.
- Add tests for request flow, authorization, stale/canceled request handling, and gas constraints.
- Validate network-specific addresses and limits against Chainlink VRF supported networks docs.
Useful Docs
https://docs.chain.link/vrfhttps://docs.chain.link/vrf/v2-5/getting-startedhttps://docs.chain.link/vrf/v2-5/securityhttps://docs.chain.link/vrf/v2-5/supported-networkshttps://docs.chain.link/vrf/llms-full.txt
See Also
skill:crane-chainlink-vrf- Crane-specific Facet/Repo/DFPkg integration guidanceskill:crane-architecture- Facet/Target/Repo design rulesskill:crane-deployment- CREATE3 and Diamond package deployment patternsskill:crane-testing- testbase and behavior testing patterns