Offline Transaction Signing (OTS) 0.1.0
|
Header for the C ABI (Application Binary Interface) library. More...
Go to the source code of this file.
Classes | |
struct | ots_handle_t |
Handle structure for C objects. More... | |
struct | ots_error_t |
Error structure for exception handling. More... | |
struct | ots_result_t |
Result structure combining handle and error. More... | |
struct | ots_wipeable_string_t |
Wipeable string for sensitive data. More... | |
struct | ots_seed_indices_t |
Seed indices container. More... | |
struct | ots_tx_description_t |
Transaction description. More... | |
struct | ots_tx_warning_t |
Transaction warning. More... | |
Macros | |
#define | OTS_MAX_ERROR_MESSAGE 256 |
Maximum length for error messages. | |
#define | OTS_MAX_ERROR_LOCATION 64 |
Maximum length for error location strings. | |
#define | OTS_MAX_VERSION_STRING 32 |
Maximum length for version strings. | |
#define | OTS_MONERO_SEED_WORDS 25 |
Seed phrase lengths. | |
#define | OTS_POLYSEED_WORDS 16 |
#define | OTS_LEGACY_SEED_WORDS 13 |
Enumerations | |
enum | OTS_NETWORK { OTS_NETWORK_MAIN , OTS_NETWORK_TEST , OTS_NETWORK_STAGE } |
Network types matching ots::Network. More... | |
enum | OTS_ADDRESS_TYPE { OTS_ADDRESS_TYPE_STANDARD , OTS_ADDRESS_TYPE_SUBADDRESS , OTS_ADDRESS_TYPE_INTEGRATED } |
Address types matching ots::AddressType. More... | |
enum | OTS_SEED_TYPE { OTS_SEED_TYPE_MONERO , OTS_SEED_TYPE_POLYSEED } |
Seed types matching ots::SeedType. More... | |
enum | ots_handle_type { OTS_HANDLE_INVALID = 0 , OTS_HANDLE_SEED , OTS_HANDLE_WALLET , OTS_HANDLE_TX } |
Types of handles for type safety. More... | |
Functions | |
static bool | ots_handle_valid (ots_handle_t h, ots_handle_type expected) |
Validate handle type. | |
void | ots_error_init (ots_error_t *error) |
Initialize error structure. | |
bool | ots_is_error (const ots_result_t *result) |
Check if result contains an error. | |
ots_result_t | ots_get_last_error (void) |
Get error message for last error. | |
ots_result_t | ots_get_error_message (int32_t error_code) |
Get error message for specific error code. | |
void | ots_clear_error (void) |
Clear last error state. | |
bool | ots_has_error (const ots_result_t *result) |
Check if result contains an error. | |
void | ots_wipeable_string_free (ots_wipeable_string_t *str) |
Free a wipeable string, securely wiping memory. | |
void | ots_seed_indices_free (ots_seed_indices_t *indices) |
Free seed indices, securely wiping memory. | |
void | ots_free_string (char *str) |
Free a string allocated by the library. | |
void | ots_free_array (void *arr) |
Free an array allocated by the library. | |
void | ots_free_handle (ots_handle_t handle) |
Free a handle. | |
void | ots_free_tx_description (ots_tx_description_t *desc) |
Free transaction description. | |
void | ots_secure_free (void *buffer, size_t size) |
Securely wipe and free a buffer. | |
ots_result_t | ots_wipeable_string_create (const char *str) |
Create a new wipeable string. | |
ots_result_t | ots_wipeable_string_compare (const ots_wipeable_string_t *str1, const ots_wipeable_string_t *str2) |
Compare two wipeable strings. | |
void | ots_wipeable_string_clear (ots_wipeable_string_t *str) |
Clear wipeable string content. | |
ots_result_t | ots_seed_indices_create (size_t size) |
Create seed indices container. | |
void | ots_seed_indices_clear (ots_seed_indices_t *indices) |
Clear seed indices content. | |
ots_result_t | ots_version (void) |
Get library version string. | |
ots_result_t | ots_version_components (void) |
Get version components [major, minor, patch]. | |
ots_result_t | ots_seed_phrase (ots_handle_t handle, const char *language_code, const char *password) |
Get seed phrase in specified language. | |
ots_result_t | ots_seed_languages (OTS_SEED_TYPE type) |
Get supported languages for seed type. | |
ots_result_t | ots_seed_indices (ots_handle_t handle, const char *password) |
Get seed indices. | |
ots_result_t | ots_seed_fingerprint (ots_handle_t handle) |
Get seed fingerprint. | |
ots_result_t | ots_seed_address (ots_handle_t handle) |
Get seed address. | |
ots_result_t | ots_seed_timestamp (ots_handle_t handle) |
Get seed creation timestamp. | |
ots_result_t | ots_seed_height (ots_handle_t handle) |
Get seed blockchain height. | |
ots_result_t | ots_seed_network (ots_handle_t handle) |
Get seed network type. | |
ots_result_t | ots_seed_wallet (ots_handle_t handle) |
Get wallet from seed. | |
ots_result_t | ots_seed_merge_values (const ots_seed_indices_t *values1, const ots_seed_indices_t *values2) |
Merge two sets of seed values. | |
ots_result_t | ots_seed_merge_with_password (const char *password, const ots_seed_indices_t *values) |
Merge seed values with password. | |
ots_result_t | ots_seed_merge_multiple_values (const ots_seed_indices_t *values[], size_t count) |
Merge multiple sets of seed values. | |
ots_result_t | ots_seed_merge_values_and_zero (ots_seed_indices_t *values1, ots_seed_indices_t *values2, bool delete_after) |
Merge and zero two sets of seed values. | |
ots_result_t | ots_seed_merge_values_with_password_and_zero (char *password, ots_seed_indices_t *values, bool delete_after) |
Merge seed values with password and zero. | |
ots_result_t | ots_seed_merge_multiple_values_and_zero (ots_seed_indices_t *values[], size_t count, bool delete_after) |
Merge multiple sets of seed values and zero. | |
ots_result_t | ots_legacy_seed_decode (const char *phrase, uint64_t height, uint64_t time, OTS_NETWORK network) |
Decode a legacy (13 word) seed from phrase. | |
ots_result_t | ots_legacy_seed_decode_indices (const ots_seed_indices_t *indices, uint64_t height, uint64_t time, OTS_NETWORK network) |
Decode a legacy seed from indices. | |
ots_result_t | ots_monero_seed_create (const uint8_t random[32], uint64_t height, uint64_t time, OTS_NETWORK network) |
Create a Monero seed from random data. | |
ots_result_t | ots_monero_seed_generate (uint64_t height, uint64_t time, OTS_NETWORK network) |
Generate a new Monero seed. | |
ots_result_t | ots_monero_seed_decode (const char *phrase, uint64_t height, uint64_t time, OTS_NETWORK network, const char *passphrase) |
Decode a Monero seed from phrase. | |
ots_result_t | ots_monero_seed_decode_indices (const ots_seed_indices_t *indices, uint64_t height, uint64_t time, OTS_NETWORK network, const char *passphrase) |
Decode a Monero seed from indices. | |
ots_result_t | ots_polyseed_create (const uint8_t random[19], OTS_NETWORK network, uint64_t time, const char *passphrase) |
Create a Polyseed from random data. | |
ots_result_t | ots_polyseed_generate (OTS_NETWORK network, uint64_t time, const char *passphrase) |
Generate a new Polyseed. | |
ots_result_t | ots_polyseed_decode (const char *phrase, OTS_NETWORK network, const char *password, const char *passphrase) |
Decode a Polyseed from phrase. | |
ots_result_t | ots_polyseed_decode_indices (const ots_seed_indices_t *indices, OTS_NETWORK network, const char *password, const char *passphrase) |
Decode a Polyseed from indices. | |
ots_result_t | ots_polyseed_decode_with_language (const char *phrase, const char *language_code, OTS_NETWORK network, const char *password, const char *passphrase) |
Decode a Polyseed from phrase with specific language. | |
ots_result_t | ots_address_type (ots_handle_t address) |
Get address type. | |
ots_result_t | ots_address_network (ots_handle_t address) |
Get network type for an address. | |
ots_result_t | ots_address_fingerprint (ots_handle_t address) |
Generate fingerprint for an address. | |
ots_result_t | ots_address_is_integrated (ots_handle_t address) |
Check if address is an integrated address. | |
ots_result_t | ots_address_payment_id (ots_handle_t address) |
Extract payment ID from integrated address. | |
ots_result_t | ots_address_from_integrated (ots_handle_t address) |
Get base address from integrated address. | |
ots_result_t | ots_address_length (ots_handle_t address) |
Get address length. | |
ots_result_t | ots_address_base58_string (ots_handle_t address_handle) |
Get base58 string representation of address. | |
ots_result_t | ots_address_equal (ots_handle_t address1, ots_handle_t address2) |
Compare two addresses for equality. | |
ots_result_t | ots_address_equal_string (ots_handle_t address_handle, const char *address_string) |
Compare address handle with string. | |
ots_result_t | ots_address_create (const char *address) |
Create address object from string. | |
void | ots_address_free (ots_handle_t handle) |
Free address handle. | |
ots_result_t | ots_address_string_valid (const char *address, OTS_NETWORK network) |
Validate a Monero address. | |
ots_result_t | ots_address_string_network (const char *address) |
Get network type for an address string. | |
ots_result_t | ots_address_string_type (const char *address) |
Get type for an address string. | |
ots_result_t | ots_address_string_fingerprint (const char *address) |
Generate fingerprint for an address string. | |
ots_result_t | ots_address_string_is_integrated (const char *address) |
Check if address string is integrated. | |
ots_result_t | ots_address_string_payment_id (const char *address) |
Extract payment ID from integrated address string. | |
ots_result_t | ots_address_string_integrated (const char *address) |
Get base address from integrated address string. | |
ots_result_t | ots_wallet_create (const uint8_t key[32], uint64_t height, OTS_NETWORK network) |
Create wallet from secret key. | |
ots_result_t | ots_wallet_height (ots_handle_t wallet_handle) |
Get wallet restore height. | |
ots_result_t | ots_wallet_address (ots_handle_t wallet_handle, uint32_t account, uint32_t index) |
Generate address for wallet. | |
ots_result_t | ots_wallet_accounts (ots_handle_t wallet_handle, uint32_t max, uint32_t offset) |
Get list of accounts in wallet. | |
ots_result_t | ots_wallet_subaddresses (ots_handle_t wallet_handle, uint32_t account, uint32_t max, uint32_t offset) |
Get list of subaddresses for an account. | |
ots_result_t | ots_wallet_has_address (ots_handle_t wallet_handle, const char *address, uint32_t max_account_depth, uint32_t max_index_depth) |
Check if address belongs to wallet. | |
ots_result_t | ots_wallet_has_address_handle (ots_handle_t wallet_handle, ots_handle_t address_handle, uint32_t max_account_depth, uint32_t max_index_depth) |
Check if address belongs to wallet using Address handle. | |
ots_result_t | ots_wallet_address_index (ots_handle_t wallet_handle, const char *address, uint32_t max_account_depth, uint32_t max_index_depth) |
Get account and index for address in wallet. | |
ots_result_t | ots_wallet_address_index_handle (ots_handle_t wallet_handle, ots_handle_t address_handle, uint32_t max_account_depth, uint32_t max_index_depth) |
Get account and index for address handle in wallet. | |
ots_result_t | ots_wallet_secret_view_key (ots_handle_t wallet_handle) |
Get secret view key. | |
ots_result_t | ots_wallet_public_view_key (ots_handle_t wallet_handle) |
Get public view key. | |
ots_result_t | ots_wallet_secret_spend_key (ots_handle_t wallet_handle) |
Get secret spend key. | |
ots_result_t | ots_wallet_public_spend_key (ots_handle_t wallet_handle) |
Get public spend key. | |
ots_result_t | ots_wallet_import_outputs (ots_handle_t wallet_handle, const char *outputs) |
Import outputs from string. | |
ots_result_t | ots_wallet_export_key_images (ots_handle_t wallet_handle) |
Export key images. | |
ots_result_t | ots_wallet_describe_tx (ots_handle_t wallet_handle, const char *unsigned_tx) |
Describe unsigned transaction. | |
ots_result_t | ots_wallet_check_tx (ots_handle_t wallet_handle, ots_handle_t unsigned_tx_handle) |
Check transaction for warnings. | |
ots_result_t | ots_wallet_check_tx_string (ots_handle_t wallet_handle, const char *unsigned_tx) |
Check transaction string for warnings. | |
ots_result_t | ots_wallet_sign_transaction (ots_handle_t wallet_handle, const char *unsigned_tx) |
Sign unsigned transaction. | |
ots_result_t | ots_wallet_sign_data (ots_handle_t wallet_handle, const char *data) |
Sign arbitrary data. | |
ots_result_t | ots_wallet_sign_data_with_index (ots_handle_t wallet_handle, const char *data, uint32_t account, uint32_t subaddr) |
Sign data with specific subaddress. | |
ots_result_t | ots_wallet_sign_data_with_address (ots_handle_t wallet_handle, const char *data, ots_handle_t address_handle) |
Sign data with specific address. | |
ots_result_t | ots_wallet_verify_data (const char *data, const char *signature, bool legacy_fallback) |
Verify signed data for the wallet address with legacy support. | |
ots_result_t | ots_wallet_verify_data_with_index (ots_handle_t wallet_handle, const char *data, uint32_t account, uint32_t subaddr, const char *signature, bool legacy_fallback) |
Verify signed data with specific subaddress. | |
ots_result_t | ots_wallet_verify_data_with_address (ots_handle_t wallet_handle, const char *data, ots_handle_t address_handle, const char *signature, bool legacy_fallback) |
Verify signed data with specific address. | |
ots_result_t | ots_height_from_timestamp (uint64_t timestamp, OTS_NETWORK network) |
Convert timestamp to estimated block height. | |
ots_result_t | ots_timestamp_from_height (uint64_t height, OTS_NETWORK network) |
Convert block height to estimated timestamp. | |
ots_result_t | ots_random_bytes (uint8_t *buffer, size_t size) |
Generate random bytes. | |
ots_result_t | ots_random_32 (void) |
Generate 32 random bytes. | |
ots_result_t | ots_check_entropy (const uint8_t *data, size_t size, double min_entropy) |
Check data entropy level. | |
void | ots_set_enforce_entropy (bool enforce) |
Set entropy enforcement. | |
void | ots_set_max_account_depth (uint32_t depth) |
Set maximum account depth for searching. | |
void | ots_set_max_index_depth (uint32_t depth) |
Set maximum index depth for searching. | |
void | ots_set_max_depth (uint32_t account_depth, uint32_t index_depth) |
Set maximum depths for searching. | |
void | ots_reset_max_depth (void) |
Reset maximum depths to defaults. | |
uint32_t | ots_max_account_depth (uint32_t depth) |
Get maximum account depth. | |
uint32_t | ots_max_index_depth (uint32_t depth) |
Get maximum index depth. | |
ots_result_t | ots_verify_data (const char *data, const char *address, const char *signature) |
Verify signed data. | |
Header for the C ABI (Application Binary Interface) library.
This header provides a pure C-compatible interface to the C++ implementation. All functions that return pointers or handles require explicit memory management using the corresponding free functions to prevent memory leaks.
#define OTS_LEGACY_SEED_WORDS 13 |
#define OTS_MAX_ERROR_LOCATION 64 |
Maximum length for error location strings.
#define OTS_MAX_ERROR_MESSAGE 256 |
Maximum length for error messages.
#define OTS_MAX_VERSION_STRING 32 |
Maximum length for version strings.
#define OTS_MONERO_SEED_WORDS 25 |
Seed phrase lengths.
#define OTS_POLYSEED_WORDS 16 |
enum OTS_ADDRESS_TYPE |
Address types matching ots::AddressType.
Enumerator | |
---|---|
OTS_ADDRESS_TYPE_STANDARD | Standard Monero address |
OTS_ADDRESS_TYPE_SUBADDRESS | Sub-address |
OTS_ADDRESS_TYPE_INTEGRATED | Integrated address with payment ID |
enum ots_handle_type |
enum OTS_NETWORK |
Network types matching ots::Network.
Enumerator | |
---|---|
OTS_NETWORK_MAIN | Main production network |
OTS_NETWORK_TEST | Test development network |
OTS_NETWORK_STAGE | Staging pre-production network |
enum OTS_SEED_TYPE |
Seed types matching ots::SeedType.
Enumerator | |
---|---|
OTS_SEED_TYPE_MONERO | Monero 25-word seed |
OTS_SEED_TYPE_POLYSEED | Polyseed 16-word seed |
ots_result_t ots_address_base58_string | ( | ots_handle_t | address_handle | ) |
Get base58 string representation of address.
[in] | address_handle | Address handle |
ots_result_t ots_address_create | ( | const char * | address | ) |
Create address object from string.
[in] | address | Address string |
OTS_ERROR_INVALID_ADDRESS | if address is invalid |
ots_result_t ots_address_equal | ( | ots_handle_t | address1, |
ots_handle_t | address2 | ||
) |
Compare two addresses for equality.
[in] | address1 | First address |
[in] | address2 | Second address |
OTS_ERROR_INVALID_ADDRESS | if either address is invalid |
ots_result_t ots_address_equal_string | ( | ots_handle_t | address_handle, |
const char * | address_string | ||
) |
Compare address handle with string.
[in] | address_handle | Address handle |
[in] | address_string | Address string to compare |
ots_result_t ots_address_fingerprint | ( | ots_handle_t | address | ) |
Generate fingerprint for an address.
[in] | address | The address to generate fingerprint for |
OTS_ERROR_INVALID_ADDRESS | if address is invalid |
void ots_address_free | ( | ots_handle_t | handle | ) |
Free address handle.
[in] | handle | Address handle to free |
ots_result_t ots_address_from_integrated | ( | ots_handle_t | address | ) |
Get base address from integrated address.
[in] | address | The integrated address |
OTS_ERROR_INVALID_ADDRESS | if address is invalid |
OTS_ERROR_NOT_INTEGRATED | if address is not an integrated address |
ots_result_t ots_address_is_integrated | ( | ots_handle_t | address | ) |
Check if address is an integrated address.
[in] | address | The address to check |
OTS_ERROR_INVALID_ADDRESS | if address is invalid |
ots_result_t ots_address_length | ( | ots_handle_t | address | ) |
Get address length.
[in] | address | The address to check |
OTS_ERROR_INVALID_ADDRESS | if address is invalid |
ots_result_t ots_address_network | ( | ots_handle_t | address | ) |
Get network type for an address.
[in] | address | The address to check |
OTS_ERROR_INVALID_ADDRESS | if address is invalid |
ots_result_t ots_address_payment_id | ( | ots_handle_t | address | ) |
Extract payment ID from integrated address.
[in] | address | The integrated address |
OTS_ERROR_INVALID_ADDRESS | if address is invalid |
OTS_ERROR_NOT_INTEGRATED | if address is not an integrated address |
ots_result_t ots_address_string_fingerprint | ( | const char * | address | ) |
Generate fingerprint for an address string.
[in] | address | The address string |
OTS_ERROR_INVALID_ADDRESS | if address is invalid |
ots_result_t ots_address_string_integrated | ( | const char * | address | ) |
Get base address from integrated address string.
[in] | address | The integrated address string |
OTS_ERROR_INVALID_ADDRESS | if address is invalid |
OTS_ERROR_NOT_INTEGRATED | if address is not integrated |
ots_result_t ots_address_string_is_integrated | ( | const char * | address | ) |
Check if address string is integrated.
[in] | address | The address string to check |
OTS_ERROR_INVALID_ADDRESS | if address is invalid |
ots_result_t ots_address_string_network | ( | const char * | address | ) |
Get network type for an address string.
[in] | address | The address string to check |
OTS_ERROR_INVALID_ADDRESS | if address is invalid |
ots_result_t ots_address_string_payment_id | ( | const char * | address | ) |
Extract payment ID from integrated address string.
[in] | address | The integrated address string |
OTS_ERROR_INVALID_ADDRESS | if address is invalid |
OTS_ERROR_NOT_INTEGRATED | if address is not integrated |
ots_result_t ots_address_string_type | ( | const char * | address | ) |
Get type for an address string.
[in] | address | The address string to check |
OTS_ERROR_INVALID_ADDRESS | if address is invalid |
ots_result_t ots_address_string_valid | ( | const char * | address, |
OTS_NETWORK | network | ||
) |
Validate a Monero address.
[in] | address | Address to validate |
[in] | network | Network to validate against |
ots_result_t ots_address_type | ( | ots_handle_t | address | ) |
Get address type.
[in] | address | Address to check |
ots_result_t ots_check_entropy | ( | const uint8_t * | data, |
size_t | size, | ||
double | min_entropy | ||
) |
Check data entropy level.
[in] | data | Data to check |
[in] | size | Size of data |
[in] | min_entropy | Minimum required entropy |
void ots_clear_error | ( | void | ) |
Clear last error state.
void ots_error_init | ( | ots_error_t * | error | ) |
Initialize error structure.
[out] | error | Error structure to initialize |
void ots_free_array | ( | void * | arr | ) |
Free an array allocated by the library.
[in] | arr | Array to free |
void ots_free_handle | ( | ots_handle_t | handle | ) |
Free a handle.
[in] | handle | Handle to free |
void ots_free_string | ( | char * | str | ) |
Free a string allocated by the library.
[in] | str | String to free |
void ots_free_tx_description | ( | ots_tx_description_t * | desc | ) |
Free transaction description.
[in] | desc | Transaction description to free |
ots_result_t ots_get_error_message | ( | int32_t | error_code | ) |
Get error message for specific error code.
[in] | error_code | Error code to get message for |
ots_result_t ots_get_last_error | ( | void | ) |
Get error message for last error.
|
inlinestatic |
Validate handle type.
bool ots_has_error | ( | const ots_result_t * | result | ) |
Check if result contains an error.
[in] | result | Result to check |
ots_result_t ots_height_from_timestamp | ( | uint64_t | timestamp, |
OTS_NETWORK | network | ||
) |
Convert timestamp to estimated block height.
[in] | timestamp | Unix timestamp |
[in] | network | Network type |
bool ots_is_error | ( | const ots_result_t * | result | ) |
Check if result contains an error.
[in] | result | Result to check |
ots_result_t ots_legacy_seed_decode | ( | const char * | phrase, |
uint64_t | height, | ||
uint64_t | time, | ||
OTS_NETWORK | network | ||
) |
Decode a legacy (13 word) seed from phrase.
[in] | phrase | The seed phrase |
[in] | height | Optional blockchain height (0 for none) |
[in] | time | Optional timestamp (0 for none) |
[in] | network | Network type (default: MAIN) |
OTS_ERROR_INVALID_SEED | if decoding fails |
ots_result_t ots_legacy_seed_decode_indices | ( | const ots_seed_indices_t * | indices, |
uint64_t | height, | ||
uint64_t | time, | ||
OTS_NETWORK | network | ||
) |
Decode a legacy seed from indices.
[in] | indices | Array of seed word indices |
[in] | height | Optional blockchain height (0 for none) |
[in] | time | Optional timestamp (0 for none) |
[in] | network | Network type (default: MAIN) |
OTS_ERROR_INVALID_SEED | if decoding fails |
uint32_t ots_max_account_depth | ( | uint32_t | depth | ) |
Get maximum account depth.
[in] | depth | Optional new depth (0 to just query current) |
uint32_t ots_max_index_depth | ( | uint32_t | depth | ) |
Get maximum index depth.
[in] | depth | Optional new depth (0 to just query current) |
ots_result_t ots_monero_seed_create | ( | const uint8_t | random[32], |
uint64_t | height, | ||
uint64_t | time, | ||
OTS_NETWORK | network | ||
) |
Create a Monero seed from random data.
[in] | random | 32-byte random input |
[in] | height | Optional blockchain height (0 for none) |
[in] | time | Optional timestamp (0 for none) |
[in] | network | Network type (default: MAIN) |
OTS_ERROR_INVALID_INPUT | if random data is invalid |
ots_result_t ots_monero_seed_decode | ( | const char * | phrase, |
uint64_t | height, | ||
uint64_t | time, | ||
OTS_NETWORK | network, | ||
const char * | passphrase | ||
) |
Decode a Monero seed from phrase.
[in] | phrase | The seed phrase |
[in] | height | Optional blockchain height (0 for none) |
[in] | time | Optional timestamp (0 for none) |
[in] | network | Network type (default: MAIN) |
[in] | passphrase | Optional passphrase (empty string for none) |
OTS_ERROR_INVALID_SEED | if decoding fails |
ots_result_t ots_monero_seed_decode_indices | ( | const ots_seed_indices_t * | indices, |
uint64_t | height, | ||
uint64_t | time, | ||
OTS_NETWORK | network, | ||
const char * | passphrase | ||
) |
Decode a Monero seed from indices.
[in] | indices | Array of seed word indices |
[in] | height | Optional blockchain height (0 for none) |
[in] | time | Optional timestamp (0 for none) |
[in] | network | Network type (default: MAIN) |
[in] | passphrase | Optional passphrase (empty string for none) |
OTS_ERROR_INVALID_SEED | if decoding fails |
ots_result_t ots_monero_seed_generate | ( | uint64_t | height, |
uint64_t | time, | ||
OTS_NETWORK | network | ||
) |
Generate a new Monero seed.
[in] | height | Optional blockchain height (0 for none) |
[in] | time | Optional timestamp (0 for none) |
[in] | network | Network type (default: MAIN) |
ots_result_t ots_polyseed_create | ( | const uint8_t | random[19], |
OTS_NETWORK | network, | ||
uint64_t | time, | ||
const char * | passphrase | ||
) |
Create a Polyseed from random data.
[in] | random | 19-byte random input |
[in] | network | Network type (default: MAIN) |
[in] | time | Optional timestamp (0 for current time) |
[in] | passphrase | Optional passphrase for seed offset (empty string for none) |
OTS_ERROR_INVALID_INPUT | if random data is invalid |
ots_result_t ots_polyseed_decode | ( | const char * | phrase, |
OTS_NETWORK | network, | ||
const char * | password, | ||
const char * | passphrase | ||
) |
Decode a Polyseed from phrase.
[in] | phrase | The seed phrase |
[in] | network | Network type (default: MAIN) |
[in] | password | Optional decryption password (empty string for none) |
[in] | passphrase | Optional passphrase for seed offset (empty string for none) |
OTS_ERROR_INVALID_SEED | if decoding fails |
ots_result_t ots_polyseed_decode_indices | ( | const ots_seed_indices_t * | indices, |
OTS_NETWORK | network, | ||
const char * | password, | ||
const char * | passphrase | ||
) |
Decode a Polyseed from indices.
[in] | indices | Array of seed word indices |
[in] | network | Network type (default: MAIN) |
[in] | password | Optional decryption password (empty string for none) |
[in] | passphrase | Optional passphrase for seed offset (empty string for none) |
OTS_ERROR_INVALID_SEED | if decoding fails |
ots_result_t ots_polyseed_decode_with_language | ( | const char * | phrase, |
const char * | language_code, | ||
OTS_NETWORK | network, | ||
const char * | password, | ||
const char * | passphrase | ||
) |
Decode a Polyseed from phrase with specific language.
[in] | phrase | The seed phrase |
[in] | language_code | Language code for the phrase |
[in] | network | Network type (default: MAIN) |
[in] | password | Optional decryption password (empty string for none) |
[in] | passphrase | Optional passphrase for seed offset (empty string for none) |
OTS_ERROR_INVALID_SEED | if decoding fails |
ots_result_t ots_polyseed_generate | ( | OTS_NETWORK | network, |
uint64_t | time, | ||
const char * | passphrase | ||
) |
Generate a new Polyseed.
[in] | network | Network type (default: MAIN) |
[in] | time | Optional timestamp (0 for current time) |
[in] | passphrase | Optional passphrase for seed offset (empty string for none) |
ots_result_t ots_random_32 | ( | void | ) |
Generate 32 random bytes.
ots_result_t ots_random_bytes | ( | uint8_t * | buffer, |
size_t | size | ||
) |
Generate random bytes.
[out] | buffer | Buffer to receive random bytes |
[in] | size | Number of bytes to generate |
void ots_reset_max_depth | ( | void | ) |
Reset maximum depths to defaults.
void ots_secure_free | ( | void * | buffer, |
size_t | size | ||
) |
Securely wipe and free a buffer.
[in,out] | buffer | Buffer to wipe and free |
[in] | size | Size of buffer |
ots_result_t ots_seed_address | ( | ots_handle_t | handle | ) |
Get seed address.
[in] | handle | Seed handle |
ots_result_t ots_seed_fingerprint | ( | ots_handle_t | handle | ) |
Get seed fingerprint.
[in] | handle | Seed handle |
ots_result_t ots_seed_height | ( | ots_handle_t | handle | ) |
Get seed blockchain height.
[in] | handle | Seed handle |
ots_result_t ots_seed_indices | ( | ots_handle_t | handle, |
const char * | password | ||
) |
Get seed indices.
[in] | handle | Seed handle |
[in] | password | Optional password for encrypted seeds |
void ots_seed_indices_clear | ( | ots_seed_indices_t * | indices | ) |
Clear seed indices content.
[in,out] | indices | Indices to clear |
ots_result_t ots_seed_indices_create | ( | size_t | size | ) |
Create seed indices container.
[in] | size | Number of indices |
void ots_seed_indices_free | ( | ots_seed_indices_t * | indices | ) |
Free seed indices, securely wiping memory.
[in,out] | indices | Indices to free |
ots_result_t ots_seed_languages | ( | OTS_SEED_TYPE | type | ) |
Get supported languages for seed type.
[in] | type | Seed type |
ots_result_t ots_seed_merge_multiple_values | ( | const ots_seed_indices_t * | values[], |
size_t | count | ||
) |
Merge multiple sets of seed values.
[in] | values | Array of value sets to merge |
[in] | count | Number of value sets |
OTS_ERROR_LENGTH_MISMATCH | if value sets have different sizes |
OTS_ERROR_TOO_FEW_VALUES | if less than two value sets provided |
ots_result_t ots_seed_merge_multiple_values_and_zero | ( | ots_seed_indices_t * | values[], |
size_t | count, | ||
bool | delete_after | ||
) |
Merge multiple sets of seed values and zero.
[in,out] | values | Array of value sets to merge (will be zeroed) |
[in] | count | Number of value sets |
[in] | delete_after | Delete values after merging |
OTS_ERROR_LENGTH_MISMATCH | if value sets have different sizes |
OTS_ERROR_TOO_FEW_VALUES | if less than two value sets provided |
ots_result_t ots_seed_merge_values | ( | const ots_seed_indices_t * | values1, |
const ots_seed_indices_t * | values2 | ||
) |
Merge two sets of seed values.
[in] | values1 | First set of values |
[in] | values2 | Second set of values |
OTS_ERROR_LENGTH_MISMATCH | if value sets have different sizes |
ots_result_t ots_seed_merge_values_and_zero | ( | ots_seed_indices_t * | values1, |
ots_seed_indices_t * | values2, | ||
bool | delete_after | ||
) |
Merge and zero two sets of seed values.
[in,out] | values1 | First set of values (will be zeroed) |
[in,out] | values2 | Second set of values (will be zeroed) |
[in] | delete_after | Delete values after merging |
OTS_ERROR_LENGTH_MISMATCH | if value sets have different sizes |
ots_result_t ots_seed_merge_values_with_password_and_zero | ( | char * | password, |
ots_seed_indices_t * | values, | ||
bool | delete_after | ||
) |
Merge seed values with password and zero.
[in,out] | password | Password to merge with (will be zeroed) |
[in,out] | values | Seed values to merge (will be zeroed) |
[in] | delete_after | Delete values after merging |
OTS_ERROR_MERGE_FAILED | if merge operation fails |
ots_result_t ots_seed_merge_with_password | ( | const char * | password, |
const ots_seed_indices_t * | values | ||
) |
Merge seed values with password.
[in] | password | Password to merge with |
[in] | values | Seed values to merge |
OTS_ERROR_MERGE_FAILED | if merge operation fails |
ots_result_t ots_seed_network | ( | ots_handle_t | handle | ) |
Get seed network type.
[in] | handle | Seed handle |
ots_result_t ots_seed_phrase | ( | ots_handle_t | handle, |
const char * | language_code, | ||
const char * | password | ||
) |
Get seed phrase in specified language.
[in] | handle | Seed handle |
[in] | language_code | Language code |
[in] | password | Optional password for encrypted seeds (empty string for none) |
ots_result_t ots_seed_timestamp | ( | ots_handle_t | handle | ) |
Get seed creation timestamp.
[in] | handle | Seed handle |
ots_result_t ots_seed_wallet | ( | ots_handle_t | handle | ) |
Get wallet from seed.
[in] | handle | Seed handle |
void ots_set_enforce_entropy | ( | bool | enforce | ) |
Set entropy enforcement.
[in] | enforce | Whether to enforce entropy checks |
void ots_set_max_account_depth | ( | uint32_t | depth | ) |
Set maximum account depth for searching.
[in] | depth | Maximum account depth |
void ots_set_max_depth | ( | uint32_t | account_depth, |
uint32_t | index_depth | ||
) |
Set maximum depths for searching.
[in] | account_depth | Maximum account depth |
[in] | index_depth | Maximum index depth |
void ots_set_max_index_depth | ( | uint32_t | depth | ) |
Set maximum index depth for searching.
[in] | depth | Maximum index depth |
ots_result_t ots_timestamp_from_height | ( | uint64_t | height, |
OTS_NETWORK | network | ||
) |
Convert block height to estimated timestamp.
[in] | height | Block height |
[in] | network | Network type |
ots_result_t ots_verify_data | ( | const char * | data, |
const char * | address, | ||
const char * | signature | ||
) |
Verify signed data.
[in] | data | Original data |
[in] | address | Signer's address |
[in] | signature | Signature to verify |
ots_result_t ots_version | ( | void | ) |
Get library version string.
ots_result_t ots_version_components | ( | void | ) |
Get version components [major, minor, patch].
ots_result_t ots_wallet_accounts | ( | ots_handle_t | wallet_handle, |
uint32_t | max, | ||
uint32_t | offset | ||
) |
Get list of accounts in wallet.
[in] | wallet_handle | Wallet handle |
[in] | max | Maximum number of accounts to return |
[in] | offset | Starting account index |
ots_result_t ots_wallet_address | ( | ots_handle_t | wallet_handle, |
uint32_t | account, | ||
uint32_t | index | ||
) |
Generate address for wallet.
[in] | wallet_handle | Wallet handle |
[in] | account | Account index |
[in] | index | Address index |
ots_result_t ots_wallet_address_index | ( | ots_handle_t | wallet_handle, |
const char * | address, | ||
uint32_t | max_account_depth, | ||
uint32_t | max_index_depth | ||
) |
Get account and index for address in wallet.
[in] | wallet_handle | Wallet handle |
[in] | address | Address to look up |
[in] | max_account_depth | Maximum account depth to search |
[in] | max_index_depth | Maximum index depth to search |
OTS_ERROR_ADDRESS_NOT_FOUND | if address not found in wallet |
ots_result_t ots_wallet_address_index_handle | ( | ots_handle_t | wallet_handle, |
ots_handle_t | address_handle, | ||
uint32_t | max_account_depth, | ||
uint32_t | max_index_depth | ||
) |
Get account and index for address handle in wallet.
[in] | wallet_handle | Wallet handle |
[in] | address_handle | Address handle to look up |
[in] | max_account_depth | Maximum account depth to search |
[in] | max_index_depth | Maximum index depth to search |
OTS_ERROR_ADDRESS_NOT_FOUND | if address not found in wallet |
ots_result_t ots_wallet_check_tx | ( | ots_handle_t | wallet_handle, |
ots_handle_t | unsigned_tx_handle | ||
) |
Check transaction for warnings.
[in] | wallet_handle | Wallet handle |
[in] | unsigned_tx_handle | unsigned transaction handle |
ots_result_t ots_wallet_check_tx_string | ( | ots_handle_t | wallet_handle, |
const char * | unsigned_tx | ||
) |
Check transaction string for warnings.
[in] | wallet_handle | Wallet handle |
[in] | unsigned_tx | Unsigned transaction string |
ots_result_t ots_wallet_create | ( | const uint8_t | key[32], |
uint64_t | height, | ||
OTS_NETWORK | network | ||
) |
Create wallet from secret key.
[in] | key | 32-byte secret key |
[in] | height | Restore height |
[in] | network | Network type |
ots_result_t ots_wallet_describe_tx | ( | ots_handle_t | wallet_handle, |
const char * | unsigned_tx | ||
) |
Describe unsigned transaction.
[in] | wallet_handle | Wallet handle |
[in] | unsigned_tx | Unsigned transaction data |
ots_result_t ots_wallet_export_key_images | ( | ots_handle_t | wallet_handle | ) |
Export key images.
[in] | wallet_handle | Wallet handle |
OTS_ERROR_NO_KEY_IMAGES | if no outputs were imported |
ots_result_t ots_wallet_has_address | ( | ots_handle_t | wallet_handle, |
const char * | address, | ||
uint32_t | max_account_depth, | ||
uint32_t | max_index_depth | ||
) |
Check if address belongs to wallet.
[in] | wallet_handle | Wallet handle |
[in] | address | Address to check |
[in] | max_account_depth | Maximum account depth to search |
[in] | max_index_depth | Maximum index depth to search |
ots_result_t ots_wallet_has_address_handle | ( | ots_handle_t | wallet_handle, |
ots_handle_t | address_handle, | ||
uint32_t | max_account_depth, | ||
uint32_t | max_index_depth | ||
) |
Check if address belongs to wallet using Address handle.
[in] | wallet_handle | Wallet handle |
[in] | address_handle | Address handle to check |
[in] | max_account_depth | Maximum account depth to search |
[in] | max_index_depth | Maximum index depth to search |
ots_result_t ots_wallet_height | ( | ots_handle_t | wallet_handle | ) |
Get wallet restore height.
[in] | wallet_handle | Wallet handle |
ots_result_t ots_wallet_import_outputs | ( | ots_handle_t | wallet_handle, |
const char * | outputs | ||
) |
Import outputs from string.
[in] | wallet_handle | Wallet handle |
[in] | outputs | Outputs string from view wallet |
OTS_ERROR_INVALID_OUTPUTS | if outputs data is invalid |
ots_result_t ots_wallet_public_spend_key | ( | ots_handle_t | wallet_handle | ) |
Get public spend key.
[in] | wallet_handle | Wallet handle |
ots_result_t ots_wallet_public_view_key | ( | ots_handle_t | wallet_handle | ) |
Get public view key.
[in] | wallet_handle | Wallet handle |
ots_result_t ots_wallet_secret_spend_key | ( | ots_handle_t | wallet_handle | ) |
Get secret spend key.
[in] | wallet_handle | Wallet handle |
ots_result_t ots_wallet_secret_view_key | ( | ots_handle_t | wallet_handle | ) |
Get secret view key.
[in] | wallet_handle | Wallet handle |
ots_result_t ots_wallet_sign_data | ( | ots_handle_t | wallet_handle, |
const char * | data | ||
) |
Sign arbitrary data.
[in] | wallet_handle | Wallet handle |
[in] | data | Data to sign |
ots_result_t ots_wallet_sign_data_with_address | ( | ots_handle_t | wallet_handle, |
const char * | data, | ||
ots_handle_t | address_handle | ||
) |
Sign data with specific address.
[in] | wallet_handle | Wallet handle |
[in] | data | Data to sign |
[in] | address_handle | Address to sign with |
OTS_ERROR_ADDRESS_NOT_FOUND | if address not found in wallet |
ots_result_t ots_wallet_sign_data_with_index | ( | ots_handle_t | wallet_handle, |
const char * | data, | ||
uint32_t | account, | ||
uint32_t | subaddr | ||
) |
Sign data with specific subaddress.
[in] | wallet_handle | Wallet handle |
[in] | data | Data to sign |
[in] | account | Account index |
[in] | subaddr | Subaddress index |
ots_result_t ots_wallet_sign_transaction | ( | ots_handle_t | wallet_handle, |
const char * | unsigned_tx | ||
) |
Sign unsigned transaction.
[in] | wallet_handle | Wallet handle |
[in] | unsigned_tx | Unsigned transaction string |
OTS_ERROR_INVALID_TRANSACTION | if transaction is invalid |
ots_result_t ots_wallet_subaddresses | ( | ots_handle_t | wallet_handle, |
uint32_t | account, | ||
uint32_t | max, | ||
uint32_t | offset | ||
) |
Get list of subaddresses for an account.
[in] | wallet_handle | Wallet handle |
[in] | account | Account index |
[in] | max | Maximum number of addresses to return |
[in] | offset | Starting subaddress index |
ots_result_t ots_wallet_verify_data | ( | const char * | data, |
const char * | signature, | ||
bool | legacy_fallback | ||
) |
Verify signed data for the wallet address with legacy support.
[in] | data | Original data |
[in] | signature | Signature to verify |
[in] | legacy_fallback | Try legacy verification if modern fails |
ots_result_t ots_wallet_verify_data_with_address | ( | ots_handle_t | wallet_handle, |
const char * | data, | ||
ots_handle_t | address_handle, | ||
const char * | signature, | ||
bool | legacy_fallback | ||
) |
Verify signed data with specific address.
[in] | wallet_handle | Wallet handle |
[in] | data | Original data |
[in] | address_handle | Address to verify with |
[in] | signature | Signature to verify |
[in] | legacy_fallback | Try legacy verification if modern fails |
OTS_ERROR_ADDRESS_NOT_FOUND | if address not found in wallet |
ots_result_t ots_wallet_verify_data_with_index | ( | ots_handle_t | wallet_handle, |
const char * | data, | ||
uint32_t | account, | ||
uint32_t | subaddr, | ||
const char * | signature, | ||
bool | legacy_fallback | ||
) |
Verify signed data with specific subaddress.
[in] | wallet_handle | Wallet handle |
[in] | data | Original data |
[in] | account | Account index |
[in] | subaddr | Subaddress index |
[in] | signature | Signature to verify |
[in] | legacy_fallback | Try legacy verification if modern fails |
void ots_wipeable_string_clear | ( | ots_wipeable_string_t * | str | ) |
Clear wipeable string content.
[in,out] | str | String to clear |
ots_result_t ots_wipeable_string_compare | ( | const ots_wipeable_string_t * | str1, |
const ots_wipeable_string_t * | str2 | ||
) |
Compare two wipeable strings.
[in] | str1 | First string |
[in] | str2 | Second string |
ots_result_t ots_wipeable_string_create | ( | const char * | str | ) |
Create a new wipeable string.
[in] | str | Initial string content |
void ots_wipeable_string_free | ( | ots_wipeable_string_t * | str | ) |
Free a wipeable string, securely wiping memory.
[in,out] | str | String to free |