-
Notifications
You must be signed in to change notification settings - Fork 354
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
Implementing proof of reserves #356
Implementing proof of reserves #356
Conversation
@nicolasburtey heard you on SLP and that you are looking into proof of reserve for your project. I would be interested to have your feedback on if you think this PR is in the right direction. |
551c70e
to
dff145e
Compare
dff145e
to
6568691
Compare
Cargo.toml
Outdated
@@ -67,6 +71,7 @@ env_logger = "0.7" | |||
base64 = "^0.11" | |||
clap = "2.33" | |||
serial_test = "0.4" | |||
rstest = "^0.7" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not a big fan of adding extra dependencies, even if they are only used during tests since they increase compilation times. Is there a different way to achieve the same result without adding this extra dependency?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sure it would be possible with some macro magic. But I don't know rust macros good enough yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, we can leave this open for the meantime and once everything else is done I'll help you out with the macro
62227ac
to
53316ea
Compare
network: Network, | ||
) -> Result<u64, Error> { | ||
let tx = psbt.clone().extract_tx(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if it would make sense to copy the outpoints into a sorted container for faster lookups here.
@notmandatory super cool I'll have a look. thanks. |
@ulrichard I have a meta question also about this PR. It seems that you don't need to access any wallet internals to create or validate a proof of reserve. So how would you feel about making this it's own repo here in the |
I'm still fairly new to rust, and thus still learning how to structure projects. If you think that's better, it's fine with me.
|
Thanks, we're still figuring it out too, but I think in this case since proof of reserve is still an experimental topic it makes sense for it to live in it's own repo.
We don't have an official convention, the most important thing is that the name isn't taken in https://crates.io yet. The name
It's probably easier if you create the repo in your account and then when you have it ready to re-review you can transfer it to the |
Hello @ulrichard , I haven't looked into the PR in detail yet, but judging from the overall objective is it something similar to BIP322? That BIP is a generic message signing protocol using specially formed Bitcoin transactions. And one of the major applications of such generic signing is "Proof of Reserve", as outlined here. My understanding is BIP322 can be used for many things including proof of reserve, so maybe you might wanna try to include that standard in your implementation? Unfortunately, there is no working implementation of BIP322 and I have worked on a very rough sketch of it a few months ago trying to layout how basic BIP322 rust structures might look like. rust-bitcoin/rust-miniscript#240 It's not complete but it does basic BIP322 functions of signing and verifying. That might be something of your interest? I am also happy to put in hands with you finishing BIP322 (it has been stale for some time now) and BDK can simply use that (it already has Overall I feel this magic should reside in some upstream rust library like |
Hi @rajarshimaitra, Yes BIP322 along with BIP127 were the main inspirations. Of which I followed BIP127 more closely. |
dca18fd
to
061cfbd
Compare
b5519c0
to
3e5bf16
Compare
4680c7d
to
def6089
Compare
def6089
to
4120a0a
Compare
4120a0a
to
ea9746b
Compare
Made the verify_sighash_type_all() function work with the test data. But it does not all make sense to me.
7c50ff4
to
0379cdf
Compare
Closing the PR and will work with @ulrichard on his https://github.com/ulrichard/bdk-reserves repo instead. |
Description
Adding a module that allows the construction of "proof of reserves" PSBTs and the verification thereof.
Notes to the reviewers
There will be an accompanying PR in bdk-cli. I will paste the URL here, once it's created.
https://github.com/ulrichard/bdk-cli/tree/reserves
But it builds upon this one:
bitcoindevkit/bdk-cli#28
Checklists
All Submissions:
cargo fmt
andcargo clippy
before committingNew Features:
CHANGELOG.md