Giter Club home page Giter Club logo

bchutil's Introduction

bchutil

Bitcoin Cash Utilities

Contains the bitcoin cash signing algorithm and some protocol configuration. This package removes the need to use a fork of btcd when working with Bitcoin Cash.

bchutil's People

Contributors

cpacia avatar deswurstes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

bchutil's Issues

code examples?

First off, thanks for sharing this.

I'm trying to figure out how to use it exactly, any help hugely appreciated if you have time

Cashaddr error

Is this normal:

hash160, _, err := base58.CheckDecode("1F1tAaz5x1HUXrCNLbtMDqcw6o5GNn4xqX")
a, b := bchutil.NewBitpayAddressPubKeyHash(hash160, &chaincfg.MainNetParams)
if b != nil {
	fmt.Println("%v", err)
	os.Exit(1)
}
fmt.Println(a.EncodeAddress())

prints

CWUmjdL9q4G1Rz6o2MDGoMExivHgEnCgDx

hash160, _, err := base58.CheckDecode("1F1tAaz5x1HUXrCNLbtMDqcw6o5GNn4xqX")
a, b := bchutil.NewCashAddressPubKeyHash(hash160, &chaincfg.MainNetParams)
if b != nil {
	fmt.Println("%v", err)
	os.Exit(1)
}
fmt.Println(a.EncodeAddress())

prints

panic: runtime error: index out of range

goroutine 1 [running]:
github.com/cpacia/bchutil.Encode(0x11494c8, 0xb, 0xc420014760, 0x15, 0x20, 0xc420014760, 0x1)
	/Users/j/go/src/github.com/cpacia/bchutil/cashaddr.go:248 +0x23a
github.com/cpacia/bchutil.CheckEncode(0xc420403f48, 0x14, 0x14, 0x11494c8, 0xb, 0x0, 0xc420014740, 0x0)
	/Users/j/go/src/github.com/cpacia/bchutil/cashaddr.go:342 +0xc9
github.com/cpacia/bchutil.encodeAddress(0xc420403f48, 0x14, 0x14, 0x11494c8, 0xb, 0x0, 0xc420096120, 0xc420014740)
	/Users/j/go/src/github.com/cpacia/bchutil/cashaddr.go:366 +0x62
github.com/cpacia/bchutil.(*CashAddressPubKeyHash).EncodeAddress(0xc420403f48, 0xc420014740, 0x14)
	/Users/j/go/src/github.com/cpacia/bchutil/cashaddr.go:440 +0x58
main.main()
	/Users/j/go/src/github.com/DesWurstes/Cashaddr/main.go:44 +0x188

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.