Skip to content

Commit

Permalink
EOA clarification (#2130)
Browse files Browse the repository at this point in the history
  • Loading branch information
thedriftofwords authored Oct 22, 2024
1 parent aa0bc2a commit 779fa18
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
14 changes: 9 additions & 5 deletions src/content/vrf/v2-5/overview/direct-funding.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,21 @@ Requests to Chainlink VRF v2.5 follow the request and receive data cycle similar

<ClickToZoom src="/images/vrf/v2-5/direct-funding-architecture-diagram.png" />

Two types of accounts exist in the Ethereum ecosystem, and both are used in VRF:

- EOA (Externally Owned Account): An externally owned account that has a private key and can control a smart contract. Transactions can be initiated only by EOAs.
- Smart contract: A smart contract that does not have a private key and executes what it has been designed for as a decentralized application.

The Chainlink VRF v2.5 solution uses both offchain and onchain components:

- [VRF v2.5 Wrapper (onchain component)](https://github.com/smartcontractkit/chainlink/blob/develop/contracts/src/v0.8/vrf/dev/VRFV2PlusWrapper.sol): A wrapper for the VRF Coordinator that provides an interface for consuming contracts.
- [VRF v2.5 Coordinator (onchain component)](https://github.com/smartcontractkit/chainlink/blob/develop/contracts/src/v0.8/vrf/dev/VRFCoordinatorV2_5.sol): A contract designed to interact with the VRF service. It emits an event when a request for randomness is made, and then verifies the random number and proof of how it was generated by the VRF service.
- VRF service (offchain component): Listens for requests by subscribing to the VRF Coordinator event logs and calculates a random number based on the block hash and nonce. The VRF service then sends a transaction to the `VRFCoordinator` including the random number and a proof of how it was generated.

### Account types used in VRF

Two types of accounts exist in the Ethereum ecosystem, and both are used in VRF:

- EOA (Externally Owned Account): An externally owned account that has a private key and can control a smart contract. Transactions can be initiated only by EOAs.
- Smart contract: A smart contract that does not have a private key and executes what it has been designed for as a decentralized application.

While only EOAs can initiate transactions, do not attempt to use EOAs to send VRF requests directly. Instead, your EOA should interact with your consuming contract: the smart contract that is consuming the random values you request from VRF. Your EOA initiates the transaction, and then your consuming contract interacts with the VRF Wrapper contract, which sends the VRF request.

### Set up your contract and request

Set up your consuming contract:
Expand Down
15 changes: 8 additions & 7 deletions src/content/vrf/v2-5/overview/subscription.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,19 @@ Requests to Chainlink VRF v2.5 follow the request and receive data cycle similar

<ClickToZoom src="/images/vrf/v2-5/subscription-architecture-diagram.png" />

<Aside type="tip" title="Account types used in VRF">
VRF v2.5 uses both offchain and onchain components:

- [VRF v2.5 Coordinator (onchain component)](https://github.com/smartcontractkit/chainlink/blob/develop/contracts/src/v0.8/vrf/dev/VRFCoordinatorV2_5.sol): A contract designed to interact with the VRF service. It emits an event when a request for randomness is made, and then verifies the random number and proof of how it was generated by the VRF service.
- VRF service (offchain component): Listens for requests by subscribing to the VRF Coordinator event logs and calculates a random number based on the block hash and nonce. The VRF service then sends a transaction to the `VRFCoordinator` including the random number and a proof of how it was generated.

### Account types used in VRF

Two types of accounts exist in the Ethereum ecosystem, and both are used in VRF:

- Externally Owned Account (EOA): An externally owned account that has a private key and can control a smart contract. Transactions can only be initiated by EOAs.
- Smart contract: A contract that does not have a private key and executes what it has been designed for as a decentralized application.

</Aside>

VRF v2.5 uses both offchain and onchain components:

- [VRF v2.5 Coordinator (onchain component)](https://github.com/smartcontractkit/chainlink/blob/develop/contracts/src/v0.8/vrf/dev/VRFCoordinatorV2_5.sol): A contract designed to interact with the VRF service. It emits an event when a request for randomness is made, and then verifies the random number and proof of how it was generated by the VRF service.
- VRF service (offchain component): Listens for requests by subscribing to the VRF Coordinator event logs and calculates a random number based on the block hash and nonce. The VRF service then sends a transaction to the `VRFCoordinator` including the random number and a proof of how it was generated.
While only EOAs can initiate transactions, do **not** attempt to use EOAs to send VRF requests directly. Instead, your EOA should interact with your consuming contract: the smart contract that is consuming the random values you request from VRF. Your EOA initiates the transaction, and then your consuming contract sends the VRF request.

### Set up your contract and request

Expand Down

0 comments on commit 779fa18

Please sign in to comment.