dfips icon indicating copy to clipboard operation
dfips copied to clipboard

CFP: Relink VRF - Trustless Chainlink VRF Relaying Service (30,000 DFI)

Open ceichinger opened this issue 9 months ago • 0 comments

Overview

  1. Requester(s): Christian, Mike
  2. Amount requested in DFI: 30,000
  3. Receiving address: (will be added at a later stage)
  4. Reddit discussion thread: https://www.reddit.com/r/defiblockchain/comments/16oijcq/cfp_relink_vrf_trustless_chainlink_vrf_relaying/
  5. Proposal fee (300 DFI) txid: (will be added at a later stage)

Links

Website

Twitter

Content

  1. Problem
  2. Solution
  3. Added value for the DFC Community
  4. Concept / Process
  5. Use of funds

1. Problem

True randomness is needed more and more: Games, NFTs, Lotteries, and Ordering Processes, …

Generating true randomness on-chain is impossible, but proving cryptographically how random numbers are determined is not. Standard off-chain random number generation is neither tamper-proof nor trustless.

Chainlink has proven to be a blue-chip oracle provider for various scenarios. Chainlink offers its own services for selected blockchains (e.g. Ethereum and Polygon). At the same time, the speed at which new chains are deployed is constantly increasing. Be it as L2s or even L3s or as another competitive L1s. Metachain is one of them and Chainlink cannot serve all chains.

2. Solution

Relink has developed a proxy service solution that forwards the random data request to an officially from Chainlink supported chain and processes the result accordingly in a trustless way.

A Relink oracle network signs the data generated by Chainlink and passes the original data along with the signatures to the callback method. The signature checks in the consumer base contract mean that no data can be changed on the way from the relaying backend.

At Relink, we take care to implement the official Chainlink interfaces as accurately as possible, so that existing code bases can be transferred almost effortlessly. This makes adapting successful dapps into other networks much more lucrative and faster. With Relink you use the native token DFI on the Metachain. Relink takes care of exchanging DFI into LINK from time to time to pay for the Chainlink services.

3. Added value for the DeFiChain Community

Chainlink is the bluechip oracle provider and all others do not really have widespread adoption yet. A common scheme on (new) EVM chains is that existing open source projects are forked. In case these dapps make use of a VRF service, in almost all cases they will use Chainlink VRF on Ethereum / Polygon / BSC and it's almost no effort if they can use the Relink proxy with the same interface instead of migrating to an interface of another provider.

With Relink as the infrastructure provider, Chainlink VRF will also become available on the Metachain. This has a positive effect on the adaptation of existing dapps from other chains as well as on the quality of new dapps that are created on the Metachain or migrated from Defichain (e.g. DFI Lottery).

4. Concept / Process

In recent years, several projects have proven excellent basic services and have been widely accepted by dapp developers. However, in the same time the amount of available networks has grown very much, so that these providers can serve only a part of the existing networks.

We believe that superb services should be available on as many chains as possible. And we also believe in the decentralized approach and that the community should be empowered to integrate beloved services permissionless into their own networks. Every dapp developer should have access to blue-chip data providers and not have to compromise with second-rate services just because their preferred services are not available.

Relink provides a relaying service by providing base contracts that has implemented a similar interface as the original base consumer contract. The relaying service forwards the request to an officially supported chain and as soon as the results arrive, the result is played back to the target network along with signatures from the Relink Oracle network.

These signatures are checked by the dapp contract so that malicious behaviour of the relaying service would be detected and the callback call would fail.

The following is an example of the process flow for a Relink data request for Chainlink data on Polygon.

Relink Architecture

  1. The dapp calls the requestXxx method provided by the RelinkXyzConsumerBase contract. An internal call to the RelinkXyzProxy contract is initiated.
  2. The RelinkXyzProxy emits an event that is recognized and processed by the Relaying Service backend.
  3. The Relaying Service backend invokes the RelinkXyzProducer contract on Polygon.
  4. The RelinkXyzProducer implements the ChainlinkXyzConsumerBase contract and can initiate a data request from Chainlink.
  5. Chainlink calls the callback method provided by RelinkXyzProducer and passes the requested data.
  6. RelinkXyzProducer emits an event that is recognized and processed by the Relaying Service backend.
  7. The Relaying Service backend calls oracle nodes to extract the data from the emitted event and create a signature for the data.
  8. The Relaying Service backend calls the callback method provided by the RelinkXyzProxy and passes the requested data along with the signatures.
  9. The RelinkXyzProxy forwards the call to the dapp that initiated the data request.

Real world example As an example, a randomness request (VRF) on the EVM chain "Horizen EON" is used here.

  1. InitiateRandomnessRequest in this transaction on Horizen EON (September-06-2023 10:40:43 PM +2 UTC)
  2. RequestRandomWords in this transaction on Polygon (Sep-06-2023 10:41:03 PM +2 UTC)
  3. RandomnessReceived in this transaction on Polygon (Sep-06-2023 10:41:17 PM +2 UTC)
  4. CallbackWithRandomness in this transaction on Horizen EON (September-06-2023 10:41:55 PM +2 UTC)

5. Use of funds

  • 7,500 DFI: Deployment of Smart Contracts
  • 10,000 DFI: Infrastructure Setup & Hosting
  • 2,500 DFI: Update Developer Documentation
  • 5,000 DFI: Purchase LINK token for initial top-up
  • 5,000 DFI: Initial Support for Builder

ceichinger avatar Sep 21 '23 14:09 ceichinger