-
Notifications
You must be signed in to change notification settings - Fork 295
feat(utxo-core): PayGo Attestation util functions #6155
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good start!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good!
77feb80
to
9f4929b
Compare
da229ae
to
914a1aa
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds PayGo attestation support for PSBTs and updates Zcash address assertions.
- Replace
assert(...)
withassert.ok(...)
for Zcash address functions - Introduce
PAYGO_ADDRESS_ATTESTATION_PROOF
subtype and implement PayGo PSBT utilities and tests - Export new PSBT utilities and add
bitcoinjs-message
dependency
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
modules/utxo-lib/src/bitgo/zcash/address.ts | Switched to assert.ok(isZcash(network)) for outputScript/address validation |
modules/utxo-lib/src/bitgo/PsbtUtil.ts | Added PAYGO_ADDRESS_ATTESTATION_PROOF = 0x04 to ProprietaryKeySubtype |
modules/utxo-core/src/paygo/psbt/PayGoUtils.ts | Implemented addPaygoAddressProof , verifyPaygoAddressProof , index lookup, and inclusion check |
modules/utxo-core/test/paygo/psbt/PayGoUtils.ts | Added unit tests covering PayGo attestation proof addition, verification, and error cases |
modules/utxo-core/src/paygo/index.ts | Exported PSBT utilities |
modules/utxo-core/package.json | Added bitcoinjs-message dependency |
Comments suppressed due to low confidence (3)
modules/utxo-core/src/paygo/psbt/PayGoUtils.ts:36
- [nitpick] Update the JSDoc for
verifyPaygoAddressProof
to match the actual signature: swap@param pub
and@param message
, and renamepub
toattestationPubKey
to align with the code.
@param pub - The public key that we want to verify the proof with
modules/utxo-core/test/paygo/psbt/PayGoUtils.ts:70
- [nitpick] Add a test case where the PSBT contains a mismatched public key to ensure
verifyPaygoAddressProof
throws the expected 'The public key in the PSBT does not match the provided public key.' error.
it("should fail a proof verification if the proof isn't valid", () => {
modules/utxo-core/test/paygo/psbt/PayGoUtils.ts:117
- [nitpick] The describe title uses 'getPaygoAddressProofIndex' but the function is named
getPaygoAddressProofOutputIndex
. Update the test title for clarity and consistency.
describe('getPaygoAddressProofIndex', () => {
ba75327
to
a520165
Compare
…her pr TICKET: BTC-2047 chore: determined msg to sign and verify Issue: BTC-2047 TICKET: BTC-2047 chore(utxo-lib): modified verify function and tests Issue: BTC-2047 TICKET: BTC-2047 chore(utxo-core): moved util functions to uxto-core TICKET: BTC-2047 chore: got tests to work BTC-2047 TICKET: BTC-2047 feat(utxo-core): cleaned up comments TICKET: BTC-2047 chore(utxo-core): added bitcoinjs-message to deps and fixed import TICKET: BTC-2047 chore(utxo-core): used new helper functions for prop kv func and removed old TICKET: BTC-2047
54cced0
to
9232556
Compare
TICKET: BTC-2047 chore(utxo-core): renamed functions consistent and error prototypes TICKET: BTC-2047 chore(utxo-core): bip32utils to sign and verify message TICKET: BTC-2047 chore(utxo-core): added bitcoinjs-message back to package.json TICKET: BTC-2047 chore(utxo-core): refactored functions and debug tests TICKET: BTC-2047 chore(utxo-core): update verify function TICKET: BTC-2047 chore(utxo-core): updated test and verify TICKET: BTC-2047 chore(utxo-core): clean up rebase conflicts TICKET: BTC-2047 chore(utxo-core): added helper function to create attestation TICKET: BTC-2047
4670b45
to
e933da1
Compare
e706219
to
a5a81f9
Compare
TICKET: BTC-2047