Skip to main content

SDK

The Garden SDK is a set of typescript packages that allow you to bridge Bitcoin to EVM-based chains. It is an abstraction over the Garden APIs, allowing developers to integrate Garden components into their dApps easily.

Want to know how everything works internally? Check out Core Concepts.

Features

  • Cross-chain Swaps: Swap assets between Bitcoin and EVM-based chains.
  • Compatibility: The SDK is compatible with ethers.js or other standard Web3 providers making it easy to integrate with dApps.
  • OTAs: Create one-time Bitcoin accounts using your Web3 providers, giving you access to all Bitcoin wallet features.

📄️ Core Concepts

Bringing Bitcoin to EVM-based chains or vice versa is not a simple process. To accomplish this, Garden utilizes an atomic swap contract. If Alice, a trader, wants to swap her Bitcoin for an asset on an EVM-based chain or Ethereum itself, she needs a way to communicate with Garden that she wants to swap Bitcoin. This is where Garden comes into play; Garden uses an Orderbook engine to create orders that are matched by actors known as Fillers. Alice can now use the Garden to place an order to swap her Bitcoin for WBTC on Ethereum. We'll cover more details on how this swapping works below.