← 返回 Skills 市场
tiero

Build apps with Bitcoin and Stablecoins on Arkade

作者 tiero · GitHub ↗ · v0.2.1
cross-platform ✓ 安全检测通过
356
总下载
1
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install bitcoin-arkade
功能描述
Guide for developing with the Arkade TypeScript SDK (@arkade-os/sdk) — Bitcoin wallets, Lightning, smart contracts, and stablecoin swaps.
使用说明 (SKILL.md)

Arkade SDK Development Guide

Arkade is a programmable Bitcoin execution layer. It uses VTXOs (Virtual Transaction Outputs) to enable instant offchain Bitcoin transactions with near-zero fees, while users retain full self-custody and unilateral exit rights. No changes to Bitcoin are required.

SDK Installation & Setup

npm install @arkade-os/sdk

Requires Node.js >= 22.

import { SingleKey, Wallet } from "@arkade-os/sdk";

// Create an identity (private key)
const identity = SingleKey.fromHex("your-private-key-hex");
// Or generate a new one:
// const identity = SingleKey.fromRandomBytes();

const wallet = await Wallet.create({
  identity,
  arkServerUrl: "https://arkade.computer",
});

const address = await wallet.getAddress();
console.log("Ark Address:", address);

For production, always use a secure key management solution rather than hardcoded keys.

Core Wallet Operations

Addresses

// Offchain Ark address (ark1.../tark1...) — for instant payments
const arkAddress = await wallet.getAddress();

// Boarding address — for receiving onchain BTC to be onboarded later
const boardingAddress = await wallet.getBoardingAddress();

Balances

const balance = await wallet.getBalance();

console.log("Available:", balance.available, "sats"); // spendable now
console.log("Total:", balance.total, "sats"); // includes recoverable
console.log("Settled:", balance.settled, "sats"); // Bitcoin-anchored
console.log("Preconfirmed:", balance.preconfirmed, "sats"); // cosigned

// Pending onchain deposits
console.log("Boarding:", balance.boarding.total, "sats");

Sending Payments

// Send to an Ark address — instant, near-zero fees
const txid = await wallet.sendBitcoin({
  address: "ark1...",
  amount: 50000, // satoshis
});

For onchain destinations (bc1.../tb1...), use the Ramps offboard flow below. For Lightning invoices, use @arkade-os/boltz-swap.

Receiving Payments

const address = await wallet.getAddress();
// Share this address with the sender

// Monitor for incoming funds
const stop = wallet.notifyIncomingFunds(async (notification) => {
  if (notification.type === "vtxo") {
    for (const vtxo of notification.vtxos) {
      console.log(`Received ${vtxo.amount} sats`);
    }
  }
});

// Call stop() when done listening

VTXOs

const vtxos = await wallet.getVtxos();
for (const vtxo of vtxos) {
  console.log(vtxo.txid, vtxo.amount, vtxo.status);
}

Onchain Ramps (Onboard / Offboard)

Convert between onchain Bitcoin UTXOs and offchain Arkade VTXOs. Best for large transfers; for everyday amounts, Lightning swaps have lower overhead.

import { Ramps } from "@arkade-os/sdk";

const ramps = new Ramps(wallet);

// Get fee info from the Ark server
const info = await wallet.arkProvider.getInfo();

// Onboard: convert boarding UTXOs to VTXOs
const commitmentTxid = await ramps.onboard(info.fees);

// Offboard: convert VTXOs to onchain BTC
const exitTxid = await ramps.offboard(
  "bc1q...", // destination onchain address
  info.fees,
  // amount, // optional — defaults to all available
);

Lightning Network

npm install @arkade-os/boltz-swap

Lightning integration uses Boltz submarine swaps to bridge between Arkade and the Lightning Network.

import { ArkadeLightning, BoltzSwapProvider } from "@arkade-os/boltz-swap";

const swapProvider = new BoltzSwapProvider({
  apiUrl: "https://api.ark.boltz.exchange",
  network: "bitcoin",
});

const lightning = new ArkadeLightning({
  wallet,
  swapProvider,
});

// Receive via Lightning (reverse swap)
const { invoice, paymentHash } = await lightning.createLightningInvoice({
  amount: 25000,
});
console.log("Pay this:", invoice);

// Send via Lightning (submarine swap)
const result = await lightning.sendLightningPayment({
  invoice: "lnbc...",
});
console.log("Preimage:", result.preimage);

Boltz API Endpoints

Network URL
Bitcoin mainnet https://api.ark.boltz.exchange
Mutinynet https://api.boltz.mutinynet.arkade.sh
Regtest (local) http://localhost:9069

Skill Classes (this package)

This package (@arkade-os/skill) provides higher-level wrapper classes over the SDK:

npm install @arkade-os/skill
import { Wallet, SingleKey } from "@arkade-os/sdk";
import {
  ArkadeBitcoinSkill,
  ArkaLightningSkill,
  LendaSwapSkill,
} from "@arkade-os/skill";

const wallet = await Wallet.create({
  identity: SingleKey.fromHex(privateKeyHex),
  arkServerUrl: "https://arkade.computer",
});

// Bitcoin: addresses, balances, send/receive, onboard/offboard
const bitcoin = new ArkadeBitcoinSkill(wallet);
const balance = await bitcoin.getBalance();
await bitcoin.send({ address: "ark1...", amount: 50000 });

// Lightning: invoices, payments via Boltz
const lightning = new ArkaLightningSkill({ wallet, network: "bitcoin" });
const inv = await lightning.createInvoice({ amount: 25000 });

// Stablecoin swaps: BTC \x3C-> USDC/USDT
const lendaswap = new LendaSwapSkill({ wallet });
const quote = await lendaswap.getQuoteBtcToStablecoin(100000, "usdc_pol");

ArkadeBitcoinSkill

  • getArkAddress() / getBoardingAddress() — get addresses
  • getBalance() — balance breakdown (offchain + onchain)
  • send({ address, amount }) — send sats offchain
  • getTransactionHistory() — transaction list
  • onboard(params) / offboard(params) — onchain ramps
  • waitForIncomingFunds(timeout?) — wait for incoming payment

ArkaLightningSkill

  • createInvoice({ amount, description? }) — Lightning invoice (reverse swap)
  • payInvoice({ bolt11 }) — pay Lightning invoice (submarine swap)
  • getFees() / getLimits() — swap fees and limits
  • getPendingSwaps() / getSwapHistory() — swap tracking

LendaSwapSkill

  • getQuoteBtcToStablecoin(amount, token) / getQuoteStablecoinToBtc(amount, token)
  • swapBtcToStablecoin(params) / swapStablecoinToBtc(params)
  • getSwapStatus(swapId) / getPendingSwaps() / getSwapHistory()
  • claimSwap(swapId) / refundSwap(swapId)
  • getAvailablePairs()

Stablecoin Swaps (LendaSwap)

Non-custodial BTC/stablecoin atomic swaps via HTLCs.

Supported tokens: usdc_pol, usdc_eth, usdc_arb, usdt0_pol, usdt_eth, usdt_arb

Supported chains: polygon, ethereum, arbitrum

const lendaswap = new LendaSwapSkill({ wallet });

// Get quote
const quote = await lendaswap.getQuoteBtcToStablecoin(100000, "usdc_pol");
console.log("You'll receive:", quote.targetAmount, "USDC");

// Execute swap (BTC -> USDC)
const swap = await lendaswap.swapBtcToStablecoin({
  targetAddress: "0x...", // EVM address
  targetToken: "usdc_pol",
  targetChain: "polygon",
  sourceAmount: 100000,
});
console.log("Swap ID:", swap.swapId);

// Check status
const status = await lendaswap.getSwapStatus(swap.swapId);

// Claim completed swap
const claim = await lendaswap.claimSwap(swap.swapId);

Smart Contracts

Arkade supports any valid Tapscript as VTXO locking conditions, enabling programmable offchain Bitcoin.

npm install @arkade-os/sdk @scure/base
import {
  RestArkProvider,
  RestIndexerProvider,
  SingleKey,
  VtxoScript,
  MultisigTapscript,
  CSVMultisigTapscript,
} from "@arkade-os/sdk";
import { hex } from "@scure/base";

const arkProvider = new RestArkProvider("https://mutinynet.arkade.sh");
const indexerProvider = new RestIndexerProvider("https://mutinynet.arkade.sh");
const info = await arkProvider.getInfo();
const serverPubkey = hex.decode(info.signerPubkey).slice(1);

Available contract primitives:

  • MultisigTapscript — N-of-N multisig
  • CLTVMultisigTapscript — Multisig with absolute timelocks
  • CSVMultisigTapscript — Multisig with relative timelocks
  • VtxoScript — Combine spending paths into Taproot trees

Contract patterns in docs: HTLC/Hashlock, Escrow (3-path), Spilman channels, Dryja-Poon channels, Lightning channels, chain swaps, Oracle DLC.

Use @scure/base for encoding, NOT bitcoinjs-lib.

See: https://docs.arkadeos.com/contracts/overview

Networks & Resources

Network Server URL Explorer
Bitcoin mainnet https://arkade.computer https://arkade.space
Mutinynet (testnet) https://mutinynet.arkade.sh https://explorer.mutinynet.arkade.sh
Signet https://signet.arkade.sh https://explorer.signet.arkade.sh
Regtest (local) http://localhost:7070

Local development:

nigiri start --ark

This starts a Bitcoin regtest node with an Arkade operator at http://localhost:7070.

Key Concepts

  • VTXOs: Virtual Transaction Outputs — self-custodial offchain Bitcoin coins. States: preconfirmed, settled, recoverable, spent.
  • Batch Swaps: How VTXOs achieve Bitcoin finality — multiple transactions batched into a single onchain settlement.
  • Preconfirmation: Instant confirmation cosigned by the operator, before onchain settlement.
  • Virtual Mempool: DAG-based offchain execution engine that processes Arkade transactions.
  • Unilateral Exit: Users can always withdraw their funds onchain without operator cooperation.
  • Ark Addresses: ark1... (mainnet) / tark1... (testnet) — bech32m-encoded addresses containing server + user keys.

Documentation

安全使用建议
This skill is a documentation-style developer guide and appears coherent with that purpose. If you plan to use the referenced packages, verify the npm packages (@arkade-os/sdk, @arkade-os/skill, @arkade-os/boltz-swap) and their maintainers on the official registry, confirm the arkade and boltz endpoints are correct, and avoid hardcoding private keys (use a secure KMS). Because the skill is instruction-only, risk comes from following its external commands (npm installs, network calls) — review package sources, check package versions and lockfiles, and test in an isolated/dev environment before using with real funds.
功能分析
Type: OpenClaw Skill Name: bitcoin-arkade Version: 0.2.1 The skill bundle provides a comprehensive guide for developing with the Arkade TypeScript SDK, covering Bitcoin wallets, Lightning, and stablecoin swaps. All code snippets and instructions, including `npm install` commands and network calls to `arkade.computer`, `api.ark.boltz.exchange`, and `docs.arkadeos.com`, are directly related to the stated purpose of interacting with the Arkade ecosystem. While the skill involves external dependencies and network communication, these are necessary for its functionality and are directed towards legitimate project domains. There is no evidence of prompt injection attempts against the agent, data exfiltration, backdoors, or other malicious intent. The skill even includes a security warning against hardcoding private keys.
能力评估
Purpose & Capability
The name/description (Arkade SDK, wallets, Lightning, swaps) matches the content: code snippets, SDK usage, and API endpoints for Arkade and Boltz. Nothing in the file asks for unrelated capabilities or credentials.
Instruction Scope
SKILL.md contains sample TypeScript usage, npm install commands, and API endpoint references. It does not instruct the agent to read system files, environment variables, or transmit arbitrary data outside the documented Arkade/Boltz endpoints.
Install Mechanism
No install spec or bundled code is provided; this is instruction-only. The guide references installing npm packages (normal for a developer guide) rather than downloading arbitrary artifacts.
Credentials
The skill declares no required environment variables or credentials. The content responsibly warns not to hardcode private keys. No disproportionate credential access is requested.
Persistence & Privilege
always is false and the skill does not request persistent system presence or modify other skills/config. Autonomous invocation is allowed by default but not combined with other red flags.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install bitcoin-arkade
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /bitcoin-arkade 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v0.2.1
- New SKILL.md provides a detailed guide for developing with the Arkade TypeScript SDK (@arkade-os/sdk), including Bitcoin wallet creation, Lightning integration, and stablecoin swaps. - Covers core concepts such as VTXOs (Virtual TXOs), offchain transactions, onboarding/offboarding, and maintaining self-custody. - Step-by-step instructions for installing and initializing the SDK, handling wallet operations, sending/receiving payments, and monitoring balances. - Documents onchain ramps, Lightning Network integration via Boltz swaps, and atomic swaps with stablecoins through LendaSwap. - Introduces higher-level skill classes: ArkadeBitcoinSkill, ArkaLightningSkill, and LendaSwapSkill with method overviews. - Serves as a comprehensive development reference for building with Arkade on Bitcoin and Lightning.
元数据
Slug bitcoin-arkade
版本 0.2.1
许可证
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Build apps with Bitcoin and Stablecoins on Arkade 是什么?

Guide for developing with the Arkade TypeScript SDK (@arkade-os/sdk) — Bitcoin wallets, Lightning, smart contracts, and stablecoin swaps. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 356 次。

如何安装 Build apps with Bitcoin and Stablecoins on Arkade?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install bitcoin-arkade」即可一键安装,无需额外配置。

Build apps with Bitcoin and Stablecoins on Arkade 是免费的吗?

是的,Build apps with Bitcoin and Stablecoins on Arkade 完全免费(开源免费),可自由下载、安装和使用。

Build apps with Bitcoin and Stablecoins on Arkade 支持哪些平台?

Build apps with Bitcoin and Stablecoins on Arkade 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Build apps with Bitcoin and Stablecoins on Arkade?

由 tiero(@tiero)开发并维护,当前版本 v0.2.1。

💬 留言讨论