Giter Site home page Giter Site logo

Comments (4)

huitseeker avatar huitseeker commented on September 9, 2024

See also this circom PR (unreviewed): iden3/circomlib#98

from neptune.

porcuquine avatar porcuquine commented on September 9, 2024

Agreed. Here are a few not-entirely-cooked thoughts about how that might best be integrated. Some of this is more about the overall 'container' than a Poseidon 2 implementation per se:

  • Implement such that it's easy to use with SAFE and swap the permutation. In other words, if someone knows they want to use Poseidon 2 in the future and wants to start writing code for that world now — they can do so using SAFE and later swap out the underlying implementation with minimal effort. (Nova is an example of a consumer already using SAFE for its random oracle).
  • Add a merkle-hashing wrapper with similar API (at least in spirit) to existing 'merkle DST' implementations where a simple N-ary hash function is what the application wants (as, for example Filecoin and Lurk) do.
  • Deprecate the old domain-separation tag facility. It's complicated and derives from suggestions made in the first version of the Poseidon paper. Ensuring the various modes are implemented correctly (where still stubs), then ensuring there are no inconsistencies, etc. represents a large implementation and maintenance burden.

Some of the above is not strictly required for Poseidon 2 — but I'm noting it here because it's part of a logical path forward for neptune generally, and is part of what we should consider when deciding how to integrate it.


A separate question is how much of the GPU support for batched hashing (on top of which tree-building is constructed) we would extend to Poseidon 2. The Neptune tree-building is no longer the most optimized (relative to approaches that keep intermediate values on the GPU). Nevertheless, the simple batched hashing is certainly useful when compared to CPU — when parallel hashing is needed.

from neptune.

huitseeker avatar huitseeker commented on September 9, 2024

I think we can split the issue in several steps, in that order:

  • out-of-circuit implementation of Poseidon2 with minimal1 divergence from the existing Poseidon (which helps review & incidentally, witness-gen),
  • in-circuit implementation of Poseidon2 with minimal divergence from the existing Poseidon,
  • SAFE API implementation that can dispatch to Poseidon / Poseidon2,
  • GPU acceleration
  • Merkle-hashing wrapper that can dispatch to Poseidon / Poseidon2,

I think the topics of DST deprecation, while valuable, is an orthogonal problem that deserves its own orthogonal issue.

Footnotes

  1. "Minimal" here means the first priority is correctness, the second is performance, and the third is code reuse / sharing.

from neptune.

porcuquine avatar porcuquine commented on September 9, 2024

That all makes sense to me.

from neptune.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.