Skip to content

Add Bitcoin Core REST as a chain-source option #280

Description

@elnafateh

Context

ldk-node supports a fourth chain-data-source option — set_chain_source_bitcoind_rest(),
backed by BitcoindRestClientConfig — alongside the RPC, Electrum, and Esplora sources
ldk-server already exposes via ChainSource (ldk-server/src/util/config.rs). ldk-server
currently has no REST variant.

Why this is worth adding

  • Bitcoin Core's REST interface serves block/header/tx data unauthenticated by default
    (no rpcuser/rpcpassword needed for reads), which simplifies self-hosted setups where
    operators don't want to expose or manage full RPC credentials.
  • It's a lighter-weight, cacheable path for block/header retrieval compared to JSON-RPC.

Maturity check

Two correctness bugs in ldk-node's REST chain source were found and fixed recently:

One known non-blocking edge case remains: a narrow startup race where sync_wallets could
run before initial sync registers the SPV client. It's mitigated by the RPC fallback and
was deliberately deferred by the ldk-node maintainer rather than blocking the reorg fix.

Happy to wait for an 0.8 release to depend on if maintainers would prefer that over pinning to a
main revision.

Proposed scope

  • Add a Rest { rest_host, rest_port } (or similar) variant to ChainSource in config.rs
  • Wire it to set_chain_source_bitcoind_rest() in main.rs
  • Add [bitcoind_rest]-style config parsing to ldk-server-config.toml
  • Docs + a CI fixture (bitcoind with -rest=1), following the existing bitcoind/Esplora
    e2e test setup

Open to feedback on the config shape.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions