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

Pruned node support #84

Open
RCasatta opened this issue Mar 13, 2024 · 1 comment
Open

Pruned node support #84

RCasatta opened this issue Mar 13, 2024 · 1 comment

Comments

@RCasatta
Copy link
Owner

          Fwiw the following rather horrifying hack "works":
let bin_bh: [u8; 32] = hex::FromHex::from_hex("deadbeef...").unwrap();
let mut next = BlockHash::from_raw_hash(sha256d::Hash::from_byte_array(bin_bh));

(replacing the above linked definition of next ; of course you have to add the use statement: use bitcoin::hashes::{hex, sha256d, Hash};)

... where deabeef.. is the big-endian encoding of a block hash. But "works" with caveats:

  • the block hash used there should be that of the first block in your database, identifiable with bitcoin-cli getblockchaininfo (but I guess it changes over time, so you need to have bitcoind not running)
  • defining start_height and end_height doesn't work (at least, in my test), because I think with this hack it treats your first block as literally block 1 (or 0, whatever).

Still, it does output the data I wanted from a filter, so, it (barely) passes the bar of at least being worth reporting.

Originally posted by @AdamISZ in #83 (comment)

@AdamISZ
Copy link

AdamISZ commented Mar 15, 2024

For what it's worth, this would indeed be very useful for a project like this one I'm working on, because the idea is that a bunch of users (things like Joinmarket, Lightning perhaps) might want to create snapshots of keysets from the blockchain with generally agreed filters, and then run zero knowledge proofs of token validity w.r.t. that keyset. To do that each user (or let's say "each first class user"!) needs to reconstruct the keyset. Perhaps we could and should just expect all such users to run unpruned nodes, but on the other hand in e.g. Joinmarket that isn't currently needed, and I got the impression from my, quite crude, understanding of how this tool works, that it probably wouldn't be that hard to fix it to work with pruned.

@RCasatta RCasatta mentioned this issue Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants