Skip to main content
The 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

Function Signature

Parameters

pczt
Pczt
required
The PCZT to verify
payments
Payment[]
required
The original payments you requested (same as passed to propose_transaction)
expected_change
ExpectedTxOut[]
required
Expected change outputs. Use inspect_pczt to get the actual change amount:

Example

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

One of your original payments is missing from the PCZT. The PCZT may have been modified.
The PCZT contains an output that wasn’t in your original request. Possible malleation.
The change output doesn’t match expectations (wrong address or amount).

Security Considerations

Never sign a PCZT that fails verification. A malicious party could have:
  • Changed the recipient address
  • Modified the amounts
  • Added extra outputs to steal funds
If verification fails:
  1. Do not sign the PCZT
  2. Discard it and create a new one
  3. 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

Next Step

After verification passes (or is skipped), proceed to signing the transparent inputs.