@@ -68,6 +68,29 @@ wasm-utxo-cli address encode 0014e8df018c7e326cc253faac7e46cdc51e68542c42
6868# Output: bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq
6969```
7070
71+ #### Derive an address from a descriptor
72+
73+ ``` bash
74+ wasm-utxo-cli address from-descriptor < DESCRIPTOR> --network < NETWORK>
75+ ```
76+
77+ The descriptor may name a plain public key or embed a private key directly (e.g. a WIF) —
78+ either way, the resulting address is derived from the corresponding public key. Works for any
79+ network, not just Bitcoin.
80+
81+ ** Examples:**
82+
83+ ``` bash
84+ # BTC: derive a P2PKH address from a public key
85+ wasm-utxo-cli address from-descriptor " pkh(039ab0771c5f88913208a26f81ab8223e98d25176e4648a5a2bb8ff79cf1c5198b)" --network btc
86+ # Output: 1GwwqAWsJzDHMZ9ceJqrJDfch4gsro4c3x
87+
88+ # Zcash: derive a t-address directly from a WIF private key (e.g. for zebrad's miner_address on
89+ # regtest — Zcash regtest reuses testnet address prefixes, so pass --network tzec)
90+ wasm-utxo-cli address from-descriptor " pkh(KzEGYtKcbhYwUWcZygbsqmF31f3iV7HC3iUQug7MBecwCz9hm1Tv)" --network tzec
91+ # Output: tmRfJALRQfyWP6SPxFTxiHhSHYhxn7rwkLv
92+ ```
93+
7194### PSBT Operations
7295
7396#### Parse and inspect a PSBT
@@ -102,6 +125,54 @@ The output displays a hierarchical tree view of the PSBT structure, including:
102125- Per-output fields (scripts, derivation paths)
103126- Decoded transaction details
104127
128+ #### Build and sign a transparent transaction
129+
130+ Four composable subcommands — ` create ` , ` add-input ` , ` add-output ` , ` sign ` — each read a PSBT
131+ from a file or stdin (` - ` ) and print the result as hex, so they pipe together into a full
132+ build-and-sign flow for a single-key transparent (non-segwit) transaction. Works for any
133+ network; the sighash algorithm used by ` sign ` (plain, FORKID, or Zcash ZIP-243) is selected by
134+ ` --network ` .
135+
136+ ``` bash
137+ wasm-utxo-cli psbt create [--version < VERSION> ] [--lock-time < LOCK_TIME> ]
138+ wasm-utxo-cli psbt add-input < PATH> --network < NETWORK> --txid < TXID> --vout < VOUT> \
139+ --value < VALUE> --script < SCRIPT_HEX> --descriptor < DESCRIPTOR> [--prev-tx < PREV_TX_HEX> ]
140+ wasm-utxo-cli psbt add-output < PATH> (--address < ADDRESS> --network < NETWORK> | --script < SCRIPT_HEX> ) --value < VALUE>
141+ wasm-utxo-cli psbt sign < PATH> --network < NETWORK> --privkey < PRIVKEY> [--consensus-branch-id < ID> ]
142+ ```
143+
144+ ` add-input ` requires ` --prev-tx ` (the full previous transaction, hex-encoded) unless
145+ ` --network ` is a value-committing network (Zcash, BCH family) whose sighash already commits the
146+ spent amount — see ` Network::requires_prev_tx_for_legacy_input ` in the ` wasm-utxo ` library.
147+
148+ ** Examples:**
149+
150+ ``` bash
151+ # BTC: spend a P2PKH coinbase-style output, providing the full previous transaction
152+ wasm-utxo-cli psbt create \
153+ | wasm-utxo-cli psbt add-input - --network btc \
154+ --txid e6a6e7f5551af932bc3813d920c52d61ec39fbad2e5585a018cce7dcbdd4ec72 --vout 0 \
155+ --value 50000000 --script 76a914aeee1e6ae364e64b1b36acd53df55bd8d750485888ac \
156+ --descriptor " pkh(039ab0771c5f88913208a26f81ab8223e98d25176e4648a5a2bb8ff79cf1c5198b)" \
157+ --prev-tx 010000000100000000000000000000000000000000000000000000000000000000000000000000000000ffffffff0180f0fa02000000001976a914aeee1e6ae364e64b1b36acd53df55bd8d750485888ac00000000 \
158+ | wasm-utxo-cli psbt add-output - --script 76a914aeee1e6ae364e64b1b36acd53df55bd8d750485888ac --value 49990000 \
159+ | wasm-utxo-cli psbt sign - --network btc --privkey KzEGYtKcbhYwUWcZygbsqmF31f3iV7HC3iUQug7MBecwCz9hm1Tv
160+ # Output: a plain-sighash signed BTC transaction, hex-encoded
161+
162+ # Zcash: spend a transparent P2PKH coinbase output for regtest fixture generation
163+ # (e.g. for a zebrad-mined UTXO to broadcast via sendrawtransaction). No --prev-tx needed —
164+ # ZIP-243 sighash commits the input amount.
165+ wasm-utxo-cli psbt create --lock-time 0 \
166+ | wasm-utxo-cli psbt add-input - --network tzec \
167+ --txid a8c685478265f4c14dada651969c45a65e1aeb8cd6791f2f5bb6a1d9952104d9 --vout 0 \
168+ --value 50000000 --script 76a914aeee1e6ae364e64b1b36acd53df55bd8d750485888ac \
169+ --descriptor " pkh(039ab0771c5f88913208a26f81ab8223e98d25176e4648a5a2bb8ff79cf1c5198b)" \
170+ | wasm-utxo-cli psbt add-output - --script 76a914aeee1e6ae364e64b1b36acd53df55bd8d750485888ac --value 49990000 \
171+ | wasm-utxo-cli psbt sign - --network tzec --privkey KzEGYtKcbhYwUWcZygbsqmF31f3iV7HC3iUQug7MBecwCz9hm1Tv \
172+ --consensus-branch-id 0xc2d6d0b4
173+ # Output: a signed Zcash overwintered (NU5) transaction, hex-encoded
174+ ```
175+
105176### Supported Networks
106177
107178The CLI supports the following networks (use with ` --network ` flag):
0 commit comments