-
Notifications
You must be signed in to change notification settings - Fork 29
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
Add add_foreign_utxo #63
Comments
This can be done as part of #60 |
@awaik can you expand on your use case for the method? I've had another (maybe independent, maybe related? not sure if you're on the same team) request for this method on the server side so that chains of transactions that are yet-to-be-broadcast can all be signed by the wallet. I'm curious to hear how you plan on using the method on your app as we start exposing more and more of rust-bitcoin into the bindings. |
@thunderbiscuit Hi! |
Assuming this scenario: Transaction TXB is from Alice to Bob In BDK not
|
I understand this is using bdk rust, I will try and add this in a temporary branch for you to try. |
The branch foreign-utxo has the add foreign utxo method from bdk rust implemented and exposed in flutter |
We're building this in bdk-ffi on bitcoindevkit/bdk-ffi#358. One of the questions we have left to answer is how this foreign input is shared between Bob and Alice. We're thinking of adding methods encode/decode to base64 to the Would that cover your use case @awaik @StaxoLotl? Should it be url-safe base64? Or would you prefer just a byte array? |
@thunderbiscuit thanks, byte array would suffice for this purpose. |
See bitcoindevkit/bdk-ffi#362 for some discussion on this. The One construct that has consensus for encoding is the PSBT itself. We're thinking, why not send the whole PSBT, and then Alice can simply use the "combine" method on the PSBT? Does that solve the use case as stated above? Bob makes a PSBT, sends it to Alice. Alice also makes a PSBT, and then combines both. She can sign it, and then send that combined PSBT to Bob who can sign it too. @BitcoinZavior @StaxoLotl @awaik does that cover the use case? Just to be clear I'm absolutely on board with adding the add_foreign_utxo method, but I want to make sure I build something that scales and makes sense for all. Looking for confirmation on the use case and exact structure of what's required. |
@thunderbiscuit Thanks for the analysis. The PSBT approach will work. I am not familiar with @awaik actual use case but from the previous example we had done the PSBT implementation will work. |
Ok sounds good. Happy to hear it might enable the use case above. Since it's still a method on the Wallet type in Rust, I'm still very interested in exposing it in the bindings, but I will make sure we fully understand how users would leverage it before pushing a particular API. @StaxoLotl let me know if you'd still have a use for it past the |
After more discussions with Lloyd, I realized that this Note that this method will not be required under the new BDK 1.0 API because of a change in how the Wallet and transactions are being built interact. If someone identifies a clear need for the add_foreign_utxo method here or in any other issue on our repos I'm happy to merge the PR; if not I'll leave it aside for now at it will be superseded by the new APIs. |
Thanks for investigating this scenario @thunderbiscuit To clarify, the scenario in brief is as follows:
This is the use case, and this has been tested and it works. |
Ok cool thanks for letting us know. In this case however the "alternate solution" (creating 2 PSBTs and combining them) might be what you should pick as your primary solution if that works for you, because the add_foreign_utxo will likely disappear in the 1.0 release of BDK. This is why I wanted to make sure the use case could be done in other ways. Because it can, and add_foreign_utxo is not required, I will not merge it in the bdk-ffi codebase for the moment, particularly because as of now your use case also requires Alice and Bob to have a special, non-standard and not "compatible with other libraries" workflow (you need them to share this This means that to continue using it on your end you'll have to maintain a fork of bdk-flutter. Might be more work than is worth it. But thanks for confirming with us your use of the API! Always happy to see people building stuff with our libraries! |
Can you please expose the function
add_foreign_utxo
from bdk add_foreign_utxoIt is connected with the issue #60
The text was updated successfully, but these errors were encountered: