Blockin
  • Blockin Overview
  • How Does It Work?
  • Developer Docs
    • Core Concepts
    • Getting Started
      • 🖊️User Signatures
      • 🖥️Sign In with BitBadges
      • 🆔Verification
      • 📤ChainDrivers
        • Setting Chain Drivers
        • Chain Driver Interface
        • Implementing a New Chain Driver
        • List of Implemented Chain Drivers
          • EthDriver
          • SolDriver
          • CosmosDriver
          • BtcDriver
          • AlgoDriver
    • Library Documentation
Powered by GitBook
On this page
  • Development Notes
  • Importance of Functions
  1. Developer Docs
  2. Getting Started
  3. ChainDrivers

Implementing a New Chain Driver

PreviousChain Driver InterfaceNextList of Implemented Chain Drivers

Last updated 1 year ago

It is very easy to add support for a new blockchain or create your own implementation. All you need to do is implement the interface which only takes around 200 lines of code (see our ). If you do this, it would be greatly appreciated if it is shared with us via or , so we can add it to our !

Development Notes

  • Most of the required logic should already be implemented by existing libraries or APIs of that blockchain (e.g. ethers for Ethereum). Most functions only require you to handle and call one of these functions. For example, isValidAddress(address) => return ethers.utils.isAddress(address).

Importance of Functions

Depending on the needs of your project, you may choose to only implement what is necessary.

Mandatory: These functions are mandatory to be implemented by all ChainDriver implementations. Blockin directly calls and depends on these functions for its core functionality. They must be implemented no matter what. These do not requiring querying the blockchain state and are expected to be offline-compatible.

If all you need is basic signature verification and no additional Blockin features, you only need to implement the following functions.

  • verifySignature

  • parseChallengeStringFromBytesToSign

  • isValidAddress

Mandatory for Asset Sign-Ins: Blockin calls these functions if it requires querying the blockchain in some way. If all you need is signature verifications, you do not need these functions. But if you want to utilize Blockin's additional features such as signing in with assets (NFTs), these must be implemented. Implementations may require the internet (if not using a snapshot) and API keys (dependent on the implementation).

  • verifyAssets

📤
EthDriver code
GitHub
Discord
Supported Chains
ChainDriver