Crates.io | qp-poseidon |
lib.rs | qp-poseidon |
version | 0.9.5 |
created_at | 2025-09-04 09:21:37.826604+00 |
updated_at | 2025-09-24 23:32:57.057155+00 |
description | Poseidon hash implementation for Substrate/Polkadot ecosystem using plonky3 field arithmetic |
homepage | https://quantus.com |
repository | https://github.com/Quantus-Network/qp-poseidon |
max_upload_size | |
id | 1823916 |
size | 108,847 |
Substrate-compatible Poseidon hash implementation for the Polkadot ecosystem. This crate wraps qp-poseidon-core
and adds Substrate-specific functionality including codec traits and specialized storage operations.
Encode
, Decode
, and TypeInfo
traits from parity-scale-codec
serde
featureAdd this to your Cargo.toml
:
[dependencies]
qp-poseidon = { path = "path/to/qp-poseidon/crates/substrate" }
use qp_poseidon::PoseidonHasher;
// Hash bytes with circuit-compatible padding
let data = b"hello world";
let hash = PoseidonHasher::hash_padded(data);
println!("Hash: {:?}", hash);
qp-poseidon-core
's security guaranteesuse qp_poseidon::PoseidonHasher;
use frame_support::pallet_prelude::*;
#[pallet::config]
pub trait Config: frame_system::Config {
type Hasher: sp_runtime::traits::Hash<Output = sp_core::H256>;
}
// Use PoseidonHasher as the pallet's hasher
impl pallet::Config for Runtime {
type Hasher = PoseidonHasher;
}
qp-poseidon-core
- The underlying pure cryptographic implementationparity-scale-codec
- Substrate's encoding libraryplonky3
- The underlying field arithmetic library