Chainlink Developers

Welcome to the Chainlink documentation site. You'll find comprehensive guides and documentation to help you start working with Chainlink as quickly as possible, as well as support if you get stuck. Click here for an introductory walkthrough on how to create a Chainlink request on the Ropsten test network!

Building on Chainlink? Click here to get started!

Get Started

API Reference


Join the Spring 2021 Chainlink Hackathon

This March, you have the chance to help build the next generation of smart contracts.

The Chainlink Spring Hackathon has a prize pot of over $80k+ and is sponsored by some of the most prominent crypto projects.

March 15th - April 11th
Register Here.

API reference for VRFConsumerBase.



constructorInitialize your consumer contract.


requestRandomnessMake a request to the VRFCoordinator.
fulfillRandomnessCalled by VRFCoordinator when it receives a valid VRF proof.


Initialize your consumer contract.

constructor(address _vrfCoordinator, address _link) public



Make a request to the VRF coordinator.

function requestRandomness(bytes32 _keyHash, uint256 _fee, uint256 _seed)
    public returns (bytes32 requestId)
  • _keyHash: The public key against which randomness is generated. See Chainlink VRF Addresses for details.
  • _fee: The fee, in LINK, for the request. Specified by the oracle.
  • _seed: This is the seed from which output randomness is determined. Provided by you.
  • RETURN: The ID unique to a single request.


Called by VRFCoordinator when it receives a valid VRF proof. Override this function to act upon the random number generated by Chainlink VRF.

function fulfillRandomness(bytes32 requestId, uint256 randomness)
    external virtual;
  • requestId: The Id initially returned by requestRandomness.
  • randomness: Random number generated by Chainlink VRF.


Choosing A Seed

Since the ultimate input to the VRF is mixed with the block hash of the block in which the request is made, user-provided seeds have no impact on its economic security properties. They are only included for API compatibility with previous versions of this contract.

Maximizing security

Chainlink VRF provides powerful security guarantees and is easy to integrate. However, smart contract security is a nuanced topic. If you have specific questions about your integration, please contact [email protected]

Updated 6 days ago

API Reference

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.