pysnark icon indicating copy to clipboard operation
pysnark copied to clipboard

Add Example For Poseidon Hash Function

Open AtropineTears opened this issue 3 years ago • 6 comments

Hello,

Could you add an example for producing a proof of the preimage with the Poseidon Hash Function. It would be much appreciated.

Thank you

AtropineTears avatar Nov 11 '21 22:11 AtropineTears

Hi! You can find some examples in the test case: https://github.com/meilof/pysnark/pull/27/files#diff-4d13c5e2b571a105adadc440b54a9aeffe260b317e9fe8bd17d89ba9467d2e84. I hope that helps!

On Thu, Nov 11, 2021 at 11:33 PM AtropineTears @.***> wrote:

Hello,

Could you add an example for producing a proof of the preimage with the Poseidon Hash Function. It would be much appreciated.

Thank you

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/meilof/pysnark/issues/34, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACAJUU7X573HXHAG5OJNBADULRAB7ANCNFSM5H3PUUPA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

--

Meilof -- @.***

meilof avatar Nov 18 '21 18:11 meilof

Hi,

Can you help me? I am trying to implement proving a Poseidon preimage hash but cannot seem to get it to work right.

I am looking at input of 32 bytes that will be hashed and proving that the prover knows the 32 bytes.

Thank you!

AtropineTears avatar Nov 18 '21 18:11 AtropineTears

Is the text example hashing:

0, 1, 2, 3,4

I would like to see a method of hashing a byte string

AtropineTears avatar Nov 18 '21 18:11 AtropineTears

Did you try running the test cases from https://github.com/meilof/pysnark/blob/master/test/test_poseidon_hash.py? Did you try running a simple example program such as https://github.com/meilof/pysnark/blob/master/examples/cube.py? What is going wrong?

On Thu, Nov 18, 2021 at 7:24 PM AtropineTears @.***> wrote:

Is the text example hashing:

0, 1, 2, 3,4

I would like to see a method of hashing a byte string

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/meilof/pysnark/issues/34#issuecomment-973139701, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACAJUU5JUI7TGOSEQKW6QJDUMVAGBANCNFSM5H3PUUPA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

--

Meilof -- @.***

meilof avatar Nov 18 '21 18:11 meilof

Yes,

Can you add Poseidon to the /examples/ folder. I want to see an example of it.

An example would be of proving you know:

333fcb4ee1aa7c115355ec66ceac917c8bfd815bf7587d325aec1864edd24e34d5abe2c6b1b5ee3face62fed78dbef802f2a85cb91d455a8f5249d330853cb3c

preimage, for example

AtropineTears avatar Nov 18 '21 18:11 AtropineTears

I don't know much of python so it is hard of me to use it. I am trying to find out how to hash a preimage and prove it.

AtropineTears avatar Nov 18 '21 19:11 AtropineTears