Technical Overview
The Software Architecture of Drips
The diagram below provides an overview of how Drips works under the hood. Drips is a 100% decentralized protocol that is built 100% on open source software and tools.
In the following sections, we'll dive deeper into each of the different components of Drips and explain the role that each one plays.
Before diving in, it’s important to point out that Drips is entirely modular and there is no requirement for users to interact with the components in the way they are arranged above. For example, the Drips Webapp is offered only as a reference implementation and users are free to create their own web apps or even interact with the smart contracts directly using transactions issued directly using Etherscan or similar tools. Similarly, there is nothing to stop users from querying the Radicle/Drips subgraph and IPFS files using any applications or tools they desire. By designing Drips in this way, the goal of our team has been to build and offer the most flexible and powerful open protocol for recurring token streams and crowd-sourced fundraising of any kind. With that in mind, our hope is that many future apps, protocols and tools will be able to build on the Drips protocol.
By designing Drips in this way, the goal of the Drips team has been to build and offer up the world's most flexible and powerful open protocol for recurring funding and fundraising of any kind. With that in mind, our hope is that many future apps, protocols and tools will be able to build on Drips.
Accounts and Balances
For a deep dive into the details of how streaming is managed behind the scenes in DripsHub, please see here.
Ethereum Contracts
The DaiDripsHub Smart Contract
DaiDripsHub is part of the Radicle-Drips-Hub repository.
The DaiDripsHub smart contract is the "lowest-level" component in the Drips architecture. DaiDripsHub provides extremely general, standalone, functionality for allowing any Ethereum address to schedule one-time or streaming payments to any other Ethereum address. In this case, "streaming" payments means payments that are made gradually over time - something that is not possible using the standard Ethereum transactions.
An example of a streaming payment would be scheduling a recurring monthly payment from one user to another. However many other types of streaming payments are also possible and for that reason we believe that DaiDripsHub can be a poweful building block for any web3 app looking to implement transfers of value that happen gradually over time.
The RadicleRegistry Smart Contract
RadicleRegistry is part of the Radicle-Drips repository.
The RadicleRegistry smart contract builds on DAIDripsHub to allow users to create and deploy DripsToken ERC-721 Smart Contracts (described below). The main purpose of the registry is to ensure that all Communities share the same underlying contract format and utilize the same DaiDripsHub contract, so that they can all Drip to one another interchangably.
The DripsToken ERC-721 Smart Contracts
DripsToken is part of the Radicle-Drips repository.
DripsToken is different from DaiDripsHub and RadicleRegistry in that rather than having a singleton contract deployed on Ethereum, a new (proxy) copy of DripsToken is deployed for each user who creates a Community using the RadicleRegistry, or the Drips webapp. Each DripsToken contract (which is also an ERC-721 contract) allows Member Token NFTs to be minted for a Community, and also makes it clear who the owner of the community is (via the OpenZeppelin Ownable interface). The owner of each DripsToken contract can interact with it directly to change parameters related to the minting of Member Tokens for the Community.
The Drips Webapp Front-End
Code for the Dripps webapp can be found in the Drips-App repository.
The Dripps webapp is a static web application written in HTML, CSS and Javascript. In this case, static means that the app does not have any dependencies on the server that delivers it, so that if users wish they can download and run the app on a local webserver (and verify all of the code).
However, for ease of use, a copy of the Drips webapp is also available at drips.network
The Drips webapp interacts directly with Ethereum (via Infura), as well as IPFS (via Piñata pinning servers) and The Graph nodes to query graphQL.
The Radicle/Drips GraphQL Subgraph
Code for the Radicle/Drips subgraph can be found in the Drips Subgraph repository.
Drips utilizes a graphQL "subgraph" that contains indexed Ethereum data for efficient querying based on The Graph's protocol. For simplicity of curation/indexing, the drips subgraph is part of the same subgraph that is used by Radicle Orgs.
For Drips, the subgraph is used solely by the Drips Webapp to allow for efficient calculation of historical values, summary statistics and for queries that scope over multiple Communities or Users at once.
IPFS and Piñata
Metadata for Communities created on Drips is stored into files on IPFS for simple/efficient storage. Drips uses Piñata as a pinning server for reliable access.