# Second Docs ## Docs - [Add bitcoin payments to your app with Bark](https://second.tech/docs/index.md) - [Install Bark CLI](https://second.tech/docs/getting-started/bark-cli/index.md) - [Test on signet](https://second.tech/docs/getting-started/bark-cli/signet.md) - [Test on mainnet](https://second.tech/docs/getting-started/bark-cli/mainnet.md) - [Configure Bark](https://second.tech/docs/getting-started/bark-cli/configuration.md) - [Advanced Bark features](https://second.tech/docs/getting-started/bark-cli/advanced.md) - [Backups](https://second.tech/docs/backups.md) - [Built with Bark](https://second.tech/docs/built-with-bark.md): Real apps shipping bitcoin payments on Ark, Lightning, and on-chain. Built by teams using the Bark SDK and Barkd. - [MCP server for agents](https://second.tech/docs/agents.md) - [Overview](https://second.tech/docs/bark-sdk/index.md) - [Get started with Rust](https://second.tech/docs/bark-sdk/rust.md): Add Ark payments to your Rust application. Create a wallet, generate addresses, and check your balance in minutes. - [Get started with React Native](https://second.tech/docs/bark-sdk/react-native.md): Add Ark payments to your React Native app. Create a wallet, generate addresses, and check your balance in minutes. - [Get started with Dart](https://second.tech/docs/bark-sdk/dart.md): Add Ark payments to your Dart or Flutter app. Create a wallet, generate addresses, and check your balance in minutes. - [Get started with Swift](https://second.tech/docs/bark-sdk/swift.md): Add Ark payments to your iOS or macOS application. Create a wallet, generate addresses, and check your balance in minutes. - [Get started with Kotlin](https://second.tech/docs/bark-sdk/kotlin.md): Add Ark payments to your Android or JVM application. Create a wallet, generate addresses, and check your balance in minutes. - [Get started with web apps](https://second.tech/docs/bark-sdk/wasm.md): Add Ark payments to your web app. Create a wallet, generate addresses, and check your balance in minutes. - [Get started with Go](https://second.tech/docs/bark-sdk/go.md): Add Ark payments to your Go application. Create a wallet, generate addresses, and check your balance in minutes. - [Overview](https://second.tech/docs/barkd/index.md) - [Install Barkd](https://second.tech/docs/barkd/install.md) - [Start the daemon](https://second.tech/docs/barkd/start.md) - [Authenticate](https://second.tech/docs/barkd/authenticate.md) - [Clients](https://second.tech/docs/barkd/clients.md) - [Get bitcoin tip height](https://second.tech/docs/barkd/api-reference/bitcoin/get-bitcoin-tip-height.md): Queries the wallet's chain source for the block height of the latest block on the best chain. - [Board all on-chain bitcoin](https://second.tech/docs/barkd/api-reference/boards/board-all-on-chain-bitcoin.md): Moves all bitcoin in the on-chain wallet onto the Ark protocol. Creates and broadcasts a funding transaction that drains the on-chain balance into a single VTXO, then returns the pending board details. The resulting VTXO is not spendable off-chain until the funding transaction reaches the number of… - [Board a specific amount](https://second.tech/docs/barkd/api-reference/boards/board-a-specific-amount.md): Moves the specified amount of bitcoin in the on-chain wallet onto the Ark protocol. Creates and broadcasts a funding transaction, then returns the pending board details. The resulting VTXO is not spendable off-chain until the funding transaction reaches the number of on-chain confirmations required… - [List pending boards](https://second.tech/docs/barkd/api-reference/boards/list-pending-boards.md): Returns all boards whose funding transactions have not yet reached the number of on-chain confirmations required by the Ark server. - [Cancel an exit](https://second.tech/docs/barkd/api-reference/exits/cancel-an-exit.md): Aborts an in-progress emergency exit while it is still safe to do so—before its final transaction has been broadcast. Exit transactions are ordered topologically and only the final one moves the VTXO on-chain, so an exit can still be canceled even after its shared ancestor transactions are in the me… - [Claim all exited VTXOs](https://second.tech/docs/barkd/api-reference/exits/claim-all-exited-vtxos.md): Sweeps all claimable exit outputs into a single on-chain transaction sent to the specified address. Unlike `progress`, the daemon does not claim automatically—this endpoint must be called manually. Poll the `status` endpoint or call `progress` and check for `done: true` to know when VTXOs are ready… - [Claim specific exited VTXOs](https://second.tech/docs/barkd/api-reference/exits/claim-specific-exited-vtxos.md): Sweeps the specified claimable exit outputs into a single on-chain transaction sent to the specified address. Unlike `progress`, the daemon does not claim automatically—this endpoint must be called manually. Poll the `status` endpoint or call `progress` and check for `done: true` to know when VTXOs… - [Progress exits](https://second.tech/docs/barkd/api-reference/exits/progress-exits.md): Triggers all in-progress exits to advance. The daemon already progresses exits automatically in the background—use this endpoint when you want immediate progress rather than waiting for the next automatic cycle. On each call, the endpoint syncs transaction statuses, advances the exit state machine,… - [Start exit for all VTXOs](https://second.tech/docs/barkd/api-reference/exits/start-exit-for-all-vtxos.md): Registers all wallet VTXOs for emergency exit. The daemon automatically progresses registered exits in the background at the cadence defined by `SLOW_INTERVAL`, creating and broadcasting the required transactions in sequence. Once all exit transactions are confirmed and the timelock has elapsed, cal… - [Start exit for specific VTXOs](https://second.tech/docs/barkd/api-reference/exits/start-exit-for-specific-vtxos.md): Registers the specified VTXOs for emergency exit. The daemon automatically progresses registered exits in the background at the cadence defined by `SLOW_INTERVAL`, creating and broadcasting the required transactions in sequence. Once all exit transactions are confirmed and the timelock has elapsed,… - [List all exit statuses (deprecated)](https://second.tech/docs/barkd/api-reference/exits/list-all-exit-statuses-deprecated.md): Deprecated: redirects to `GET /exits/status/all`. - [List all exit statuses](https://second.tech/docs/barkd/api-reference/exits/list-all-exit-statuses.md): Returns every exit, live and finished. Optionally includes each exit's state history and its transactions with their CPFP children. - [List finished exits](https://second.tech/docs/barkd/api-reference/exits/list-finished-exits.md): Returns exits that reached a terminal state: claimed, aborted because the VTXO was already spent, or canceled. Finished exits are dropped from active tracking—they are never progressed—but they're retained for auditing and surfaced here. - [List live exit statuses](https://second.tech/docs/barkd/api-reference/exits/list-live-exit-statuses.md): Returns exits that are still progressing. Optionally includes each exit's state history and its transactions with their CPFP children. - [Get VTXO exit status](https://second.tech/docs/barkd/api-reference/exits/get-vtxo-exit-status.md): Returns the exit status for the given VTXO, live or finished. Optionally includes the state history and the exit transactions with their CPFP children. - [Get exit status (deprecated)](https://second.tech/docs/barkd/api-reference/exits/get-exit-status-deprecated.md): Deprecated: use `GET /exits/status/vtxo/{vtxo_id}` instead. - [Estimate board fee](https://second.tech/docs/barkd/api-reference/fees/estimate-board-fee.md): Estimates the Ark protocol fee for boarding the specified amount of on-chain bitcoin. The net amount is what the user receives as a VTXO. Does not include the on-chain transaction fee for the board anchor transaction. - [Estimate Lightning send fee](https://second.tech/docs/barkd/api-reference/fees/estimate-lightning-send-fee.md): Estimates the fee for sending the specified amount over Lightning. The net amount is what the recipient receives. The fee depends on the VTXOs selected and their expiry. If the wallet has insufficient funds, returns a worst-case fee estimate assuming the user acquires enough funds to cover the payme… - [Estimate Lightning receive fee](https://second.tech/docs/barkd/api-reference/fees/estimate-lightning-receive-fee.md): Estimates the fee for receiving the specified amount over Lightning. The gross amount is the Lightning payment amount, and the net amount is what the user receives as a VTXO after the Ark server deducts its fee. - [Estimate offboard fee](https://second.tech/docs/barkd/api-reference/fees/estimate-offboard-fee.md): Estimates the fee for offboarding a specific set of VTXOs to the given on-chain address. Each VTXO is offboarded in full. The gross amount is the total value of the selected VTXOs, and the net amount is what the user receives on-chain after fees. The fee depends on the destination address type, curr… - [Estimate offboard-all fee](https://second.tech/docs/barkd/api-reference/fees/estimate-offboard-all-fee.md): Estimates the fee for offboarding the entire Ark balance to the given on-chain address. The gross amount is the total spendable balance, and the net amount is what the user receives on-chain after fees. The fee depends on the destination address type, current fee rates, and VTXO expiry. - [Get on-chain fee rates](https://second.tech/docs/barkd/api-reference/fees/get-on-chain-fee-rates.md): Returns the current mempool fee rates from the chain source at three confirmation targets: fast (~1 block), regular (~3 blocks), and slow (~6 blocks). Rates are in sat/vB, rounded up. - [Estimate send-onchain fee](https://second.tech/docs/barkd/api-reference/fees/estimate-send-onchain-fee.md): Estimates the total fee for sending bitcoin from the Ark wallet to an on-chain address. The fee depends on the destination address type and current fee rates. The gross amount is what the user pays (including VTXOs spent), and the net amount is what the recipient receives on-chain. - [Get wallet history](https://second.tech/docs/barkd/api-reference/history/get-wallet-history.md): Returns the history of wallet movements ordered from newest to oldest. A movement represents any wallet operation that affects VTXOs—an arkoor send or receive, Lightning send or receive, board, offboard, or refresh. Each entry records which VTXOs were consumed and produced, the effective balance cha… - [Patch movement metadata](https://second.tech/docs/barkd/api-reference/history/patch-movement-metadata.md): Applies an [RFC 7396](https://www.rfc-editor.org/rfc/rfc7396) JSON Merge Patch to a movement's metadata. Use this to annotate history entries after the fact (e.g. refund notes, counterparty info). Keys set to `null` are removed; other values are recursively merged. - [Send a Lightning payment](https://second.tech/docs/barkd/api-reference/lightning/send-a-lightning-payment.md): Sends a payment to a Lightning destination. Accepts a BOLT11 invoice, BOLT12 offer, or Lightning address. The `amount_sat` field is required for Lightning addresses but optional for invoices and offers. Comments are only supported for Lightning addresses. - [List all pending receive statuses](https://second.tech/docs/barkd/api-reference/lightning/list-all-pending-receive-statuses.md): Returns the statuses of all pending Lightning receives, ordered from oldest to newest. A receive is pending until its `finished_at` timestamp is set, indicating it has settled or been canceled. - [Create a BOLT11 invoice](https://second.tech/docs/barkd/api-reference/lightning/create-a-bolt11-invoice.md): Generates a new BOLT11 invoice for the specified amount via the Ark server, creating a pending Lightning receive. - [Create a BOLT11 invoice for an Ark address](https://second.tech/docs/barkd/api-reference/lightning/create-a-bolt11-invoice-for-an-ark-address.md): Generates a new BOLT11 invoice. When paid, the wallet claims the Lightning receive and forwards the resulting Ark VTXO to the supplied Ark address mailbox. - [Get receive status](https://second.tech/docs/barkd/api-reference/lightning/get-receive-status.md): Returns the status of a specified Lightning receive, identified by its payment hash, invoice string, or preimage. The response tracks progress through timestamps: `htlc_vtxos` is populated once HTLCs are created by the Ark server, `preimage_revealed_at` records when the preimage was sent, and `finis… - [Cancel a pending receive](https://second.tech/docs/barkd/api-reference/lightning/cancel-a-pending-receive.md): Cancels a pending Lightning receive identified by its payment hash or invoice string. The server will refuse cancellation if HTLC-recv VTXOs have already been granted. Bark also prevents cancellation when the preimage has been revealed. - [Get send status](https://second.tech/docs/barkd/api-reference/lightning/get-send-status.md): Returns the status of a specified outgoing Lightning payment, identified by its payment hash or invoice string. The `state` field tracks the payment lifecycle from `start` through `paid`; the preimage is included once the payment succeeded. If the wallet does not recognize the payment hash, it will… - [Long-poll for wallet notifications](https://second.tech/docs/barkd/api-reference/notifications/long-poll-for-wallet-notifications.md): Long-polls for wallet notifications. Returns all notifications received since the given timestamp. If no timestamp is provided, returns all notifications in the buffer. Returned notifications are sorted by timestamp in ascending order. - [Create a websocket ticket](https://second.tech/docs/barkd/api-reference/notifications/create-a-websocket-ticket.md): Creates a single-use ticket that authenticates a websocket connection at `ws:///api/v1/notifications/ws?ticket=`. The ticket must be used within 10 minutes of creation; the resulting websocket connection is long-lived. - [Generate on-chain address](https://second.tech/docs/barkd/api-reference/onchain/generate-on-chain-address.md): Generates a new on-chain receiving address. Each call returns the next unused address from the wallet's HD keychain. - [Get on-chain balance](https://second.tech/docs/barkd/api-reference/onchain/get-on-chain-balance.md): Returns the current on-chain wallet balance, broken down by confirmation status. The `trusted_spendable_sat` field is the sum of `confirmed_sat` and `trusted_pending_sat`—the balance that can be safely spent without risk of double-spend. - [Drain on-chain wallet](https://second.tech/docs/barkd/api-reference/onchain/drain-on-chain-wallet.md): Sends the entire on-chain wallet balance to the specified address. The recipient receives the full balance minus transaction fees. Broadcasts immediately at a fee rate targeting confirmation within three blocks and returns the transaction ID. - [Send on-chain payment](https://second.tech/docs/barkd/api-reference/onchain/send-on-chain-payment.md): Sends the specified amount to an on-chain address. Broadcasts the transaction immediately at a fee rate targeting confirmation within three blocks and returns the transaction ID. - [Send to multiple addresses](https://second.tech/docs/barkd/api-reference/onchain/send-to-multiple-addresses.md): Batches multiple payments into a single on-chain transaction. Each destination is formatted as `address:amount`. Broadcasts the transaction immediately at a fee rate targeting confirmation within three blocks and returns the transaction ID. - [Sync on-chain wallet](https://second.tech/docs/barkd/api-reference/onchain/sync-on-chain-wallet.md): Syncs the on-chain wallet state with the chain source. Fetches new blocks and transactions, updates the UTXO set, and re-submits any stale unconfirmed transactions to the mempool. - [List on-chain transactions](https://second.tech/docs/barkd/api-reference/onchain/list-on-chain-transactions.md): Returns all on-chain wallet transactions, ordered from oldest to newest. Each entry includes the raw transaction, its fee (when known), the wallet's net balance change, and confirmation status. The fee is `null` for inbound or collaboratively-funded transactions whose foreign prevouts BDK has not in… - [List on-chain UTXOs](https://second.tech/docs/barkd/api-reference/onchain/list-on-chain-utxos.md): Returns all UTXOs in the on-chain wallet. Each entry includes the outpoint, amount, and confirmation height (if confirmed). - [Get apiv1wallet](https://second.tech/docs/barkd/api-reference/wallet/get-apiv1wallet.md) - [Delete apiv1wallet](https://second.tech/docs/barkd/api-reference/wallet/delete-apiv1wallet.md) - [Get Ark address by index](https://second.tech/docs/barkd/api-reference/wallet/get-ark-address-by-index.md): Returns a previously generated Ark address by its derivation index. Only addresses that have already been generated are available. - [Generate Ark address](https://second.tech/docs/barkd/api-reference/wallet/generate-ark-address.md): Generates a new Ark receiving address. Each call returns the next unused address from the wallet's HD keychain. - [Get Ark server info](https://second.tech/docs/barkd/api-reference/wallet/get-ark-server-info.md): Returns the Ark server's configuration parameters, including network, public key, round interval, VTXO expiry and exit deltas, fee settings, and Lightning support details. - [Get wallet balance](https://second.tech/docs/barkd/api-reference/wallet/get-wallet-balance.md): Returns the wallet balance broken down by category: spendable sats available for immediate use, sats pending in an Ark round, sats locked in outgoing or incoming Lightning payments, sats awaiting board confirmation, and sats in a pending exit. The balance is computed from local state, which the back… - [Build a BIP 321 payment URI](https://second.tech/docs/barkd/api-reference/wallet/build-a-bip-321-payment-uri.md): Builds a single BIP 321 `bitcoin:` URI bundling multiple ways to receive the same payment, so one call prepares everything needed for an incoming payment. A fresh Ark address is always included. When `amount_sat` is given, a BOLT11 invoice for that amount is generated and the amount is embedded in t… - [Check server connection](https://second.tech/docs/barkd/api-reference/wallet/check-server-connection.md): Checks whether the wallet has an active connection to the Ark server. Returns `true` if the wallet can reach the server and retrieve its configuration, `false` otherwise. The background daemon checks the server connection every second, so this reflects the most recent known state. - [Create a wallet](https://second.tech/docs/barkd/api-reference/wallet/create-a-wallet.md): Creates a new wallet with the specified Ark server and chain source configuration. Fails if a wallet already exists. Returns the wallet fingerprint on success. - [Get wallet history (deprecated)](https://second.tech/docs/barkd/api-reference/wallet/get-wallet-history-deprecated.md): Deprecated: use `GET /api/v1/history` instead. - [Import a VTXO](https://second.tech/docs/barkd/api-reference/wallet/import-a-vtxo.md): Imports hex-encoded serialized VTXOs into the wallet. Validates that each VTXO is anchored on-chain, owned by this wallet, and has not expired. Useful for restoring VTXOs after database loss or re-importing from the server mailbox. The operation is idempotent. - [Get wallet mnemonic](https://second.tech/docs/barkd/api-reference/wallet/get-wallet-mnemonic.md): Returns the BIP-39 mnemonic phrase backing the wallet. Returns 404 when mnemonic exposure is disabled. Exposure is off by default; the endpoint returns 404 unless barkd is started with the `--expose-mnemonic` flag. - [List movements (deprecated)](https://second.tech/docs/barkd/api-reference/wallet/list-movements-deprecated.md): Deprecated: Use history instead - [Get next round time](https://second.tech/docs/barkd/api-reference/wallet/get-next-round-time.md): Queries the Ark server for the next scheduled round start time and returns it in RFC 3339 format. - [Offboard all VTXOs](https://second.tech/docs/barkd/api-reference/wallet/offboard-all-vtxos.md): Cooperatively moves all spendable VTXOs off the Ark protocol to an on-chain address. Each VTXO is offboarded in full—partial amounts are not supported. The on-chain transaction fee is deducted from the total, and the remaining amount is sent to the destination. If no address is specified, the wallet… - [Offboard specific VTXOs](https://second.tech/docs/barkd/api-reference/wallet/offboard-specific-vtxos.md): Cooperatively moves the specified VTXOs off the Ark protocol to an on-chain address. Each VTXO is offboarded in full—partial amounts are not supported. The on-chain transaction fee is deducted from the total, and the remaining amount is sent to the destination. If no address is specified, the wallet… - [Refresh all VTXOs](https://second.tech/docs/barkd/api-reference/wallet/refresh-all-vtxos.md): Registers all spendable VTXOs for refresh in the next Ark round. The input VTXOs are locked immediately and will be forfeited once the round completes, yielding new VTXOs with a fresh expiry. The background daemon automatically participates in the round and progresses it to completion. Use the `roun… - [Refresh received VTXOs](https://second.tech/docs/barkd/api-reference/wallet/refresh-received-vtxos.md): Registers all out-of-round VTXOs held by the wallet for refresh in the next Ark round. Refreshing replaces out-of-round VTXOs under arkoor trust assumptions with trustless, in-round VTXOs. Out-of-round VTXOs whose entire transaction chain originates from your own in-round VTXOs are excluded. The bac… - [Refresh VTXOs in delegated mode](https://second.tech/docs/barkd/api-reference/wallet/refresh-vtxos-in-delegated-mode.md): Registers the specified VTXOs for refresh as a delegated participation: the wallet hands the server a signed participation and the server carries it through the round, so the wallet doesn't need to follow the round interactively. The input VTXOs are locked immediately and will be forfeited once the… - [Refresh specific VTXOs](https://second.tech/docs/barkd/api-reference/wallet/refresh-specific-vtxos.md): Registers the specified VTXOs for refresh in the next Ark round. The input VTXOs are locked immediately and will be forfeited once the round completes, yielding new VTXOs with a fresh expiry. The background daemon automatically participates in the round and progresses it to completion. Use the `roun… - [List round participations](https://second.tech/docs/barkd/api-reference/wallet/list-round-participations.md): Returns all active round participations and their current status. A round participation is created when you call one of the `refresh` endpoints and persists until the round's funding transaction is confirmed on-chain (2 confirmations on mainnet, 1 on testnet). The list can contain multiple entries—f… - [Send a payment](https://second.tech/docs/barkd/api-reference/wallet/send-a-payment.md): Sends an Ark or Lightning payment to the specified destination. Accepts an Ark address, BOLT11 invoice, BOLT12 offer, or Lightning address. Ark address payments are settled instantly via an out-of-round (arkoor) transaction. The `amount_sat` field is required for Ark addresses and Lightning addresse… - [Send on-chain from Ark balance](https://second.tech/docs/barkd/api-reference/wallet/send-on-chain-from-ark-balance.md): Sends the specified amount to an on-chain address using the wallet's off-chain Ark balance. The on-chain transaction fee is paid on top of the specified amount. Internally creates an out-of-round transaction to consolidate VTXOs into the exact amount needed, then cooperatively sends the on-chain pay… - [Sync wallet](https://second.tech/docs/barkd/api-reference/wallet/sync-wallet.md): Triggers an immediate sync of the wallet's off-chain state. Updates on-chain fee rates, processes incoming arkoor payments, resolves outgoing and incoming Lightning payments, and progresses pending rounds and boards toward confirmation. The background daemon already runs these operations automatical… - [Sync mailbox only](https://second.tech/docs/barkd/api-reference/wallet/sync-mailbox-only.md): Triggers an immediate mailbox sync without running any of the other off-chain sync steps. Fetches any pending mailbox messages from the Ark server, processes them (incoming arkoor payments, lightning receive notifications), and returns the new mailbox checkpoint (tip). Useful in `daemon_manual_sync`… - [List VTXOs](https://second.tech/docs/barkd/api-reference/wallet/list-vtxos.md): Returns VTXOs held by the wallet, including their state and expiry information. By default returns only non-spent VTXOs. Set `all=true` to include all VTXOs regardless of state. - [Get VTXO detail](https://second.tech/docs/barkd/api-reference/wallet/get-vtxo-detail.md): Returns detail for a single VTXO. To get the hex-encoded serialization use `GET /vtxos/{id}/encoded`. - [Get encoded VTXO](https://second.tech/docs/barkd/api-reference/wallet/get-encoded-vtxo.md): Returns the hex-encoded serialization of a VTXO. The `encoded` field can be passed to `POST /wallet/import-vtxo` to re-import this VTXO. - [Overview](https://second.tech/docs/ark-server/index.md) - [Set up an Ark server manually](https://second.tech/docs/ark-server/manual-setup.md) - [Set up an Ark server with Docker Compose](https://second.tech/docs/ark-server/docker-compose.md) - [Connect a wallet](https://second.tech/docs/ark-server/connect-wallet.md) - [Intro to the Ark protocol](https://second.tech/docs/learn/intro.md) - [Ark VTXOs](https://second.tech/docs/learn/vtxo.md) - [VTXO lifetime](https://second.tech/docs/learn/lifetime.md) - [Ark rounds](https://second.tech/docs/learn/rounds.md) - [Ark forfeits](https://second.tech/docs/learn/forfeits.md) - [Ark boarding](https://second.tech/docs/learn/board.md) - [Ark payments](https://second.tech/docs/learn/payments.md) - [On-chain payments](https://second.tech/docs/learn/payments-on-chain.md) - [Lightning payments](https://second.tech/docs/learn/payments-lightning.md) - [Ark offboarding](https://second.tech/docs/learn/offboard.md) - [Ark emergency exits](https://second.tech/docs/learn/exit.md) - [Ark liquidity](https://second.tech/docs/learn/liquidity.md) - [Ark fees](https://second.tech/docs/learn/fees.md) - [Ark protocol glossary](https://second.tech/docs/learn/glossary.md) - [Changelog](https://second.tech/docs/changelog/index.md): Updates to Bark, our implementation of the Ark protocol. Including the SDK, wallet, server, and developer tools. ## OpenAPI Specs - [openapi](https://second.tech/docs/api-reference/openapi.json) ## Optional - [Forum](https://community.second.tech) - [Chat](https://chat.second.tech)