verify_before_signing function checks that a PCZT matches your original request. This is a security check to detect malleation if the PCZT was handled by a third party.
Per ZIP 374: “If the entity that invoked
propose_transaction is the same as the entity that is adding the signatures, and no third party may have malleated the PCZT before signing, this step may be skipped.”When to Verify
| Scenario | Should Verify? |
|---|---|
| You created and will sign the PCZT | Optional |
| PCZT came from another system | Required |
| Hardware wallet workflow | Required |
| Multi-party transaction | Required |
Function Signature
- TypeScript
- Go
- Kotlin
Parameters
The PCZT to verify
The original payments you requested (same as passed to
propose_transaction)Expected change outputs. Use
inspect_pczt to get the actual change amount:Example
- TypeScript
- Go
What Gets Verified
1
Payment Matching
Every payment in your original request must be present in the PCZT with the exact amount and address.
2
Change Verification
If you expect change, it must go to the expected address with the expected amount.
3
No Extra Outputs
The PCZT must not contain any unexpected outputs (malleation check).
Verification Errors
Payment not found in PCZT
Payment not found in PCZT
One of your original payments is missing from the PCZT. The PCZT may have been modified.
Unexpected output
Unexpected output
The PCZT contains an output that wasn’t in your original request. Possible malleation.
Expected change not found
Expected change not found
The change output doesn’t match expectations (wrong address or amount).
Security Considerations
If verification fails:- Do not sign the PCZT
- Discard it and create a new one
- Investigate how the PCZT was modified
Skipping Verification
You can skip verification when:- You created the PCZT yourself
- The PCZT never left your control
- You’re in a development/testing environment

