Getting Started

A brief introduction to Sign Protocol for hackers.

Introduction

Sign Protocol is an omni-chain attestation protocol, enabling users to freely attest and retrieve structured and verifiable data on-chain. It also accommodates large size data by offloading storage to IPFS* and Arweave. With Sign Protocol, participating contracts collectively define data schemas and deposit relevant data in the form of attestations in Sign Protocol's smart contract.

*Storage on IPFS is free but not permanent. We recommend Arweave over IPFS.

Getting Started

Defining a Schema

A schema is a representation or configuration that defines the type and structure of data that is presented in the making of an attestation. Schemas create standards that allow an attestation to be accurate, composable, and insightful for any observer (verifier).

A helpful analogy to understand a schema is to envision it as the blueprint for an attestation. A schema facilitates how an attester provides the much-needed context and confirmation in the attestation they wish to create.

To create a schema, you will need to understand the attestation you are trying to create. What kind(s) of information are you planning to store in an attestation and how large will the data be? Typically, all data is stored onchain. However, larger datasets will be cheaper to store offchain in a Hybrid Attestation or fully off-chain on Arweave/IPFS.

You can read more about schemas here and can find examples here and here.

Schema Hooks

To use a schema hook with the schema you are creating, you will need to create a smart contract that implements the functions defined here. Schema Hooks can help you whitelist attesters, charge fees, and perform other application logic when attestations are created or revoked. If you would like to see a sample whitelist schema hook, please navigate to the Schema Hooks page.

Creating an Attestation

Sign Protocol implements attestations as digitally signed structured data that adhere to a registered schema under a schema registry. These attestations are then stored in a secure domain, either on-chain or off-chain. You will need to create or find a schema before creating an attestation.

Your attestation must adhere to its schema's defined format in order to be parseable. To learn more about the concept of attestations, you can find more information here. To create an attestation, you can find find examples here and here. If you would like to create attestations on behalf of a user (to sponsor gas, for example), you will need to provide a delegate signature from the user when creating the attestation. You can find examples of delegate attestation creation with our NPM SDK here.

Querying for Attestations

Sign Protocol offers an indexing service to quickly query and retrieve schema and attestation data. This service is available at a REST endpoint and a GraphQL endpoint and can also be accessed directly through our NPM SDK.

Final Details

You can find more development-related details and examples using Sign Protocol in the For Builders section of the docs. If you are interested in seeing the thought process behind Sign Protocol and the higher-level overview of relevant topics, see the For Thinkers section of the docs.

We recommend using a testnet for building on Sign Protocol during the hackathon. You can find a list of supported networks here. If we do not currently support a network you are looking to build on, reach out to us on Discord and we will see if we can support it.

Lastly, if you encounter any bugs, think there is something missing/incorrect in the docs, or have any questions, please reach out to the Sign Protocol team on ETHGlobal's Discord channel. We cannot wait to see what you build and look forward to interacting with you over the course of the hackathon and beyond!

As a developer on Sign Protocol, we would love to hear from you! Please join Sign's Discord channel and Telegram developer chat.

Last updated

Logo

Copyright Sign 2021-2024