Skip to content

Implement PrunedBlockchain backend: RPC on pruned node #530

@RCasatta

Description

@RCasatta

Current RpcBlockchain grants full access to transaction history, however, it requires a non-pruned node (a node storing the full blockchain, which at the time of writing is over 400GB).

However, by renouncing to a wallet full transaction history, it is still possible to compute the wallet balance and be able to spend without needing a non-pruned node.

The key to achieve that is using RPC method scantxoutset

Note: if someone want to turn this into a "summer-of-bitcoin" project is welcome

Summer of Bitcoin Project Proposal

Description

Current RpcBlockchain grants full access to transaction history, however, it requires a non-pruned node (a node storing the full blockchain, which at the time of writing is over 400GB).

However, even without a wallet's full transaction history it is still possible to compute the wallet balance and be able to spend with only a pruned core full node.

The key to achieve that is using RPC method scantxoutset

Expected Outcomes

  • Implement blockchain::rpc::PrunedRpcBlockchain and blockchain::rpc::PrunedRpcConfig.
  • PrunedRpcBlockchain will use core scantxoutset RPC to compute wallet balances.
  • PrunedRpcBlockchain will create spending transactions with a pruned core full node.

Resources

Skills Required

Mentor(s)
@afilini @RCasatta

Difficulty
Hard

Competency Test

  • Install rust, compile and run all bdk examples and tests.
  • Read through the BDK docs.
  • Setup a local Bitcoin Core node daemon in Regtest mode.
  • Make a dummy wallet with and test with example_bitcoind_rpc_polling client.
  • Familiarity with basic rust, should be able to write basic trait implementations on foreign structures.

Metadata

Metadata

Assignees

Labels

summer-of-bitcoinSummer of Bitcoin Project Proposal

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions