Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement PrunedBlockchain backend: RPC on pruned node #530

Closed
RCasatta opened this issue Jan 19, 2022 · 4 comments
Closed

Implement PrunedBlockchain backend: RPC on pruned node #530

RCasatta opened this issue Jan 19, 2022 · 4 comments
Assignees
Labels
summer-of-bitcoin Summer of Bitcoin Project Proposal

Comments

@RCasatta
Copy link
Member

RCasatta commented Jan 19, 2022

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.
@afilini
Copy link
Member

afilini commented Jan 20, 2022

We have discussed making the summer of bitcoin tasks a bit easier because most students don't have a lot of experience with Bitcoin or even git sometimes. Though, compared to the other tasks we have this seems relatively easy, so I'm adding the tag anyway..

@afilini afilini added the summer-of-bitcoin Summer of Bitcoin Project Proposal label Jan 20, 2022
@notmandatory
Copy link
Member

@afilini and @RCasatta would one or both of your be willing to mentor this issue for Summer of Bitcoin? I put you both on it for now. 🙂

@evanlinjin
Copy link
Member

evanlinjin commented Aug 7, 2022

Imo we should take into consideration that "pruning" does not prune away transactions already found in the Core wallet, and that it is very simple to change a core node from non-pruned to pruned, and that it is also possible that a user will create a Core wallet very early on in bootstrap (even though pruning is enabled).

It would make sense in some cases to "reuse" the original RpcBlockchain for a pruned node. Imo an elegant implementation should take into consideration all possibilities.

@RCasatta RCasatta removed their assignment Oct 11, 2023
@notmandatory notmandatory assigned notmandatory and unassigned afilini Mar 6, 2024
@notmandatory
Copy link
Member

notmandatory commented Mar 6, 2024

Closing this in favor of a new issue based on changing new bdk_bitcoind_rpc crate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
summer-of-bitcoin Summer of Bitcoin Project Proposal
Projects
Status: Done
Development

No branches or pull requests

4 participants