tezosapp

package
v1.1.7 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AppTezos   = 0
	AppTezBake = 1
)

Tezos application types

View Source
const BIP32H = (1 << 31)

BIP32H bit mask is set for so called hardened derivation

Variables

View Source
var TezosBIP32Root = BIP32{44 | BIP32H, 1729 | BIP32H}

TezosBIP32Root is a Tezos BIP32 root key path i.e. 44'/1729'

Functions

This section is empty.

Types

type App

type App struct {
	ledger.Exchanger
}

App represents Tezos application client

func (*App) DeauthorizeBaking

func (t *App) DeauthorizeBaking() error

func (*App) GetHighWatermark

func (t *App) GetHighWatermark() (uint32, error)

func (*App) GetHighWatermarks

func (t *App) GetHighWatermarks() (*HWM, error)

func (*App) GetPublicKey

func (t *App) GetPublicKey(derivation DerivationType, path BIP32, prompt bool) (pub crypt.PublicKey, err error)

GetPublicKey returns a public key for a newly derived pair

func (*App) GetVersion

func (t *App) GetVersion() (*Version, error)

GetVersion returns Tezos app version

func (*App) SetHighWatermark

func (t *App) SetHighWatermark(hwm uint32) error

func (*App) SetupBaking

func (t *App) SetupBaking(hwm *HWM, derivation DerivationType, path BIP32) (pub crypt.PublicKey, err error)

func (*App) Sign

func (t *App) Sign(derivation DerivationType, path BIP32, data []byte) (sig crypt.Signature, err error)

Sign signs the message or precalculated hash

type BIP32

type BIP32 []uint32

BIP32 represents BIP32 path

func BIP32FromBytes

func BIP32FromBytes(data []byte) BIP32

BIP32FromBytes parses serialized BIP32 into a binary representation

func ParseBIP32

func ParseBIP32(src string) BIP32

ParseBIP32 parses BIP32 string into a binary representation

func (BIP32) Bytes

func (b BIP32) Bytes() []byte

Bytes returns serialized version of the BIP32 derivation path

func (BIP32) String

func (b BIP32) String() string

String returns string representation of the BIP32 derivation path

type DerivationType

type DerivationType uint8

DerivationType represents key derivation method and determines the curve to use

const (
	DerivationED25519      DerivationType = iota                // ED25519
	DerivationSECP256K1                                         // SECP256K1
	DerivationSECP256R1                                         // SECP256R1 aka P256
	DerivationBIP32ED25519                                      // BIP32-ED25519
	DerivationP256                        = DerivationSECP256R1 // SECP256R1 aka P256
	DerivationInvalid      DerivationType = 0xff
)

func DerivationTypeFromString

func DerivationTypeFromString(str string) (DerivationType, error)

DerivationTypeFromString returns a derivation type id for specified name

func (DerivationType) String

func (d DerivationType) String() string

type HWM

type HWM struct {
	ChainID [4]byte
	Main    uint32
	Test    uint32
}

type TezosError

type TezosError uint16

TezosError represents the Tezos specific subset of APDU status codes

func (TezosError) Error

func (l TezosError) Error() string

type Version

type Version struct {
	AppClass uint8
	Major    uint8
	Minor    uint8
	Patch    uint8
	Git      string
}

Version contains Tezos app version

func (*Version) String

func (v *Version) String() string

Jump to

Keyboard shortcuts

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