Documentation ¶
Index ¶
- Constants
- Variables
- func CreateEmptyTransactionAndHash(vin []Vin, vout []Vout, lockTime uint32) (string, []string, error)
- func Decode(input string, alphabet *Alphabet) ([]byte, error)
- func DecodeCheck(address string) (byte, []byte, error)
- func Encode(input []byte, alphabet *Alphabet) string
- func EncodeCheck(prefix byte, hash []byte) string
- func SignTransaction(hash string, prikey []byte) ([]byte, error)
- func VerifyAndCombineTransaction(emptyTrans string, sigPubs []SigPub) (bool, string, error)
- type Alphabet
- type SigPub
- type TxIn
- type TxOut
- type TxStruct
- type Vin
- type Vout
Constants ¶
View Source
const DefaultSigType = byte(1) //all
Variables ¶
View Source
var ( CurveOrder = []byte{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xBA, 0xAE, 0xDC, 0xE6, 0xAF, 0x48, 0xA0, 0x3B, 0xBF, 0xD2, 0x5E, 0x8C, 0xD0, 0x36, 0x41, 0x41} HalfCurveOrder = []byte{0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x5D, 0x57, 0x6E, 0x73, 0x57, 0xA4, 0x50, 0x1D, 0xDF, 0xE9, 0x2F, 0x46, 0x68, 0x1B, 0x20, 0xA0} )
View Source
var (
BitcoinAlphabet = NewAlphabet("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")
)
Alphabet: copy from https://en.wikipedia.org/wiki/Base58
View Source
var DefaultSigTypeBytes = []byte{0x01, 0x00, 0x00, 0x00}
View Source
var DefaultTxVersion = []byte{0x01, 0x00, 0x00, 0x00}
View Source
var (
ErrorInvalidBase58String = errors.New("invalid base58 string")
)
Errors
Functions ¶
func DecodeCheck ¶
return prefix + hash + error
func EncodeCheck ¶
Types ¶
type Alphabet ¶
type Alphabet struct {
// contains filtered or unexported fields
}
Alphabet The base58 alphabet object.
func NewAlphabet ¶
NewAlphabet create a custom alphabet from 58-length string. Note: len(rune(alphabet)) must be 58.
type TxStruct ¶
Click to show internal directories.
Click to hide internal directories.