| Crates.io | stellar-strkey |
| lib.rs | stellar-strkey |
| version | 0.0.16 |
| created_at | 2022-09-02 04:14:09.396056+00 |
| updated_at | 2026-01-22 04:13:31.057776+00 |
| description | Encode and decode strkeys for Stellar. |
| homepage | https://github.com/stellar/rs-stellar-strkey |
| repository | https://github.com/stellar/rs-stellar-strkey |
| max_upload_size | |
| id | 657175 |
| size | 184,931 |
Library and CLI containing types and functionality for working with Stellar Strkeys.
This repository contains code that is in early development, incomplete, not tested, and not recommended for use. The API is unstable, experimental, and is receiving breaking changes frequently.
To use the library, include in your toml:
stellar-strkey = "..."
no_std SupportThis crate is no_std compatible and does not utilise std or alloc in its default feature set.
Some features utilize the alloc crate.
| Feature | Alloc | Dependencies | Description |
|---|---|---|---|
default |
By default there are no features enabled | ||
serde |
Enables serde serialization/deserialization as strkey strings | ||
serde-decoded |
✓ | serde |
Enables serde serialization/deserialization via Decoded<T> as JSON objects, with byte fields hex-encoded |
cli |
✓ | serde, serde-decoded |
For use when installing the stellar-strkey cli |
To use in a no_std environment without an allocator:
stellar-strkey = { version = "..." }
To enable serde support:
stellar-strkey = { version = "...", features = ["serde"] }
To enable the Decoded JSON format (requires an allocator):
stellar-strkey = { version = "...", features = ["serde-decoded"] }
To use the CLI:
cargo install --locked stellar-strkey --version ... --features cli
Decode a G account/public-key strkey:
$ stellar-strkey decode GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWHF
{
"public_key_ed25519": "0000000000000000000000000000000000000000000000000000000000000000"
}
Decode a C contract strkey:
$ stellar-strkey decode CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABSC4
{
"contract": "0000000000000000000000000000000000000000000000000000000000000000"
}
License: Apache-2.0