Documentation
¶
Index ¶
- Constants
- Variables
- func CreateEmptyRawTransactionAndHash(vins []Vin, vouts []Vout) (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 SignRawTransaction(hash string, prikey []byte) ([]byte, error)
- func VerifyAndCombineRawTransaction(emptyTrans string, sigPub []SigPub, lockScripts []string) (bool, string, error)
- type Alphabet
- type SigPub
- type TxIn
- type TxOut
- type TxStruct
- type Vin
- type Vout
Constants ¶
View Source
const (
DefaultOutFlag = byte(0)
)
View Source
const DefaultSigType = byte(1) //all
View Source
const DefaultTxFlag = byte(0)
Variables ¶
View Source
var (
BitcoinAlphabet = NewAlphabet("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")
)
Alphabet: copy from https://en.wikipedia.org/wiki/Base58
View Source
var DefaultTxVersion = []byte{0x01, 0x00, 0x00, 0x00}
View Source
var (
ErrorInvalidBase58String = errors.New("invalid base58 string")
)
Errors
View Source
var FixedHashData = []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
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 ¶
func DecodeTxStructRaw ¶
Click to show internal directories.
Click to hide internal directories.