Function Overview
Transaction Construction
| Function | Description |
|---|---|
propose_transaction | Create a PCZT from inputs and payments |
inspect_pczt | Get detailed info about a PCZT |
Signing
| Function | Description |
|---|---|
get_sighash | Get the sighash for external signing |
append_signature | Add a signature to the PCZT |
sign_transparent_input | Sign with an in-memory private key |
Proving & Finalization
| Function | Description |
|---|---|
prove_transaction | Generate Orchard proofs |
verify_before_signing | Verify PCZT matches request |
finalize_and_extract | Extract final transaction |
Utilities
| Function | Description |
|---|---|
parse_pczt | Parse PCZT from bytes |
serialize_pczt | Serialize PCZT to bytes |
prebuild_proving_key | Pre-build the proving key |
is_proving_key_ready | Check if proving key is cached |
generate_test_address | Generate test Orchard address |
generate_test_keypair | Generate test keypair |
version | Get library version |
Naming Conventions
The API uses consistent naming across platforms with language-appropriate conventions:| TypeScript | Go | Kotlin |
|---|---|---|
propose_transaction | ProposeTransaction | proposeTransaction |
get_sighash | GetSighash | getSighash |
WasmTransparentInput | TransparentInput | TransparentInput |
Error Handling
- TypeScript
- Go
- Kotlin
Functions throw
Error on failure:Type Reference
TransparentInput
Represents a transparent UTXO to spend.| Field | Type | Description |
|---|---|---|
pubkey | bytes (33) | Compressed secp256k1 public key |
prevoutTxid | bytes (32) | Transaction ID (little-endian) |
prevoutIndex | uint32 | Output index |
value | uint64 | Value in zatoshis |
scriptPubkey | bytes | P2PKH scriptPubkey |
sequence | uint32? | Sequence number (default: 0xffffffff) |
Payment
Represents a payment output.| Field | Type | Description |
|---|---|---|
address | string | Unified or transparent address |
amount | uint64 | Amount in zatoshis |
memo | bytes? | Memo for shielded outputs (max 512 bytes) |
label | string? | Display label |
ExpectedTxOut
For verification, represents an expected output.| Field | Type | Description |
|---|---|---|
address | string | Expected address |
amount | uint64 | Expected amount in zatoshis |
PcztInfo
Result ofinspect_pczt, contains transaction details.
| Field | Type | Description |
|---|---|---|
expiry_height | uint32 | Transaction expiry block |
transparent_inputs | array | Input details |
transparent_outputs | array | Transparent output details |
orchard_outputs | array | Orchard output details |
total_input | uint64 | Sum of input values |
total_transparent_output | uint64 | Sum of transparent outputs |
total_orchard_output | uint64 | Sum of Orchard outputs |
implied_fee | uint64 | Calculated fee |
num_orchard_actions | uint32 | Number of Orchard actions |
all_inputs_signed | bool | Whether all inputs have signatures |
has_orchard_proofs | bool | Whether proofs are present |

