Closed m-kus closed 1 month ago
@m-kus can you please assign this issue to me?
How is the progress @ScottyDavies ? Do you need help with this task?
It’s going fine, I would be done soon
@ScottyDavies how is it going? Do you need any help? Please let us know when do you expect to complete this issue.
Can I work on this issue? My PR #142 is almost done.
Hey @bloomingpeach! Thanks for showing interest. We've created an application for you to contribute to Raito - Bitcoin ZK Client. Go check it out on OnlyDust!
Hey @od-hunter! Thanks for showing interest. We've created an application for you to contribute to Raito - Bitcoin ZK Client. Go check it out on OnlyDust!
@bloomingpeach ideally you'd need to wait for #144 to be merged to use it for serialization
Hi, @m-kus, could you help me a little bit on this issue? what hash function should I use and should I introduce a new struct for the purpose of implement the HashState
trait?
@bloomingpeach Hash
trait is agnostic to the particular hash function, it just allows to update hash state with a value of a given type. You can use Poseidon in unit tests for example.
You can find more info here: https://book.cairo-lang.org/ch11-04-hash.html#working-with-hashes
Here is an example of how Hash
is implemented for a new type: https://github.com/starkware-libs/cairo/blob/004d2b4627b6a06a72f837957f0970cdd49d01d7/corelib/src/hash.cairo#L92
Note that you can also derive hash like #[derive(Hash)]
as long as all members also implement it.
Maybe it will be enough to just implement Hash
for @ByteArray
(see how Serde
is implemented for @ByteArray
in types::transaction) and derive for the rest of the types.
We will need to calculate hashes of outpoints to update Utreexo accumulator and local cache.
Hash trait: https://github.com/starkware-libs/cairo/blob/93221753088d58f54f9a7f35a0bb338cf0bfb952/corelib/src/hash.cairo#L13
Hints:
hash::Hash
toDigest
to avoid confusionSerde::serialize
to convertOutpoint
into array of feltsSuggested deadline: 9 Sep