Documentation ¶
Index ¶
- Constants
- Variables
- func Base58Decode(str string) ([]byte, error)
- func Base58Encode(bz []byte) string
- func Base64Decode(str string) ([]byte, error)
- func Base64Encode(bz []byte) string
- func DeriveBIP44(config *cmp.Config, coinType types.CoinType, ...) (*cmp.Config, error)
- func GenerateChallenge() (challenge protocol.URLEncodedBase64, err error)
- func HexDecode(str string) ([]byte, error)
- func HexEncode(bz []byte) string
- func NewSNRCoins(amt int) sdk.Coins
- func NewUSNRCoins(amt int) sdk.Coins
- type AccountData
- type Algo
- type CoinType
- type EncryptionKey
- type KeyType
- type MPCCmpConfig
- type MPCECDSASignature
- type MPCPool
- type MPCSecp256k1Curve
- type MPCSecp256k1Point
- type PartyID
- type PubKey
- func NewEd25519PubKey(bz []byte) *PubKey
- func NewPubKey(bz []byte, kt KeyType) *PubKey
- func NewPubKeyFromCmpConfig(config *cmp.Config) (*PubKey, error)
- func NewRSAPubKey(bz []byte) *PubKey
- func NewSecp256k1PubKey(pk *secp256k1.PubKey) *PubKey
- func NewWebAuthnPubKey(bz []byte) *PubKey
- func PubKeyFromBytes(bz []byte) (*PubKey, error)
- func PubKeyFromDID(did string) (*PubKey, error)
- type Secp256k1PubKey
Constants ¶
const BTCCoinType = types.CoinType_CoinType_BITCOIN
BTCCoinType is the CoinType for Bitcoin.
const COSMOSCoinType = types.CoinType_CoinType_COSMOS
COSMOSCoinType is the CoinType for Cosmos.
const (
// ChallengeLength - Length of bytes to generate for a challenge
ChallengeLength = 32
)
const DOGECoinType = types.CoinType_CoinType_DOGE
DOGECoinType is the CoinType for Dogecoin.
const ETHCoinType = types.CoinType_CoinType_ETHEREUM
ETHCoinType is the CoinType for Ethereum.
const Ed25519KeyType = types.KeyType_KeyType_ED25519_VERIFICATION_KEY_2018
Ed25519KeyType is the key type for ed25519.
const FILCoinType = types.CoinType_CoinType_FILECOIN
FILECOINCoinType is the CoinType for Filecoin.
const HNSCoinType = types.CoinType_CoinType_HNS
HNSCoinType is the CoinType for Handshake.
const LTCCoinType = types.CoinType_CoinType_LITECOIN
LTCCoinType is the CoinType for Litecoin.
const RSAKeyType = types.KeyType_KeyType_RSA_VERIFICATION_KEY_2018
RSAKeyType is the key type for RSA.
const SOLCoinType = types.CoinType_CoinType_SOLANA
SOLCoinType is the CoinType for Solana.
const SONRCoinType = types.CoinType_CoinType_SONR
SONRCoinType is the CoinType for Sonr.
const Secp256k1KeyType = types.KeyType_KeyType_ECDSA_SECP256K1_VERIFICATION_KEY_2019
Secp256k1KeyType is the key type for secp256k1.
const TestCoinType = types.CoinType_CoinType_TESTNET
TestCoinType is the CoinType for Testnet.
const WebAuthnKeyType = types.KeyType_KeyType_WEB_AUTHN_AUTHENTICATION_2018
WebAuthnKeyType is the key type for WebAuthn.
const XRPCoinType = types.CoinType_CoinType_XRP
XRPCoinType is the CoinType for XRP.
Variables ¶
var AllCoinTypes = types.AllCoinTypes
AllCoinTypes is a slice of all CoinTypes.
Functions ¶
func Base58Decode ¶ added in v0.6.19
Base58Decode takes a base68 encoded string and returns a byte array.
func Base58Encode ¶ added in v0.6.19
Base58Encode takes a byte array and returns a base68 encoded string.
func Base64Decode ¶ added in v0.6.20
Base64Decode takes a base64 encoded string and returns a byte array.
func Base64Encode ¶ added in v0.6.20
Base64Encode takes a byte array and returns a base64 encoded string.
func DeriveBIP44 ¶
func DeriveBIP44(config *cmp.Config, coinType types.CoinType, account, change, addressIndex uint32) (*cmp.Config, error)
This function derives a BIP44 configuration for a specific coin type, account, change, and address index.
func GenerateChallenge ¶ added in v0.7.1
func GenerateChallenge() (challenge protocol.URLEncodedBase64, err error)
GenerateChallenge creates a new challenge that should be signed and returned by the authenticator. The spec recommends using at least 16 bytes with 100 bits of entropy. We use 32 bytes.
func NewSNRCoins ¶ added in v0.7.0
func NewUSNRCoins ¶ added in v0.7.0
Types ¶
type AccountData ¶ added in v0.7.1
type AccountData = crypto.AccountData
AccountData is the data that is returned by the keygen process. It contains the address, the algorithm used to generate the key pair and the public key.
func NewDefaultAccountData ¶ added in v0.7.1
func NewDefaultAccountData(cointype CoinType, publicKey *PubKey) (*AccountData, error)
NewDefaultAccountData creates a new AccountData with the default values.
type Algo ¶ added in v0.7.1
type Algo string
Algorithm is the type of algorithm used for key generation.
type CoinType ¶
CoinType is a type alias for types.CoinType in pkg/crypto/internal/types.
func CoinTypeFromAddrPrefix ¶
CoinTypeFromAddrPrefix returns the CoinType from the public key address prefix (btc, eth).
func CoinTypeFromBipPath ¶
CoinTypeFromBipPath returns the CoinType from the BIP Path (0, 60).
func CoinTypeFromDidMethod ¶
CoinTypeFromDidMethod returns the CoinType from the DID Method (btc, eth).
func CoinTypeFromName ¶
CoinTypeFromName returns the CoinType from the Blockchain name (Bitcoin, Ethereum).
func CoinTypeFromTicker ¶
CoinTypeFromTicker returns the CoinType from the tokens Ticker (BTC, ETH).
type EncryptionKey ¶
type MPCCmpConfig ¶
MPCCmpConfig is a type alias for pool.CmpConfig in pkg/pool.
type MPCECDSASignature ¶
MPCECDSASignature is a type alias for ecdsa.Signature in pkg/ecdsa.
func NewEmptyECDSASecp256k1Signature ¶
func NewEmptyECDSASecp256k1Signature() MPCECDSASignature
NewEmptyECDSASecp256k1Signature creates a new empty MPCECDSASignature.
type MPCPool ¶
MPCPool is a type alias for pool.Pool in pkg/pool.
func NewMPCPool ¶
NewMPCPool creates a new MPCPool with the given size.
type MPCSecp256k1Curve ¶
MPCSecp256k1Curve is a type alias for curve.Secp256k1Point in pkg/math/curve.
type MPCSecp256k1Point ¶
type MPCSecp256k1Point = curve.Secp256k1Point
MPCSecp256k1Point is a type alias for curve.Secp256k1Point in pkg/math/curve.
type PubKey ¶
PubKey is a type alias for types.PubKey in pkg/crypto/internal/types.
func NewEd25519PubKey ¶
NewEd25519PubKey takes a byte array of raw public key bytes and returns a PubKey.
func NewPubKeyFromCmpConfig ¶
NewPubKeyFromCmpConfig takes a `cmp.Config` and returns a `PubKey`
func NewRSAPubKey ¶
NewRSAPubKey takes a byte array of raw public key bytes and returns a PubKey.
func NewSecp256k1PubKey ¶
func NewWebAuthnPubKey ¶
NewWebAuthnPubKey takes a byte array of raw public key bytes and returns a PubKey.
func PubKeyFromBytes ¶
PubKeyFromBytes takes a byte array and returns a PubKey
func PubKeyFromDID ¶
It takes a string of a DID, decodes it from base58, unmarshals it into a PubKey, and returns the PubKey
type Secp256k1PubKey ¶ added in v0.7.1
Secp256k1PubKey is a type alias for secp256k1.PubKey in pkg/crypto/keys/secp256k1.