slip10

package module
v0.0.0-...-721109b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 29, 2020 License: MIT Imports: 11 Imported by: 1

Documentation

Overview

ZooBC zoo-slip10

ZooBC is architected by Roberto Capodieci & Barton Johnston

contact us at roberto.capodieci[at]blockchainzoo.com
and barton.johnston[at]blockchainzoo.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Index

Constants

View Source
const (
	// ZoobcAccountPrefix is a prefix for Zoobc key pairs derivation.
	ZoobcAccountPrefix = "m/44'/883'"
	// ZoobcPrimaryAccountPath is a derivation path of the primary account.
	ZoobcPrimaryAccountPath = "m/44'/883'/0'"
	// ZoobcAccountPathFormat is a path format used for Zoobc key pair
	// derivation as described in SEP-00XX. Use with `fmt.Sprintf` and `DeriveForPath`.
	ZoobcAccountPathFormat = "m/44'/883'/%d'"
	// FirstHardenedIndex is the index of the first hardened key.
	FirstHardenedIndex = uint32(0x80000000)

	DefaultPassword = ""
)

Variables

View Source
var (
	ErrInvalidPath        = errors.New("invalid derivation path")
	ErrNoPublicDerivation = errors.New("no public derivation for ed25519")
)

Functions

func NewSeed

func NewSeed(mnemonic, password string) []byte

Types

type Key

type Key struct {
	Key       []byte
	ChainCode []byte
}

func DeriveForPath

func DeriveForPath(path string, seed []byte) (*Key, error)

DeriveForPath derives key for a path in BIP-44 format and a seed. Ed25119 derivation operated on hardened keys only.

func NewMasterKey

func NewMasterKey(seed []byte) (*Key, error)

NewMasterKey generates a new master key from seed.

func (*Key) Derive

func (k *Key) Derive(i uint32) (*Key, error)

func (*Key) PublicKey

func (k *Key) PublicKey() ([]byte, error)

PublicKey returns public key for a derived private key.

func (*Key) RawSeed

func (k *Key) RawSeed() [32]byte

RawSeed returns raw seed bytes

func (*Key) Serialize

func (k *Key) Serialize() string

func (*Key) Sign

func (k *Key) Sign(payload []byte) []byte

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL