ledger

package
v0.3.1-beta-rc2 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2022 License: MIT Imports: 22 Imported by: 0

README

Ledger vault

Configuration

Name Type Description
id string Ledger Device ID. Use first available device if not specified
keys string array Managed key IDs
close_after duration Close device after a certain period of inactivity
Key ID

Syntax: derivation/bip32

Where bip32 is BIP 0032 path and derivation is one of derivation schemes: ed25519, secp256k1, p-256, secp256r1 (alias for p-256), bip25519, bip32-ed25519 (alias for bip25519). bip25519 is a BIP 0032 compliant scheme, others use some sort of a custom hash chain.

Ledger specific root m/44'/1729' may be omitted.

Examples (equivalent): bip32-ed25519/m/44'/1729'/0'/0', bip32-ed25519/44'/1729'/0'/0', bip25519/0'/0'

Example
id: 3944f7a0
keys:
    - "bip25519/0'/0'"
    - "secp256k1/0'/1'"

Command line interface

List all connected Ledgers
signatory-cli ledger list

Example output:

Path:  		IOService:/AppleARMPE/arm-io@10F00000/AppleT810xIO/usb-drd1@2280000/AppleT8103USBXHCI@01000000/usb-drd1-port-hs@01100000/USB2.1 Hub@01100000/AppleUSB20Hub@01100000/AppleUSB20HubPort@01130000/Nano S@01130000/Nano S@0/AppleUserUSBHostHIDDevice
ID:     	tz1Qrqpz6bVUgZc5o5qARHB7j2v57z6knm55 / 3944f7a0
Version:	TezBake 2.2.11 a6fbd27f
Setup baking
signatory-cli ledger setup-baking [--chain-id <chain_id>] [--main-hwm <hwm>] [--test-hwm <hwm>] [-d <device>] <path>

Example:

signatory-cli ledger setup-baking -d 3944f7a0 "bip32-ed25519/44'/1729'/0'/0'"
Reset high water marks
signatory-cli ledger set-high-watermark [-d <device>] <hwm>

Example:

signatory-cli ledger set-high-watermark -d 3944f7a0 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeauthorizeBaking

func DeauthorizeBaking(id string) error

func GetHighWatermark

func GetHighWatermark(id string) (hwm uint32, err error)

func GetHighWatermarks

func GetHighWatermarks(id string) (mainHWM, testHWM uint32, chainID string, err error)

func SetHighWatermark

func SetHighWatermark(id string, hwm uint32) error

func SetupBaking

func SetupBaking(id, keyID, chainID string, mainHWM, testHWM uint32) (pkh string, err error)

Types

type Config

type Config struct {
	ID         string        `yaml:"id"`
	Keys       []string      `yaml:"keys"`
	CloseAfter time.Duration `yaml:"close_after"`
}

Config represents Ledger signer backend configuration

type Vault

type Vault struct {
	// contains filtered or unexported fields
}

Vault is a Ledger signer backend

func New

func New(ctx context.Context, conf *Config) (*Vault, error)

New returns new Ledger signer

func (*Vault) GetPublicKey

func (v *Vault) GetPublicKey(ctx context.Context, id string) (vault.StoredKey, error)

GetPublicKey returns a public key by given ID

func (*Vault) ListPublicKeys

func (v *Vault) ListPublicKeys(ctx context.Context) vault.StoredKeysIterator

ListPublicKeys returns a list of keys stored under the backend

func (*Vault) Name

func (v *Vault) Name() string

Name returns a backend name i.e. Ledger

func (*Vault) Sign

func (v *Vault) Sign(ctx context.Context, digest []byte, key vault.StoredKey) (cryptoutils.Signature, error)

Sign returns a signature

func (*Vault) SignRaw

func (v *Vault) SignRaw(ctx context.Context, data []byte, key vault.StoredKey) (cryptoutils.Signature, error)

SignRaw implements RawSigner interface

func (*Vault) VaultName

func (v *Vault) VaultName() string

VaultName returns an instance ID

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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