Skip to main content

Introduction

The BeL2 SDK enables developers to integrate Zero-Knowledge Proof (ZKP) functionality for Bitcoin transaction verification on EVM-compatible chains. This SDK provides an interface for submitting verification requests and monitoring their status, bridging the gap between Bitcoin's security and the programmability of EVM ecosystems.

Key Features

  • Compatible with multiple versions of EVM providers, including ethers v5 and v6.
  • Abstract complex ZKP operations into easy-to-use functions for developers.
  • Monitor verification request status changes for responsive applications.

Core Functionalities

The BeL2 SDK primarily focuses on two main operations:

  1. Submitting Verification Requests

    • Create a verification request for a specific Bitcoin transaction using the submitVerificationRequest method.
    • Optionally include a script hex for additional verification.
  2. Checking Verification Status

    • Retrieve the current status of a submitted verification request using the checkStatus method.
    • Continuously monitor status changes through the status$ observable.

SDK Structure

The BeL2 SDK is organized into several modules:

  • ZKP - The main module containing all ZKP-related functionality.
    • EthersV5 - Provider for Ethers.js v5 compatibility.
    • EthersV6 - Provider for Ethers.js v6 compatibility.
  • services - Contains various services used by the SDK.
    • chains - Defines supported blockchain networks.
    • evm - Handles EVM-specific operations.
    • nownodes-api - Interfaces with the NOWNodes API for blockchain data.
    • zkp - Core ZKP functionality.
  • utils - Utility functions, including cryptographic operations.

Getting Started

To start using the BeL2 SDK, you'll need to:

  1. Install the SDK in your project.
  2. Configure the SDK with your desired EVM provider and network.
  3. Create a verification instance for a Bitcoin transaction.
  4. Submit a verification request.
  5. Monitor the verification status.

For detailed instructions, please refer to the Installation and SDK Overview guides.

Use Cases

The BeL2 SDK enables various applications that require secure verification of Bitcoin transactions on EVM chains:

  1. Cross-Chain Bridges - Build secure bridges between Bitcoin and EVM-compatible chains.
  2. DeFi Applications - Develop decentralized finance applications that can verify Bitcoin transactions for cross-chain operations.
  3. Bitcoin-backed Assets - Create and manage Bitcoin-backed tokens on EVM chains with verifiable proof of backing.
  4. Blockchain Analytics Tools - Build tools that can verify and analyze Bitcoin transactions from within EVM environments.

By using the BeL2 SDK, developers can create innovative applications that leverage the security of Bitcoin while benefiting from the programmability of EVM-compatible chains.

For a complete list of available methods and their usage, please refer to the API Reference section.