-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Poseidon2 #40
Comments
If we change poseidon implementations in the SCT post-mainnet, then we'll have to maintain two separate shielded pools forever, which makes me think this is not actually a place where things are particularly agile. Compared to in the key hierarchy, though, I suppose it is. |
I'm not sure that's true — in a hypothetical V2 where we changed the hash function, we could recreate a new SCT with the same leaves but the new hash function, and use that instead. Clients would have to upgrade and re-sync, and the leaf commitment hashes would still be poseidon 1, but that's the less important part of the inclusion proofs. |
Here are the places we currently use Poseidon1 in the protocol categorized by how easy it is to change the hash function: Least agility: Impacts all published addressesWe use rate-2 Poseidon1 to hash the spend authorization key Low-medium agility: Circuit-breaking changesThe next category of places we use Poseidon1 are:
For the SCT, while we can transparently change the hash function used in the tree, since Merkle path verification in the circuits would also need to use the new hash, unless I'm missing something I think this is still a circuit-breaking change, as are the other uses of Poseidon1 in this category. High agility: No major implicationsThe final place we're currently using Poseidon1 which we can easily change is:
We derive two Rseed values in |
This is the `r1cs` branch from our git fork of `ark-sponge`: https://github.com/penumbra-zone/sponge It is unmodified in this commit, changes will be made in the subsequent commits for clarity of the git history. The upstream `ark-sponge` repository is archived because they moved the poseidon implementation to a different repository. In addition, we need to make a lot of changes to get on the upstream impl. This was attempted back in November and at that time we decided to continue using our fork only for the R1CS feature. However, in light of the upcoming migration to Poseidon2, any work resolving the divergence between our fork and the upstream repo would be wasted, as we'll be soon removing Poseidon 1 from `poseidon377`. As such, for stability, we are vendoring our fork of `ark-sponge` on a temporary basis such that we can release `poseidon377` unchanged to crates, then pin all penumbra repositories to that release. Afterwards, we will proceed with migrating to Arkworks 0.4.x release series [0] and migrating to Poseidon2 [1]. [0] penumbra-zone/penumbra#2004 [1] #40
This is the `r1cs` branch from our git fork of `ark-sponge`: https://github.com/penumbra-zone/sponge It is unmodified in this commit, changes will be made in the subsequent commits for clarity of the git history. The upstream `ark-sponge` repository is archived because they moved the poseidon implementation to a different repository. In addition, we need to make a lot of changes to get on the upstream impl. This was attempted back in November and at that time we decided to continue using our fork only for the R1CS feature. However, in light of the upcoming migration to Poseidon2, any work resolving the divergence between our fork and the upstream repo would be wasted, as we'll be soon removing Poseidon 1 from `poseidon377`. As such, for stability, we are vendoring our fork of `ark-sponge` on a temporary basis such that we can release `poseidon377` unchanged to crates, then pin all penumbra repositories to that release. Afterwards, we will proceed with migrating to Arkworks 0.4.x release series [0] and migrating to Poseidon2 [1]. [0] penumbra-zone/penumbra#2004 [1] #40
There's another version of Poseidon, called Poseidon2:
https://eprint.iacr.org/2023/323
Most relevant for us is section 7.3 which discusses mitigating the attacks found here where the researchers are able to skip 2 rounds of Poseidon 1. Note that the current additional security margin in Poseidon 1 (added in case new attacks are found) is 2 full rounds and 7.5% additional partial rounds.
This ticket is to evaluate whether we should migrate to Poseidon2 prior to mainnet launch, given that we do not want to change hash functions after launch.
Sub tasks:
The text was updated successfully, but these errors were encountered: