Commit graph

11 commits

Author SHA1 Message Date
Andrew Poelstra
b09b63bd1b pset: allow input blinding factors to sum to zero, or value to be 0
There are a number of special cases (and inconsistencies with wallet.cpp)
in the blinding logic that can prevent blinding from succeeding when various
intermediate values are zero. This fixes two of them.

A proper fix would involve adding new APIs to secp-zkp and then overhauling
all of the wallet blinding code. But for now let's get the tests working.
2021-09-30 21:54:40 +00:00
Andrew Poelstra
694ec795e4 PSET: fix asset proof generation and verification
A couple issues with this -- one is that it was verifying the asset
commitment against itself, rather than against the explicit asset,
and the other is that the verification logic had an extra `== 0` at
the end which inverted the verification check.

Both pretty embarassing to have not caught in review..
2021-09-21 21:59:10 +00:00
Andrew Poelstra
c6f801d4ce PSET: encapsulate blind proof checks into one method 2021-09-21 20:33:31 +00:00
Andrew Chow
3ac7e78a84 pset, rpc: Better error messages for imbalance failure conditions
Instead of not failing and silently allowing bad PSETs to be created,
provide error messages that explain why the operation the user did was
wrong. Specifically for combining PSETs such that they would become
fully blinded but have imbalanced values and blinders, and for blinding
a PSET when the wallet has a blind input but no outputs to blind (would
result in an imbalance).
2021-09-13 18:36:38 -04:00
Andrew Chow
b2a7007961 pset: verify blind value and asset proofs when signing 2021-09-11 21:02:26 -04:00
Andrew Chow
941c54fcda pset: Create explicit value and asset proofs during blinding 2021-09-08 14:57:09 -04:00
Andrew Chow
37c925f472 pset: Do not remove amounts after blinding 2021-09-07 20:44:30 -04:00
Andrew Chow
4940ceeea6 Use a constant for maximum surjection targets 2021-06-22 14:42:38 -04:00
Andrew Chow
e9bfff25db Allow empty scriptPubKeys 2021-06-22 14:42:19 -04:00
Andrew Chow
124efa2668 Return better errors for BlindingStatus 2021-06-22 14:42:19 -04:00
Andrew Chow
e7dd046b03 Implement BlindPSBT 2021-06-22 14:42:19 -04:00