BOLOS TEE
|
Interface to the main Bitcoin wallet provided to third party applications. More...
Go to the source code of this file.
Macros | |
#define | BLS_WALLET_STATE_INITIALIZED (1 << 0) |
#define | BLS_WALLET_STATE_LOCKED (1 << 1) |
#define | BLS_WALLET_UNLOCK_INAPP (1 << 2) |
#define | BLS_WALLET_DERIVE_PRIVATE (1 << 0) |
#define | BLS_WALLET_DERIVE_PUBLIC (1 << 1) |
Functions | |
int | bls_wallet_get_state (void) |
Return the current state of the Bitcoin wallet. More... | |
int | bls_wallet_derive (uint8_t details, const uint32_t WIDE *path, size_t pathLength, uint8_t *chainCode, bls_ecfp_private_key_t *privateKey, bls_ecfp_public_key_t *publicKey) |
Derive a Bitcoin wallet key using BIP 32. More... | |
int | bls_wallet_get_address (bls_ecfp_public_key_t *publicKey, char WIDE *address, size_t addressLength, bool compressed) |
Get the Bitcoin address associated to a given public key. More... | |
int | bls_wallet_call (uint8_t *apdu) |
Call the Ledger Wallet application. More... | |
int | bls_wallet_approve_sign (bool status) |
Approve a signature before calling the Ledger Wallet application. More... | |
Interface to the main Bitcoin wallet provided to third party applications.
Using this API third party applications can interact with the Bitcoin wallet or common provisioned secrets without revealing them
#define BLS_WALLET_DERIVE_PRIVATE (1 << 0) |
Perform a BIP 32 private derivation
#define BLS_WALLET_DERIVE_PUBLIC (1 << 1) |
Perform a BIP 32 public derivation
#define BLS_WALLET_STATE_INITIALIZED (1 << 0) |
Bitcoin wallet is initialized
#define BLS_WALLET_STATE_LOCKED (1 << 1) |
Bitcoin wallet is locked
#define BLS_WALLET_UNLOCK_INAPP (1 << 2) |
Bitcoin wallet can be unlocked by the application
int bls_wallet_approve_sign | ( | bool | status | ) |
Approve a signature before calling the Ledger Wallet application.
This function call is specific to BOLOS TEE implementation
[in] | status | true to approve the signature, false to reject it |
int bls_wallet_call | ( | uint8_t * | apdu | ) |
Call the Ledger Wallet application.
This function call is specific to BOLOS TEE implementation The Ledger Wallet application is called in a special mode where the Trusted UI is disabled
[in] | apdu | APDU buffer containing the command to send to the Ledger Wallet application This buffer is overwritten by the response |
int bls_wallet_derive | ( | uint8_t | details, |
const uint32_t WIDE * | path, | ||
size_t | pathLength, | ||
uint8_t * | chainCode, | ||
bls_ecfp_private_key_t * | privateKey, | ||
bls_ecfp_public_key_t * | publicKey | ||
) |
Derive a Bitcoin wallet key using BIP 32.
[in] | details | Derivation method, either BLS_WALLET_DERIVE_PUBLIC or BLS_WALLET_DERIVE_PRIVATE |
[in] | path | BIP 32 derivation path encoded as an array of big endian integers |
[in] | pathLength | Number of nodes in the provided BIP 32 derivation path |
[out] | chainCode | Buffer to contain the chain code or NULL |
[out] | privateKey | Pointer to a previously initialized private key to store the derived private key |
[out] | publicKey | Pointer to a previously initialized public key to store the derived public key |
int bls_wallet_get_address | ( | bls_ecfp_public_key_t * | publicKey, |
char WIDE * | address, | ||
size_t | addressLength, | ||
bool | compressed | ||
) |
Get the Bitcoin address associated to a given public key.
[in] | publicKey | Previously initialized Public Key |
[out] | address | Buffer to contain the generated address |
[in] | addressLength | Size of the buffer to contain the generated address |
[in] | compressed | Compute the address for a compressed key if set to true, otherwise compute it for an uncompressed key |
int bls_wallet_get_state | ( | void | ) |
Return the current state of the Bitcoin wallet.