Skip to main content
Ship on the Protocol

Documentation for Builders

The BuiId on Bitcoin REST API and SDK put one clean interface in front of initiating, monitoring, and settling atomic swaps on every supported chain. Begin on testnet, with no approval step in the way.

REST API

The REST Surface

Every endpoint speaks JSON in both directions. You authenticate with an API key sent as Authorization: Bearer <key>, and the testnet base URL is https://testnet-api.buiidonbitcoin.com/v1

Swap Endpoints
POST /swaps/initiate Opens an atomic swap and hands back the HTLC parameters plus a lock address
GET /swaps/{id} Pulls swap status, whether the preimage is out, and the transaction hashes
POST /swaps/{id}/claim Posts the preimage to claim incoming funds after the counterparty locks
POST /swaps/{id}/refund Kicks off a refund once the HTLC times out; only the initiating address may call it
GET /chains Lists supported chains alongside current status and estimated gas
GET /quote Returns a fee estimate for a proposed pair and amount
Quick Start

A Swap in Four Lines

JavaScript
import { BibClient } from '@buiidonbitcoin/sdk';
const client = new BibClient({ apiKey });
const swap = await client.initiateSwap({
  from: 'bitcoin', to: 'ethereum',
  amount: 0.05, destAddress: '0x…'
});
await client.watchSwap(swap.id);
SDK

SDKs and the Supporting Toolkit

Wallet signing, HTLC parameter building, and event watching all sit behind one tidy async interface, so chain-specific detail stays out of your application code.

  • JavaScript / TypeScript SDK: shipped on npm as @buiidonbitcoin/sdk. It runs in Node.js and the browser, and full TypeScript typings come bundled.
  • Python SDK: published on PyPI as buiidonbitcoin. It is async-first with asyncio support and fits backend services or scripted jobs.
  • Testnet environment: a sandbox with the full feature set that behaves like production. Testnet access needs no API key approval, and you can reset testnet wallets whenever you like.
  • Webhooks: listen for lifecycle events (swap.locked, swap.claimed, swap.refunded) over HTTPS POST, each payload signed with HMAC-SHA256.
  • Automatic retry and timeout handling: the SDK runs the HTLC watch loops, reconnects when the network drops, and raises timeout events ahead of the on-chain deadline so integrators have time to act.
  • OpenAPI specification: the whole REST API ships as an OpenAPI 3.1 document that works with Swagger UI, Postman, and any code-generation toolchain.
Help Along the Way

Support That Comes With Every Tier

Spot

Community Support

Entry to the developer Discord, the public docs, and the GitHub issue tracker. Replies come from the community at its own pace, which suits indie builders and prototypes.

Builder

Email Support

A dedicated email channel with a two-business-day response SLA. Integration questions reach the protocol engineering team directly, and a 90-minute onboarding call is included.

Protocol

Dedicated Support

A named support engineer, a Slack channel, a four-hour response SLA, and entry to a private staging environment. Quarterly protocol briefings and early word on API changes round it out.

Ready to Start Coding?

Create a testnet API key and get a first swap moving in minutes. There is no approval queue and no monthly charge on the Spot tier.