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

PSBT creation and funding #2

Open
shesek opened this issue May 18, 2020 · 3 comments
Open

PSBT creation and funding #2

shesek opened this issue May 18, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@shesek
Copy link
Collaborator

shesek commented May 18, 2020

No description provided.

@shesek shesek added the enhancement New feature or request label May 18, 2020
@shesek
Copy link
Collaborator Author

shesek commented May 18, 2020

Pretty straightforward if it just delegated to bitcoind's walletcreatefundedpsbt, but that would mean using all the utxos available in the wallet without being able to restrict them to specific ones. Might be acceptable if the user sets up bwt to use a separate bitcoind wallet. Also see #3.

@justinmoon
Copy link

justinmoon commented Jun 1, 2020

that would mean using all the utxos available in the wallet without being able to restrict them to specific ones

Bitcoin Core wouldn't be able to do automated coin selection on a subset of outputs in one watch-only wallet, but the first argument to walletcreatefundedpsbt allows caller to specify inputs themselves.

$ bitcoin-cli help walletcreatefundedpsbt
...
Arguments
1. inputs                             (json array, required) A json array of json objects
     [
       {                              (json object)
         "txid": "hex",               (string, required) The transaction id
         "vout": n,                   (numeric, required) The output number
         "sequence": n,               (numeric, required) The sequence number
       },
       ...
     ]
...

But you could support automated coin selection for individual bwt wallets if each pair of internal/external bwt wallets corresponded to one Bitcoin Core watch-only wallet.

@shesek
Copy link
Collaborator Author

shesek commented Jun 1, 2020

the first argument to walletcreatefundedpsbt allows caller to specify inputs themselves.

Yes, I meant that in the context of the fund part. If bwt implemented coin selection on its own, it could use bitcoind to create the PSBT with a given set of inputs.

But you could support automated coin selection for individual bwt wallets if each pair of internal/external bwt wallets corresponded to one Bitcoin Core watch-only wallet.

This is something that I considered. A simpler but not as convenient way to achieve this is separate bwt instances, each configured to use a different bitcoind wallet.

But I'm not sure if bwt should rely on having a potentially large number of bitcoind wallets, its not really well suited if you have, say, hundreds or thousands of them (for example, if you track a separate xpub for every user's deposits). I think that it might be better to implement independent coin selection in bwt, which would also allow finer-grained selection like filtering by specific addresses.

@shesek shesek added this to To Do in Bitcoin Wallet Tracker Jun 21, 2020
@shesek shesek added this to the v0.2 milestone Jun 22, 2020
@shesek shesek removed this from the v0.2 milestone Nov 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

No branches or pull requests

2 participants