I would like to create a PSBT with a single output (P2WSH with a given/predefined amount) in an app and give that to the user. The user should then be able to fund this PSBT with the help of
bitcoind and/or a hardware wallet.
With "fund" I mean add an input with sufficient balance, perform fee estimation and add a change output if necessary.
The fully funded and finalized (all inputs signed/witnesses added) PSBT would then be given back to the app to continue the workflow.
My question: Is there a workflow with
bitcoind that allows that? I have tried
walletprocesspsbt but that only adds an input, no change output. And there are no parameters for fee estimation.
An alternative workflow that would fit my use case would be to use
walletcreatefundedpsbt where the user would specify the amount of the output to fund but leave the address/PK script to be defined. But as I understand the
walletcreatefundedpsbt command, the address has to be given for an output. Or could the
data part be used to mark an output as "incomplete"/"to be defined"?