Optimize `Poseidon Hash` Implementation in CosmWasm Contracts
- Dominant language
- Rust
- Stars
- 1.1k
- Forks
- 418
- Avg merge
- 3d 11h
- Merged PRs (30d)
- 2
Description
## Problem Description
The Poseidon hash function is a zero-knowledge (ZK) ecosystem-friendly cryptographic hash. Currently in our contracts, we can directly create Poseidon instances, but each message processing requires re-instantiating the Poseidon instance. This process involves loading substantial constant data, resulting in unnecessarily high gas costs.
## Key Issues
1. **Current Limitation:** Is it possible to instantiate the Poseidon instance during contract initialization (loading all constant data once) and share it across subsequent contract calls? (This approach appears unfeasible with current architecture)
2. **Proposed Solution:** If the above approach is not viable, we should implement native Poseidon hash support in the CosmWasm framework. This would allow the Poseidon instance data to be pre-loaded in the chain's runtime environment, eliminating redundant loading and reducing gas costs.
## Technical Context
- Poseidon hash is particularly important for ZK-related applications and privacy-preserving smart contracts
- The constant data loading during each instantiation creates significant overhead
- Native runtime support could provide both performance benefits and cost reductions
## Desired Outcome
More efficient Poseidon hash implementation in CosmWasm contracts with reduced gas consumption for ZK-related operations.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.