RIF On Chain Interface (dapp) + IPFS
Para la versión en español haz clic acá
TL;DR
- To continue with the decentralization path for ROC protocol, we have created a mechanism for the community to host the RIF on chain Interface (dapp).
- The open-source RIF on chain Interface (dapp) built by our team and community is automatically deployed on each release to IPFS.
- The URL dapp.rifonchain.com now forwards to an IPFS gateway.
- Community members can pin the IPFS hashes to ensure availability.
- dapp.rifonchain.com is now served exclusively from the latest IPFS release. However, any IPFS gateway can be used directly.
ROC path to decentralization
As we announced a few months ago, going live on IPFS was the final step towards decentralization outlined in 2019 when we started working with Money On Chain.
The RIF On Chain protocol is trustless and decentralized because it lives entirely on-chain. Anyone running an RSK node can interact with contracts directly, which will perform as programmed for as long as RSK exists. However, only some people want to run a node. Instead, many users choose to interact with RIF On Chain through web interfaces, trade aggregators, wallets, or other DAPPs that have integrated ROC natively into their smart contracts.
Also, when using an interface, users should verify the transactions they sign to match the transaction presented by the interface. This is a challenging process, and why using reputable interfaces is essential.
Open source interfaces allow users to verify the code they are interacting with does what it claims. If a user runs the code locally, they can confidently make transactions. However, as soon as the code is hosted, it is difficult for users to verify the website they are interacting with has yet to be modified.
This is one of the problems that IPFS aims to solve.
IPFS is a distributed system for storing and accessing files, websites, applications, and data (You can read more about IPFS in their documentation).
Now RIF On Chain DAPP is an independent website on the distributed peer-to-peer file network known as InterPlanetary File System.
What we did
Our team has always cared about decentralization, security, and accessibility. This is why we built an open-source interface for RIF On Chain that the community can directly run, verify and build upon.
Using GitHub Actions, the RIF On Chain Interface is deployed to IPFS on each release. Each release is automatically pinned using pinata.cloud, a free IPFS pinning service. The IPFS releases can be found on GitHub.
This means the RIF On Chain Interface can now be accessed via IPFS directly, through a gateway such as cloudflare-ipfs.com, or by an alias to the gateway at dapp.rifonchain.com.
The domain dapp.rifonchain.com is now redirected to dapp.rifonchain.com, which is an alias to a IPFS gateway that serves the RIF on Chain Interface from IPFS.
How we did it
The dapp.rifonchain.com subdomain is given a CNAME record pointing at IPFS gateway.
When a user visits the domain dapp.rifonchain.com, the browser first looks up the DNS record and finds a CNAME to the IPFS gateway and brings the content of the latest release.
The IPFS gateway then fetches the content using the IPFS protocol and serves the interface to your browser via HTTPS.
Verifying a build
You can check what build you are being served from IPFS gateway by looking at your browser’s network console for the response headers sent directly from IPFS gateway.
How can you help
To keep the RIF On Chain Interface available, you can pin the hash of the latest release.
Note: this technical document is inspired in Uniswap documentation for IPFS.