https://github.com/karpeleslab/zanolib
Zano offline transaction signature in Go
https://github.com/karpeleslab/zanolib
Last synced: about 1 month ago
JSON representation
Zano offline transaction signature in Go
- Host: GitHub
- URL: https://github.com/karpeleslab/zanolib
- Owner: KarpelesLab
- License: mit
- Created: 2025-03-02T02:35:56.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2026-03-24T14:21:02.000Z (3 months ago)
- Last Synced: 2026-04-04T05:39:29.575Z (2 months ago)
- Language: Go
- Homepage:
- Size: 638 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://godoc.org/github.com/KarpelesLab/zanolib)
[](https://goreportcard.com/report/github.com/KarpelesLab/zanolib)
[](https://github.com/KarpelesLab/zanolib/actions/workflows/test.yml)
# zanolib
Go library for [Zano](https://zano.org/) cryptocurrency operations, including address parsing, offline transaction signing, and zero-knowledge proof generation.
## Features
- **Address handling** — parse, create, and manipulate Zano addresses (standard, integrated, auditable)
- **Offline transaction signing** — sign transactions generated by a view-only simplewallet without exposing the spend key to the network
- **Cryptographic primitives** — CLSAG-GGX ring signatures, Bulletproof+ range proofs, BGE asset surjection proofs, balance proofs
- **Serialization** — full EPEE binary serialization compatible with Zano's C++ implementation
## Install
```
go get github.com/KarpelesLab/zanolib
```
## Offline Signatures
Compatible Zano version: **2.1.0.382**
This library allows loading unsigned transactions produced by a view-only simplewallet and signing them offline. There are a few caveats:
- The unsigned transaction is a binary format **not** meant to be portable — it only works between specific versions of Zano. This library is tested against the version above and may not work with newer versions. Blob files aren't versioned so structure changes cannot be detected automatically.
- For now this library only supports ZC→ZC transactions.
### Usage
```go
import (
"crypto/rand"
"os"
"github.com/KarpelesLab/zanolib"
)
// Initialize a wallet from a securely stored spend secret.
// Set flags to 1 for auditable wallets.
wallet, err := zanolib.LoadSpendSecret(secret, 0)
if err != nil {
// handle error
}
// Parse the unsigned transaction produced by simplewallet.
ftp, err := wallet.ParseFTP(unsignedTxBlob)
if err != nil {
// handle error
}
// Inspect ftp to verify this is the transaction you want to sign.
// ...
// Sign the transaction.
finalized, err := wallet.Sign(rand.Reader, ftp, nil)
if err != nil {
// handle error
}
// Encrypt and write to disk for broadcast via the view-only wallet.
signed, err := wallet.Encrypt(finalized)
if err != nil {
// handle error
}
os.WriteFile("zano_tx_signed", signed, 0600)
```
## License
See [LICENSE](LICENSE) file.