pset: PartiallySignedTransaction::GetUnsignedTx does not work correctly when issuance assets have null values

Open
#1,126 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
cpp
Domain
blockchain

Research direction

Inspect src/psbt.cpp at lines 126-132 and trace PartiallySignedTransaction::GetUnsignedTx for issuance and reissuance asset values. Compare the resulting unsigned transaction and sighash with the consensus validation rules, then exercise the walletprocesspsbt flow. Done means generated signatures validate for issuance cases involving null values.

Written by the indexing model from the issue text.

Description

According to the consensus validation rules, we must supple Null values for issunace/reissuance instead of explicit zero. However, the current code for tries does something else:
https://github.com/ElementsProject/elements/blob/c80e926d6e29d5a9524182767967884091665405/src/psbt.cpp#L126-L132

Fix would be to have

  1. two separate if else statements for issunace/re-issuance.
  2. force_unblinded is always used. There is no way to do explicit issuances in the current pset workflow.

This calculation causes walletprocesspsbt to create signatures that do not validate because the sighash is calculated incorrectly.

Dominant language
C++
Stars
1.2k
Forks
418
Avg merge
1d 12h
Merged PRs (30d)
13

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ElementsProject/elements

All issues in ElementsProject/elements

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.