https://github.com/kulpreet/txref
Go implementation for TxRef BIP 136
https://github.com/kulpreet/txref
bip136 bitcoin golang txref
Last synced: about 2 months ago
JSON representation
Go implementation for TxRef BIP 136
- Host: GitHub
- URL: https://github.com/kulpreet/txref
- Owner: kulpreet
- Created: 2018-07-02T08:21:57.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-07-19T10:58:51.000Z (almost 8 years ago)
- Last Synced: 2025-03-26T14:26:56.640Z (over 1 year ago)
- Topics: bip136, bitcoin, golang, txref
- Language: Go
- Size: 23.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Confirmed Transaction Reference Codes
[](https://travis-ci.org/kulpreet/txref)
Porting Jonas Schnelli's reference C implementation to Go
## Usage
```golang
import (
"fmt"
"github.com/kulpreet/txref"
)
/* ENCODE */
var encoded_txref = string
const hrp string = "tx" //mainnet
// now encode for height 100 and pos 100
encoded_txref, err := txref.Encode(hrp, txref.Txref_magic_btc_mainnet, 100, 100, false)
fmt.Printf("Encoded txref is %s\n", encoded_txref)
/* DECODE */
decoded, magic, height, position, err := txref.Decode(encoded_txref)
```
## Install
`go get -u github.com/kulpreet/txref`