derivation

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: May 19, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AlgorithmECDSA = "ecdsa"
	AlgorithmEdDSA = "eddsa"

	CurveSecp256k1 = "secp256k1"
	CurveEd25519   = "ed25519"

	DerivationSchemeBIP32Secp256k1 = "bip32_secp256k1"
	DerivationSchemeBIP32Public    = "bip32_public"
	DerivationSchemeSLIP10Ed25519  = "slip10_ed25519"

	PublicKeyFormatUncompressedHex = "uncompressed_hex"
)

Variables

View Source
var (
	ErrDerivationContextRequired   = errors.New("derivation context required")
	ErrInvalidDerivationContext    = errors.New("invalid derivation context")
	ErrUnsupportedDerivationScheme = errors.New("unsupported derivation scheme")
	ErrDerivationPathInvalid       = errors.New("derivation path invalid")
	ErrDerivationContextMismatch   = errors.New("derivation context mismatch")
	ErrChainCodeMissing            = errors.New("chain code missing")
	ErrChainCodeInvalid            = errors.New("chain code invalid")
	ErrDerivedSigningUnsupported   = errors.New("derived signing unsupported")
	ErrUnsupportedAlgorithmCurve   = errors.New("unsupported algorithm curve")
)

Functions

func CanonicalFullPath

func CanonicalFullPath(accountPath, childPath string) string

func CanonicalHashPayloadV1

func CanonicalHashPayloadV1(in Context) ([]byte, error)

func DecodeUncompressedSecp256k1Hex

func DecodeUncompressedSecp256k1Hex(input string) (*tsscrypto.ECPoint, error)

func EncodeECPointUncompressedSecp256k1

func EncodeECPointUncompressedSecp256k1(point *tsscrypto.ECPoint) (string, error)

func EncodeUncompressedSecp256k1

func EncodeUncompressedSecp256k1(pub *ecdsa.PublicKey) string

func HashV1

func HashV1(in Context) (string, error)

func IsECDSAAlgorithm

func IsECDSAAlgorithm(algorithm string) bool

func MatchSession

func MatchSession(ctx Context, session Session) error

func NormalizeAccountPath

func NormalizeAccountPath(raw string) (string, error)

func NormalizeChildPath

func NormalizeChildPath(raw string) (string, []uint32, error)

func NormalizeFullPath

func NormalizeFullPath(raw string) (string, error)

func ParseChainCodeHex

func ParseChainCodeHex(input string) ([]byte, error)

func ParseChildPath

func ParseChildPath(raw string) ([]uint32, error)

func ValidateDKGMaterial

func ValidateDKGMaterial(algorithm string, material DKGMaterial) ([]byte, string, error)

func ValidateUncompressedSecp256k1Hex

func ValidateUncompressedSecp256k1Hex(input string) error

Types

type Context

type Context struct {
	ProfileID         string
	ProfileTemplateID string
	Chain             string
	Algorithm         string
	Curve             string
	Scheme            string
	PublicKeyFormat   string
	AccountPath       string
	ChildPath         string
	FullPath          string
	AddressEncoding   string
	ExpectedAddress   string
	DerivedPublicKey  string
	Descriptor        string
	DescriptorVersion uint32
	ProfileVersion    uint32
	KeyVersion        uint32
}

func NormalizeContext

func NormalizeContext(in Context) (Context, error)

type DKGMaterial

type DKGMaterial struct {
	ChainCode        string
	DerivationScheme string
}

type ECDSAChildKey

type ECDSAChildKey struct {
	PublicKey          *ecdsa.PublicKey
	PublicKeyHex       string
	KeyDerivationDelta *big.Int
}

func DeriveECDSAChildKey

func DeriveECDSAChildKey(accountPub *crypto.ECPoint, chainCode []byte, indices []uint32) (ECDSAChildKey, error)

func DeriveECDSAChildKeyForContext

func DeriveECDSAChildKeyForContext(accountPub *crypto.ECPoint, chainCode []byte, ctx Context) (ECDSAChildKey, error)

type PreparedECDSASigningShare

type PreparedECDSASigningShare struct {
	Share              ecdsakeygen.LocalPartySaveData
	DerivedPublicKey   string
	KeyDerivationDelta *big.Int
}

func PrepareECDSASigningShare

func PrepareECDSASigningShare(share ecdsakeygen.LocalPartySaveData, chainCode []byte, ctx Context) (PreparedECDSASigningShare, error)

type Session

type Session struct {
	Algorithm string
	Curve     string
	Chain     string
}

Jump to

Keyboard shortcuts

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