Trying to create and sign psbt with elements produces an invalid transaction.
The flow is:
- create psbt with
walletcreatefundedpsbt (bip32deriv is true)
- blind it with
blindpsbt
- sign it with the wallet using
walletprocesspsbt
- finalize the transaction with
finalizepsbt
- check that transaction will be accepted by the mempool with
testmempoolaccept - signatures are invalid.
As I figured out the walletprocesspsbt is using a raw unblinded transaction from the global scope of the psbt, so in the digest unblinded values and assets of the outputs are used. If I manually sign the transaction with asset and value commitments available in the output scope of the PSBT I can create a valid signature, but then finalizepsbt rpc call refuses to finalize the transaction because it is also checking the signatures without taking into account the commitments.
I am using elements-0.18.1.9 from the releases.
Currently I am using my own script to sign and finalize the transaction, but it's not very convenient... Would be nice to fix this.