https://github.com/mixinnetwork/zecutil
Zcash golang signer
https://github.com/mixinnetwork/zecutil
Last synced: 5 months ago
JSON representation
Zcash golang signer
- Host: GitHub
- URL: https://github.com/mixinnetwork/zecutil
- Owner: MixinNetwork
- Fork: true (iqoption/zecutil)
- Created: 2018-08-20T08:17:09.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2025-11-26T05:02:54.000Z (7 months ago)
- Last Synced: 2025-11-29T06:38:04.297Z (7 months ago)
- Language: Go
- Homepage:
- Size: 42 KB
- Stars: 1
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# zecutil
Support [Overwinter](https://z.cash/upgrade/overwinter.html) [Sapling](https://z.cash/upgrade/sapling) network upgrade for Zcash. Not support joinsplits.
```go
zecTx := &zecutil.MsgTx{
MsgTx: newTx,
}
lookupKey := func(a btcutil.Address) (*btcec.PrivateKey, bool, error) {
return privKey, wif.CompressPubKey, nil
}
sigScript, err := zecutil.SignTxOutput(
¶ms,
zecTx,
i,
prevTxScript,
txscript.SigHashAll,
txscript.KeyClosure(lookupKey),
nil,
nil,
amount,
)
if err != nil {
return err
}
txIn.SignatureScript = sigScript
var buf bytes.Buffer
if err = zecTx.BtcEncode(&buf, 0, wire.BaseEncoding); err != nil {
return err
}
fmt.Printf("Tx hex: %x\n", buf.Bytes())
fmt.Printf("Tx Hash: %s\n", zecTx.TxHash().String())
```
-------
Forked from [https://github.com/cpacia/bchutil/](https://github.com/cpacia/bchutil/)