Skip to main content

Introduction

Overview

Sablier's Airstreams rely on a pre-configured Merkle tree. This data structure contains the list of recipients as well as their individual claim details.

General data flow

It allows us to store minimal data at the contract level, while being able to cryptographically prove someone is entitled to claim from the contract, using proofs generated with a separate off-chain dataset (and the onchain root).

The root hash of the tree will be stored inside the deployed Airstream contract. The tree itself, as well as the initial list will be stored in an IPFS file.

Any action such as checking for eligibility or requesting the claim details of a certain user will involve reading from the IPFS file, generating proofs based on the Merkle tree and interacting with the contract using the data obtained previously.

Open-source solution

To make this functionality available to both Sablier client interfaces and 3rd party integrators we've created a Rust backend service called v2-merkle-api. Through a REST API, it provides access to creating, storing and reading from Airstream related Merkle trees.

Integrations

To integrate this API into your own applications, feel free to use the official endpoints or fork the repository and run the backend in your own environment. We're keen to improve and optimize this service, so any suggestions or issues can be flagged directly in the Github repository.

Sablier V2 Merkle API (Rust)Github - sablier-labs/v2-merkle-api