t2z’s two-step signing process (get_sighash + append_signature) is designed for integration with external signers.
Why External Signing?
- Hardware wallets — Ledger, Trezor, etc.
- HSMs — Hardware Security Modules for enterprise
- Air-gapped systems — Cold storage signing
- Multi-signature — Different parties contribute signatures
The Flow
Implementation
1. Get Sighash
2. Sign Externally
The sighash is a standard 32-byte hash. Sign it with ECDSA secp256k1:
The signature must be DER-encoded with sighash type appended:
4. Append to PCZT
Hardware Wallet Examples
Ledger
Trezor
Air-Gapped Signing
For maximum security, the PCZT can be transferred to an offline machine:
Online Machine
Offline Machine
Online Machine (continued)
Multi-Party Signing
Different parties can sign different inputs:
Security Considerations
Always verify before signing! If the PCZT came from another party, call verify_before_signing to ensure it hasn’t been modified.