MCPcopy Index your code
hub / github.com/arkade-os/arkd

github.com/arkade-os/arkd @v0.9.12

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.9.12 ↗ · + Follow
7,923 symbols 21,339 edges 457 files 1,395 documented · 18%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

arkd

GitHub release (latest by date) Docker Image Integration ci_unit GitHub Go Reference Ask DeepWiki

⚠️ IMPORTANT DISCLAIMER: ALPHA SOFTWARE arkd is currently in alpha stage. This software is experimental and under active development. DO NOT ATTEMPT TO USE IN PRODUCTION. Use at your own risk.

What is arkd?

arkd is the server implementation of Arkade instance that builds on top of the Ark protocol, a Bitcoin scaling solution that enables fast, low-cost off-chain transactions while maintaining Bitcoin's security guarantees. As an Arkade Operator, the server:

  • Creates and manages Batch Outputs through on-chain Bitcoin transactions
  • Facilitates off-chain transactions between users
  • Provides liquidity for commitment transactions (on-chain settlements that finalize each batch)

The Operator's role is designed with strict boundaries that ensure users always maintain control over their funds. This architecture allows for efficient transaction batching while preserving the trustless nature of Bitcoin.

Supported Networks and Wallets

arkd supports the following Bitcoin network: * regtest * testnet3 * signet * mutinynet * mainnet

and makes use of arkd-wallet, an on-chain wallet based on NBXplorer, as liquidity provider and optionally also as signer.

Usage Documentation

In this documentation, you'll learn how to install and use arkd, a Bitcoin server for off-chain Bitcoin transactions.

Installing from GitHub Releases

  1. Download the latest arkd binary from the GitHub Releases page

  2. Make the binary executable: sh chmod +x arkd

  3. Move the binary to a directory in your PATH (optional): sh sudo mv arkd /usr/local/bin/

Configuration Options

The arkd server can be configured using environment variables and the admin settings API.

Environment Variables

Environment Variable Description Default
ARKD_DATADIR Directory to store data App data directory
ARKD_PORT Port (public) to listen on 7070
ARKD_ADMIN_PORT Admin port (private) to listen on, fallback to service port if 0 7071
ARKD_ENABLE_CHANNELZ Expose gRPC channelz introspection; query via grpc_cli on the admin port false
ARKD_LOG_LEVEL Logging level (0-6, where 6 is trace) 4 (info)
ARKD_SESSION_DURATION How long a batch session lasts (in seconds) before timing out once it started 30
ARKD_DB_TYPE Database type (postgres, sqlite, badger) postgres
ARKD_PG_DB_URL Postgres connection url if ARKD_DB_TYPE is set to postgres -
ARKD_EVENT_DB_TYPE Event database type (postgres, badger) postgres
ARKD_PG_EVENT_DB_URL Event database url if ARKD_EVENT_DB_TYPE is set to postgres -
ARKD_PG_DB_AUTOCREATE Toggles postgres database creation when it does not exist false
ARKD_PG_DB_MAX_OPEN_CONN Maximum number of open Postgres connections per pool 50
ARKD_PG_DB_MAX_IDLE_CONN Maximum number of idle Postgres connections per pool 50
ARKD_PG_DB_CONN_MAX_IDLE_MINS Maximum idle time for Postgres connections in minutes 5
ARKD_PG_DB_CONN_MAX_LIFE_MINS Maximum lifetime for Postgres connections in minutes 30
ARKD_TX_BUILDER_TYPE Transaction builder type (covenantless) covenantless
ARKD_LIVE_STORE_TYPE Cache service type (redis, inmemory) redis
ARKD_REDIS_URL Redis db connection url if ARKD_LIVE_STORE_TYPE is set to redis -
ARKD_REDIS_NUM_OF_RETRIES Maximum number of retries for Redis write operations in case of conflicts -
ARKD_ESPLORA_URL Esplora API URL https://blockstream.info/api
ARKD_WALLET_ADDR The arkd wallet address to connect to in the form host:port -
ARKD_SIGNER_ADDR The signer address to connect to in the form host:port value of ARKD_WALLET_ADDR
ARKD_NO_MACAROONS Disable macaroon authentication false
ARKD_NO_TLS Disable TLS true
ARKD_UNLOCKER_TYPE Wallet unlocker type (env, file) to enable auto-unlock -
ARKD_UNLOCKER_FILE_PATH Path to unlocker file -
ARKD_UNLOCKER_PASSWORD Wallet unlocker password -
ARKD_SCHEDULER_TYPE Scheduler type (gocron, block) gocron
ARKD_TLS_EXTRA_IP Extra IP addresses for TLS (comma-separated) -
ARKD_TLS_EXTRA_DOMAIN Extra domains for TLS (comma-separated) -
ARKD_NOTE_URI_PREFIX Note URI prefix -
ARKD_SCHEDULED_SESSION_START_TIME Scheduled session start time (Unix timestamp) -
ARKD_SCHEDULED_SESSION_END_TIME Scheduled session end time (Unix timestamp) -
ARKD_SCHEDULED_SESSION_PERIOD Scheduled session period in minutes -
ARKD_SCHEDULED_SESSION_DURATION Scheduled session duration in seconds -
ARKD_SCHEDULED_SESSION_MIN_ROUND_PARTICIPANTS_COUNT Min participants for scheduled sessions -
ARKD_SCHEDULED_SESSION_MAX_ROUND_PARTICIPANTS_COUNT Max participants for scheduled sessions -
ARKD_OTEL_COLLECTOR_ENDPOINT OpenTelemetry collector endpoint -
ARKD_OTEL_PUSH_INTERVAL OpenTelemetry push interval in seconds 10
ARKD_HEARTBEAT_INTERVAL Heartbeat interval in seconds 60
ARKD_ROUND_REPORT_ENABLED Enable round report service false
ARKD_INDEXER_EXPOSURE. Require intent for getting vtxo chain (public, private, withheld) public
ARKD_INDEXER_SIGNING_PRIVKEY Hex-encoded private key for indexer auth token signing (sensitive) -
ARKD_INDEXER_AUTH_TOKEN_EXPIRY Auth token TTL in seconds 300 (5 minutes)
ARKD_BATCH_TRIGGER Optional CEL formula returning bool. When set, the server only starts a new batch round when the formula evaluates to true. See pkg/ark-lib/batchtrigger/README.md for the available variables and examples. - (always start)

Admin Settings

The following settings are persisted in the database and managed via the admin API.

Default values are seeded from ARKD_* environment variables on the first startup only. After that, those environment variables are ignored and settings are managed exclusively via the admin API. See Settings: first-boot seeding and runtime management for the full list of seed variables, units, defaults, and how to change settings at runtime.

Endpoint Method Description
/v1/admin/settings GET Retrieve current settings
/v1/admin/settings POST Update settings (partial; only provided fields change)
Setting Description Default
vtxo_tree_expiry VTXO tree expiry (blocks or seconds depending on scheduler) 604672 (gocron) / 20 (block)
unilateral_exit_delay Unilateral exit delay in seconds 86400 (24 hours)
public_unilateral_exit_delay Public unilateral exit delay in seconds 86400 (24 hours)
checkpoint_exit_delay Checkpoint exit delay (blocks or seconds) 86400 (gocron) / 10 (block)
boarding_exit_delay Boarding exit delay in seconds 7776000 (3 months)
round_min_participants_count Minimum number of participants per round 1
round_max_participants_count Maximum number of participants per round 128
vtxo_min_amount Minimum allowed amount for vtxos -1 (dust)
vtxo_max_amount Maximum allowed amount for vtxos -1 (unset)
utxo_min_amount Minimum allowed amount for boarding or collaborative exit -1 (dust)
utxo_max_amount Maximum allowed amount for boarding or collaborative exit -1 (unset)
ban_duration Ban duration in seconds 300 (5 minutes)
ban_threshold Number of crimes to trigger a ban 3
max_tx_weight Max transaction weight 40000
settlement_min_expiry_gap Minimum gap between settlement and VTXO expiry in seconds 0
vtxo_no_csv_validation_cutoff_date Unix timestamp after which CSV validation is enforced 0 (disabled)

Provisioning

Data Directory

By default, arkd stores all data in the following location:

  • Linux: ~/.arkd/
  • macOS: ~/Library/Application Support/arkd/
  • Windows: %APPDATA%\arkd\

You can specify a custom data directory using the ARKD_DATADIR environment variable.

Connect to Bitcoin

arkd-wallet is the wallet used by arkd as liquidity provider.

It is based on NBXplorer and requires a running instance to connect to. You can check the [example](https://gi

Extension points exported contracts — how you extend this code

IdentityStore (Interface)
(no doc) [7 implementers]
pkg/client-lib/identity/singlekey/store/store.go
ArkPsbtFieldCoder (Interface)
(no doc) [10 implementers]
pkg/ark-lib/txutils/psbt_fields.go
Unlocker (Interface)
(no doc) [8 implementers]
internal/core/ports/unlocker.go
ExtendedRootKeyStore (Interface)
ExtendedRootKeyStore is an interface augments the existing macaroons.RootKeyStorage interface by adding a number of addi [2 …
pkg/macaroons/service.go
SeedRepository (Interface)
SeedRepository is the service storing the encrypted seed data. [1 implementers]
pkg/arkd-wallet/core/ports/seed_repository.go
ExtendedRTx (Interface)
ExtendedRTx is an extension to walletdb.ReadTx to allow prefetching of keys. [1 implementers]
pkg/kvdb/interface.go
OpenOption (FuncType)
OpenOption configures how OpenDb builds the SQLite DSN.
internal/infrastructure/db/sqlite/utils.go
Service (Interface)
(no doc) [1 implementers]
internal/interface/service.go

Core symbols most depended-on inside this repo

Error
called by 540
internal/interface/grpc/interceptors/error_converter.go
New
called by 397
internal/core/ports/live_store.go
String
called by 367
internal/core/domain/conviction.go
Len
called by 260
internal/core/ports/live_store.go
Close
called by 213
internal/infrastructure/db/sqlite/utils.go
WithMetadata
called by 206
pkg/errors/errors.go
Add
called by 172
internal/core/ports/live_store.go
Get
called by 143
internal/core/ports/live_store.go

Shape

Method 4,910
Function 1,688
Struct 1,125
Interface 122
TypeAlias 58
FuncType 20

Languages

Go100%

Modules by API surface

api-spec/protobuf/gen/ark/v1/admin.pb.go593 symbols
api-spec/protobuf/gen/arkwallet/v1/bitcoin_wallet.pb.go557 symbols
api-spec/protobuf/gen/ark/v1/indexer.pb.go446 symbols
api-spec/protobuf/gen/ark/v1/service.pb.go324 symbols
api-spec/protobuf/gen/ark/v1/types.pb.go235 symbols
api-spec/protobuf/gen/arkwallet/v1/bitcoin_wallet_grpc.pb.go184 symbols
api-spec/protobuf/gen/ark/v1/admin_grpc.pb.go154 symbols
api-spec/protobuf/gen/ark/v1/wallet.pb.go137 symbols
internal/infrastructure/db/sqlite/sqlc/queries/query.sql.go119 symbols
internal/infrastructure/db/postgres/sqlc/queries/query.sql.go115 symbols
api-spec/protobuf/gen/ark/v1/service_grpc.pb.go84 symbols
api-spec/protobuf/gen/ark/v1/indexer_grpc.pb.go79 symbols

Datastores touched

eventDatabase · 1 repos
projectionDatabase · 1 repos

For agents

$ claude mcp add arkd \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact