Crates.io | trait-keyless |
lib.rs | trait-keyless |
version | 0.4.0 |
source | src |
created_at | 2024-11-06 19:00:45.011794 |
updated_at | 2024-11-08 17:39:03.811801 |
description | This library provides functions for encoding and decoding keyless addresses, used by the TRAIT blockchain: application agent addresses, transactional addresses, and named addresses. |
homepage | https://trait.tech |
repository | https://github.com/traittech/trait-keyless/ |
max_upload_size | |
id | 1438692 |
size | 38,798 |
This library provides functions for encoding and decoding keyless addresses, used by the TRAIT blockchain: application agent addresses, transactional addresses, and named addresses.
A keyless address is a type of address that doesn't rely on cryptographic key pairs for identification. Instead, it is derived from a combination of identifiers and checksums, making it suitable and convenient for off-chain applications to use.
use trait_keyless::*;
// Encode an AppAgent keyless address
let app_agent_id = 123;
let app_agent_address = encode_app_agent_account(&app_agent_id);
// Decode the keyless address
let decoded_app_agent_id = decode_app_agent_account(&app_agent_address).unwrap();
assert_eq!(decoded_app_agent_id, app_agent_id);