# VRF Consumer

This page guides you through an example of consuming randomness from your consumer contract. The example consumer contract on the test network is at the [GitHub repository](https://github.com/bkcoracle/vrf-consumer-contract)

As you can see in the [VRFConsumerSample](https://github.com/bkcoracle/vrf-consumer-contract/blob/main/contracts/sample/VRFConsumerSample.sol) contract, we must create a variable to store

* Subscription ID: you can get this after creating a subscription via our website
* VRF Address: you can get the address from [this page](https://docs.bkcoracle.com/utilities/contract-addresses)
* Key Hash: you can get the key hash from [this page](https://docs.bkcoracle.com/utilities/key-hash)

**Requirements**

* Your contract has to inherit [VRFConsumerBaseV2](https://github.com/bkcoracle/vrf-consumer-contract/blob/main/contracts/libs/VRFConsumerBaseV2.sol)&#x20;
* Your contract has to implement a function&#x20;

<pre><code><strong>function fulfillRandomWords(uint256 _requestId, uint256[] memory _randomWords) internal override
</strong></code></pre>

To get randomness, you must call the function called requestRandomWords() to the VRF coordinator by sending these parameters:

* keyHash: you can get the key hash from [this page](https://docs.bkcoracle.com/utilities/key-hash)
* subscriptionId: your subscription id
* requestConfirmations: the amount of block to confirm the transaction.
* callbackGasLimit: gas limit when VRF node calls your fulfillRandomWords function
* numWords: the amount of randomness

{% hint style="info" %}
Make sure your subscription has enough KDEV funding before requesting
{% endhint %}

&#x20;
