Documentation ¶
Index ¶
- Constants
- func Bill() []byte
- func Bills() []byte
- func DoubleShaHash(out, b []byte)
- func GenerateKeyGen() ([]byte, []byte, error)
- func Invoice() []byte
- func Keygen() ([]byte, []byte, []byte)
- func PublicFromPrivate(priv []byte, compressed bool) []byte
- func Rates() []byte
- func RimpHash(out, in []byte)
- func Sin(key []byte) []byte
- func Token() []byte
- type Config
- type PublicKey
Examples ¶
Constants ¶
View Source
const ( MAIN = 0x01 TESTNET = 0x11 EPHEMERAL = 0x02 )
Variables ¶
This section is empty.
Functions ¶
func DoubleShaHash ¶
func DoubleShaHash(out, b []byte)
DoubleShaHash performs 2 sha256 checksums and sets the bytes of dst.
func GenerateKeyGen ¶
Create a new Bitcoin compliant private and public key pair.
func Invoice ¶
func Invoice() []byte
Invoice creates a currency invoice
curl https://bitpay.com/api/invoice \ -u ApiKey \ -d price=10.00 \ -d currency=USD
func PublicFromPrivate ¶
Reference for generating compressed keys github.com/piotrnar/gocoin/blob/master/lib/btc
func RimpHash ¶
func RimpHash(out, in []byte)
RimpHash performs a ripemd160 hash following a sha256 hash returning the ripemd160 checksum.
func Sin ¶
Sin accepts as input hex encoded compressed PublicKey and returns a SIN (Secure Identity Number) Learn more: https://en.bitcoin.it/wiki/Identity_protocol_v1#SIN_record
Example ¶
txt := make([]byte, hex.DecodedLen(len(TESTPRIV))) hex.Decode(txt, TESTPRIV) pub := PublicFromPrivate(txt, false) pubcomp := PublicFromPrivate(txt, true) sin := Sin(pubcomp) fmt.Printf("Public: %x\n", string(pub)) fmt.Printf("PubComp: %x\n", string(pubcomp)) fmt.Printf("Sin: %s\n", string(sin))
Output: Public: 04c6072aad509c88edad53756abc01f00f9e3feeb08fd748b4081964bae97e253214b138fb752811e8aa2d1661ecc7a408b27aaa3bdcaee408f52530c61a007953 PubComp: 03c6072aad509c88edad53756abc01f00f9e3feeb08fd748b4081964bae97e2532 Sin: TfFabGCCATnbxfYRYfkCjM1RDC64aZfRJAu
Types ¶
Click to show internal directories.
Click to hide internal directories.