| Crates.io | valence-crypto-utils |
| lib.rs | valence-crypto-utils |
| version | 0.1.2 |
| created_at | 2025-08-14 13:01:14.401201+00 |
| updated_at | 2025-09-19 23:02:36.113851+00 |
| description | A collection of crypto utilities for the Valence ecosystem. |
| homepage | |
| repository | https://github.com/timewave-computer/valence-crypto-utils |
| max_upload_size | |
| id | 1794844 |
| size | 38,902 |
This library is a collection of crypto utilities for the Valence ecosystem.
The signer functions as a versatile signature provider, which can be constructed utilizing environmental variables.
One option is to use foundry:
PRIVATE_KEY=$(cast wallet private-key --account some-wallet) \
export VALENCE_SIGNER='{"SecretEccNistP256":"'$PRIVATE_KEY'"}'
Once the VALENCE_SIGNER is set, the ecosystem will authenticate messages originating from the generated secret.
The signer will utilize the rfc-8785 in order to sign JSON requests:
use valence_crypto_utils::{Signer, Ecdsa};
let signer = Signer::try_from_env().unwrap();
let request = r#"{"b": "foo", "a": 42 }"#;
let signature = signer.sign_json(request.as_bytes()).unwrap();
let public = Ecdsa::recover_from_json(&signature, request).unwrap();