Skip to content

iqoption/zecutil

Repository files navigation

zecutil

Zcash Utilities

Contains the zcash signing algorithm and some protocol configuration. Forked from https://github.com/cpacia/bchutil/

Supports

  • Overwinter network upgrade for Zcash. Not support joinsplits.
  • Sapling network upgrade for Zcash.

Example

zecTx := &zecutil.MsgTx{
    MsgTx:        newTx,
    ExpiryHeight: 215039,
}

lookupKey := func(a btcutil.Address) (*btcec.PrivateKey, bool, error) {
    return privKey, wif.CompressPubKey, nil
}
sigScript, err := zecutil.SignTxOutput(
    &params,
    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())

About

Zcash Golang Signer

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages