# Second Docs ## Docs - [MCP server for agents](https://second.tech/docs/agents.md) - [Get bitcoin tip height](https://second.tech/docs/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 a specific amount](https://second.tech/docs/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… - [Board all on-chain bitcoin](https://second.tech/docs/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… - [List pending boards](https://second.tech/docs/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. - [API clients](https://second.tech/docs/api-reference/clients.md) - [Claim all exited VTXOs](https://second.tech/docs/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/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… - [Get exit status](https://second.tech/docs/api-reference/exits/get-exit-status.md): Returns the current state of an emergency exit for the specified VTXO, including which phase the exit is in (start, processing, awaiting-delta, claimable, claim-in-progress, or claimed). Optionally includes the full state transition history and the exit transaction packages with their CPFP children. - [List all exit statuses](https://second.tech/docs/api-reference/exits/list-all-exit-statuses.md): Returns the current state of every emergency exit in the wallet. Each entry includes which phase the exit is in (start, processing, awaiting-delta, claimable, claim-in-progress, or claimed), and optionally the full state transition history and the exit transaction packages with their CPFP children. - [Progress exits](https://second.tech/docs/api-reference/exits/progress-exits.md): Triggers all in-progress exits to advance by one step. 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 checks whether previously broadcast transactions… - [Start exit for all VTXOs](https://second.tech/docs/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/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,… - [Estimate board fee](https://second.tech/docs/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 receive fee](https://second.tech/docs/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 Lightning send fee](https://second.tech/docs/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 offboard-all fee](https://second.tech/docs/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. - [Estimate send-onchain fee](https://second.tech/docs/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 on-chain fee rates](https://second.tech/docs/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. - [Cancel a pending receive](https://second.tech/docs/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. - [Create a BOLT11 invoice](https://second.tech/docs/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. - [Get receive status](https://second.tech/docs/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… - [List all pending receive statuses](https://second.tech/docs/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. - [Send a Lightning payment](https://second.tech/docs/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. - [Create a websocket ticket](https://second.tech/docs/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. - [Drain on-chain wallet](https://second.tech/docs/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. - [Generate on-chain address](https://second.tech/docs/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/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. - [List on-chain transactions](https://second.tech/docs/api-reference/onchain/list-on-chain-transactions.md): Returns all on-chain wallet transactions, ordered from oldest to newest. - [List on-chain UTXOs](https://second.tech/docs/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). - [Send on-chain payment](https://second.tech/docs/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/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/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. - [Overview](https://second.tech/docs/api-reference/overview.md) - [Ping](https://second.tech/docs/api-reference/ping.md) - [Check server connection](https://second.tech/docs/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/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. - [Delete apiv1wallet](https://second.tech/docs/api-reference/wallet/delete-apiv1wallet.md) - [Generate Ark address](https://second.tech/docs/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 apiv1wallet](https://second.tech/docs/api-reference/wallet/get-apiv1wallet.md) - [Get Ark address by index](https://second.tech/docs/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. - [Get Ark server info](https://second.tech/docs/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 encoded VTXO](https://second.tech/docs/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. - [Get next round time](https://second.tech/docs/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. - [Get VTXO detail](https://second.tech/docs/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 wallet balance](https://second.tech/docs/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… - [Get wallet history](https://second.tech/docs/api-reference/wallet/get-wallet-history.md): Returns the full 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 balanc… - [Import a VTXO](https://second.tech/docs/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. - [List movements (deprecated)](https://second.tech/docs/api-reference/wallet/list-movements-deprecated.md): Deprecated: Use history instead - [List round participations](https://second.tech/docs/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… - [List VTXOs](https://second.tech/docs/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. - [Offboard all VTXOs](https://second.tech/docs/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/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/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/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 specific VTXOs](https://second.tech/docs/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… - [Send a payment](https://second.tech/docs/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/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/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… - [Connect a wallet](https://second.tech/docs/ark-server/connect-wallet.md) - [Set up an Ark server with Docker Compose](https://second.tech/docs/ark-server/docker-compose.md) - [Introduction](https://second.tech/docs/ark-server/index.md) - [Set up an Ark server manually](https://second.tech/docs/ark-server/manual-setup.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. - [Advanced Bark features](https://second.tech/docs/getting-started/bark-cli/advanced.md) - [Configure Bark](https://second.tech/docs/getting-started/bark-cli/configuration.md) - [Install Bark, an Ark CLI wallet](https://second.tech/docs/getting-started/bark-cli/index.md) - [Test Ark on signet](https://second.tech/docs/getting-started/bark-cli/signet.md) - [Get started with Dart](https://second.tech/docs/getting-started/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 Go](https://second.tech/docs/getting-started/go.md): Add Ark payments to your Go application. Create a wallet, generate addresses, and check your balance in minutes. - [Get started with Kotlin](https://second.tech/docs/getting-started/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 React Native](https://second.tech/docs/getting-started/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 Rust](https://second.tech/docs/getting-started/rust.md): Add Ark payments to your Rust application. Create a wallet, generate addresses, and check your balance in minutes. - [Integrate with your server](https://second.tech/docs/getting-started/server-integration.md) - [Get started with Swift](https://second.tech/docs/getting-started/swift.md): Add Ark payments to your iOS or macOS application. Create a wallet, generate addresses, and check your balance in minutes. - [Build a wallet app](https://second.tech/docs/getting-started/wallet-app.md) - [Add bitcoin payments to your app with Bark](https://second.tech/docs/index.md) - [Ark boarding](https://second.tech/docs/learn/board.md) - [Ark emergency exits](https://second.tech/docs/learn/exit.md) - [Ark fees](https://second.tech/docs/learn/fees.md) - [Ark forfeits](https://second.tech/docs/learn/forfeits.md) - [Ark protocol glossary](https://second.tech/docs/learn/glossary.md) - [Intro to the Ark protocol](https://second.tech/docs/learn/intro.md) - [VTXO lifetime](https://second.tech/docs/learn/lifetime.md) - [Ark liquidity](https://second.tech/docs/learn/liquidity.md) - [Ark offboarding](https://second.tech/docs/learn/offboard.md) - [Ark payments](https://second.tech/docs/learn/payments.md) - [Lightning payments](https://second.tech/docs/learn/payments-lightning.md) - [On-chain payments](https://second.tech/docs/learn/payments-on-chain.md) - [Ark rounds](https://second.tech/docs/learn/rounds.md) - [Ark VTXOs](https://second.tech/docs/learn/vtxo.md) ## OpenAPI Specs - [openapi](https://second.tech/docs/api-reference/openapi.json) ## Optional - [Forum](https://community.second.tech) - [Chat](https://chat.second.tech)