Expand description
§uhash-core
Canonical M1 mining API in this crate is Lithium v1:
UniversalHash(SHA256(miner_address_utf8 || block_hash_32 || cyberlinks_merkle_32) || nonce_le_u64)
Use:
Legacy UniversalHash v4 implementation is still present for compatibility tooling
(UniversalHash, hash, v4 params), but it is non-canonical for lithium-v1 flow.
§no_std Support
This crate supports no_std environments with the alloc crate:
[dependencies]
uhash-core = { version = "0.2", default-features = false }Structs§
- Lithium
Canonical Vector - Canonical lithium-v1 vector tuple shared across crates/tests.
Constants§
- LITHIUM_
BLOCK_ HASH_ LEN - Fixed block hash length for lithium v1 preimage.
- LITHIUM_
CANONICAL_ VECTORS - Shared canonical vectors used by core/web/consumer parity tests.
- LITHIUM_
CYBERLINKS_ MERKLE_ LEN - Fixed cyberlinks merkle length for lithium v1 preimage.
Functions§
- lithium_
hash - Compute lithium v1 PoW hash using UniversalHash engine:
UniversalHash(SHA256(miner_address || block_hash || cyberlinks_merkle) || nonce_le). - lithium_
header - Build canonical lithium header bytes:
SHA256(miner_address_utf8 || block_hash_32 || cyberlinks_merkle_32). - lithium_
preimage - Build canonical lithium PoW input bytes:
lithium_header || nonce_le_u64. - meets_
difficulty - Check if a hash meets the required difficulty