Documentation
¶
Index ¶
- Constants
- func Base58Decode(b, alphabet string) ([]byte, error)
- func Base58Encode(b []byte, alphabet string) string
- func DoubleSha256(b []byte) ([]byte, error)
- func ParsePublicKey(b []byte) (*btcec.PublicKey, error)
- func ParsePublicKeyFromHash(hash []byte) (*btcec.PublicKey, error)
- func Sha256RipeMD160(b []byte) ([]byte, error)
- func Sha512Half(b []byte) ([]byte, error)
- func Sha512Quarter(b []byte) ([]byte, error)
- func Verify(pubKey, signature, hash []byte) (bool, error)
- type AccountKey
- type Hash
- func GenerateFamilySeed(password string) (Hash, error)
- func NewBitcoinAddress(b []byte) (Hash, error)
- func NewLitecoinAddress(b []byte) (Hash, error)
- func NewRippleAccount(b []byte) (Hash, error)
- func NewRippleFamilyGenerator(b []byte) (Hash, error)
- func NewRippleFamilySeed(b []byte) (Hash, error)
- func NewRippleHash(s string) (Hash, error)
- func NewRippleHashCheck(s string, version HashVersion) (Hash, error)
- func NewRipplePrivateAccount(b []byte) (Hash, error)
- func NewRipplePrivateNode(b []byte) (Hash, error)
- func NewRipplePublicAccount(b []byte) (Hash, error)
- func NewRipplePublicNode(b []byte) (Hash, error)
- type HashNetwork
- type HashVersion
- type Key
- type ProofOfWork
- type RootDeterministicKey
- func (r *RootDeterministicKey) GenerateAccountId(sequence int32) (Hash, error)
- func (r *RootDeterministicKey) GenerateAccountKey(sequence int32) (*AccountKey, error)
- func (k *RootDeterministicKey) PrivateBytes() []byte
- func (r *RootDeterministicKey) PrivateNodeKey() (Hash, error)
- func (k *RootDeterministicKey) PublicCompressed() []byte
- func (r *RootDeterministicKey) PublicGenerator() (Hash, error)
- func (r *RootDeterministicKey) PublicNodeKey() (Hash, error)
- func (k *RootDeterministicKey) Sign(hash []byte) ([]byte, error)
Constants ¶
View Source
const ( ACCOUNT_ZERO = "rrrrrrrrrrrrrrrrrrrrrhoLvTp" ACCOUNT_ONE = "rrrrrrrrrrrrrrrrrrrrBZbvji" NaN = "rrrrrrrrrrrrrrrrrrrn5RM1rHd" ROOT = "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh" )
Variables ¶
This section is empty.
Functions ¶
func Base58Decode ¶
Base58Decode decodes a modified base58 string to a byte slice and checks checksum.
func Base58Encode ¶
Base58Encode encodes a byte slice to a modified base58 string.
func DoubleSha256 ¶
func Sha256RipeMD160 ¶
func Sha512Half ¶
Returns first 32 bytes of a SHA512 of the input bytes
func Sha512Quarter ¶
Returns first 16 bytes of a SHA512 of the input bytes
Types ¶
type AccountKey ¶
type AccountKey struct {
// contains filtered or unexported fields
}
func (*AccountKey) PrivateAccountKey ¶
func (a *AccountKey) PrivateAccountKey() (Hash, error)
func (*AccountKey) PrivateBytes ¶
func (k *AccountKey) PrivateBytes() []byte
func (*AccountKey) PublicAccountKey ¶
func (a *AccountKey) PublicAccountKey() (Hash, error)
func (*AccountKey) PublicCompressed ¶
func (k *AccountKey) PublicCompressed() []byte
type Hash ¶
type Hash interface {
Network() HashNetwork
Version() HashVersion
Payload() []byte
PayloadTrimmed() []byte
Value() *big.Int
String() string
Clone() Hash
MarshalText() ([]byte, error)
}
func GenerateFamilySeed ¶
func NewBitcoinAddress ¶
func NewLitecoinAddress ¶
func NewRippleAccount ¶
func NewRippleFamilySeed ¶
func NewRippleHash ¶
func NewRippleHashCheck ¶
func NewRippleHashCheck(s string, version HashVersion) (Hash, error)
Checks hash matches expected version
func NewRipplePrivateAccount ¶
func NewRipplePrivateNode ¶
func NewRipplePublicAccount ¶
func NewRipplePublicNode ¶
type HashNetwork ¶
type HashNetwork byte
const ( RIPPLE HashNetwork = 0 BITCOIN HashNetwork = 1 LITECOIN HashNetwork = 2 )
type HashVersion ¶
type HashVersion byte
const ( RIPPLE_NODE_PUBLIC HashVersion = 28 RIPPLE_NODE_PRIVATE HashVersion = 32 RIPPLE_ACCOUNT_ID HashVersion = 0 RIPPLE_ACCOUNT_PUBLIC HashVersion = 35 RIPPLE_ACCOUNT_PRIVATE HashVersion = 34 RIPPLE_FAMILY_GENERATOR HashVersion = 41 RIPPLE_FAMILY_SEED HashVersion = 33 BITCOIN_ADDRESS HashVersion = 0 LITECOIN_ADDRESS HashVersion = 48 )
type ProofOfWork ¶
type ProofOfWork struct {
Challenge *big.Int
Target *big.Int
Iterations int
// contains filtered or unexported fields
}
func NewProofOfWork ¶
func NewProofOfWork(challenge, target []byte, iterations uint32) *ProofOfWork
func (*ProofOfWork) Solve ¶
func (pow *ProofOfWork) Solve() ([]byte, error)
type RootDeterministicKey ¶
type RootDeterministicKey struct {
Seed Hash
// contains filtered or unexported fields
}
func GenerateRootDeterministicKey ¶
func GenerateRootDeterministicKey(seed []byte) (*RootDeterministicKey, error)
If seed is nil, generate a random one
func (*RootDeterministicKey) GenerateAccountId ¶
func (r *RootDeterministicKey) GenerateAccountId(sequence int32) (Hash, error)
func (*RootDeterministicKey) GenerateAccountKey ¶
func (r *RootDeterministicKey) GenerateAccountKey(sequence int32) (*AccountKey, error)
func (*RootDeterministicKey) PrivateBytes ¶
func (k *RootDeterministicKey) PrivateBytes() []byte
func (*RootDeterministicKey) PrivateNodeKey ¶
func (r *RootDeterministicKey) PrivateNodeKey() (Hash, error)
func (*RootDeterministicKey) PublicCompressed ¶
func (k *RootDeterministicKey) PublicCompressed() []byte
func (*RootDeterministicKey) PublicGenerator ¶
func (r *RootDeterministicKey) PublicGenerator() (Hash, error)
func (*RootDeterministicKey) PublicNodeKey ¶
func (r *RootDeterministicKey) PublicNodeKey() (Hash, error)
Click to show internal directories.
Click to hide internal directories.