Implement BIP-375 Silent Payments PSBT Fields #79
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Key Changes:
PSBT_GLOBAL_SP_ECDH_SHARE(0x07)PSBT_GLOBAL_SP_DLEQ(0x08)PSBT_IN_SP_ECDH_SHARE(0x1d)PSBT_IN_SP_DLEQ(0x1e)PSBT_OUT_SP_V0_INFO(0x09)PSBT_OUT_SP_V0_LABEL(0x0a)PSBT.parse_unknowns,InputScope.read_value, andOutputScope.read_valuefor the new fields, including key and value length validations.PSBT.write_to,InputScope.write_to, andOutputScope.write_to.PSBTclass now explicitly handlesversion(None for v0, 2 for v2).PSBT.sign_with):SIGHASH_ALLfor inputs when Silent Payment outputs are present.OutputScope.voutproperty now correctly handles cases wherescript_pubkeymight be None ifsp_v0_infois present (indicating a Silent Payment output whose script is not yet computed).OutputScope.write_toafter version-conditional logic was added.still figuring out the tests for this implementation(BIP-375 has no test vectors) — will add them soon.