Documentation
¶
Index ¶
- func DecodeBase32(base32Str string) ([]byte, error)
- func EncodeBase32(data []byte) string
- func GenerateMacKey(combinedParts []byte, hashedPasskey []byte) ([]byte, []byte, error)
- func Recovery(message []byte, requiredParticipants []string, quorum int, ...) ([]byte, error)
- func VerifyBase32Passkey(base32Passkey string) (bool, []byte, []byte, error)
- func VerifyChainCode(decodepasskey []byte, macKey []byte) (bool, error)
- type WalletConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeBase32 ¶
DecodeBase32 decodes a Base32 string into a byte slice
func EncodeBase32 ¶
EncodeBase32 encodes a byte slice into a Base32 string without padding
func GenerateMacKey ¶
GenerateMacKeyAndChainCode generates the MacKey (root hash) and chain code It stores both the MacKey and chain code in memory for future use.
func Recovery ¶
func Recovery(message []byte, requiredParticipants []string, quorum int, passkey, passphrase string) ([]byte, error)
Recovery is a utility function to recover a wallet's key using a multi-signature scheme. It takes in the following parameters: - message: The message or data to be signed for the recovery process - requiredParticipants: List of participants whose signatures are required for recovery - quorum: The minimum number of signatures needed to successfully recover the wallet - passkey: A base32 encoded passkey used for authentication - passphrase: A passphrase used to further verify the user's identity (along with passkey)
The function will return a recovery proof (e.g., a multi-signature wallet key) if successful, or an error if the recovery fails.
func VerifyBase32Passkey ¶
VerifyBase32Passkey verifies the MacKey and checks the chain code in memory If the MacKey and chain code are found, it prints the MacKey.
Types ¶
type WalletConfig ¶
type WalletConfig struct {
// contains filtered or unexported fields
}
WalletConfig handles the storage and retrieval of keys in the keystore directory.
func NewWalletConfig ¶
func NewWalletConfig() (*WalletConfig, error)
NewWalletConfig initializes a new WalletConfig with a LevelDB instance for key storage.
func (*WalletConfig) Close ¶
func (config *WalletConfig) Close()
Close closes the LevelDB database when done.
func (*WalletConfig) LoadKeyPair ¶
func (config *WalletConfig) LoadKeyPair() ([]byte, []byte, error)
LoadKeyPair retrieves the combined data and splits it back into SK and PK.
func (*WalletConfig) SaveKeyPair ¶
func (config *WalletConfig) SaveKeyPair(combinedData []byte, pk []byte) error
SaveKeyPair saves the combined encrypted data in LevelDB and as a .dat file