Avatar
Yuki Kishimoto
68d81165918100b7da43fc28f7d1fc12554466e1115886b9e7bb326f65ec4272
GitHub: https://github.com/yukibtc PGP: 86F3 105A DFA8 AB58 7268 DCD7 8D3D CD04 2496 19D1

Not too much time ago the WEF said that they have to focus on the water emergency... because the climate change it's too abstract to understand for someone... 🀑🀑

No, the ID and signature are the same but the pubkey it's different so one of those events it's invalid

Thank you Anon for the recurring donations for the Nostr SDK 🧑⚑

Replying to 21823843...

This is awesome, thank you!

I'm trying to create a harness for this so we can run it against the test-suite used by the C++ and JS implementations. For example, here's the C++ harness:

https://github.com/hoytech/negentropy/blob/master/test/cpp/harness.cpp

This is as far as I got:

https://gist.github.com/hoytech/96e65fc488fc39c2e782830f38727391

This is pretty much the first Rust code I've ever written, sorry about the bad quality. The problem I'm running into is that the reconcile() and reconcile_with_ids() methods seem to return String. If I understand rightly, Rust strings must be utf-8 encoded right?

In the current implementations, the reconcile messages must be in an 8-bit clean medium (or hex encoded). Same with the IDs (since they are typically hash function outputs). In C++ I use std::string because this allows any u8 values (and doesn't care anywhere about utf-8). In JS I allow Uint8Array values *or* hex-encoded strings.

Can we make the rust interface standardise on something 8-bit clean? Vec or some such? Or it's very possible I'm misinterpreting the code here. Any pointers are very much appreciated.

Thank you. I'm still improving and studying better the negentropy protocol.

I converted the code from C++ to Rust in basically a day and half (I'm not a C++ dev so some thing could be converted badly) and are there some things to fix/improve.

Like, I noticed an unstable performance with reconcilie_with_ids method with a set of 50000 items: it usually took 600 ms the final reconciliation but often it took 2 or 4 secs (executing exactly the same code).

Thanks, I'll replace the String with a vector.

BTW, I'm planning to release also bindings for some languages (Kotlin, Swift and Python) using UniFFI, like I have done for rust-nostr libraries.

From my understanding (I can worng), range-based set reconciliation (negenteopy) are good with small set, while BCH-based (minisketch) works better with large set and provide error correction.

Maybe nostr:npub1yxprsscnjw2e6myxz73mmzvnqw5kvzd5ffjya9ecjypc5l0gvgksh8qud4 can correct me or add some more info.

Replying to Avatar Wilfred Allyn

nostr:npub1drvpzev3syqt0kjrls50050uzf25gehpz9vgdw08hvex7e0vgfeq0eseet what's a good first issue to work on for rust-nostr? learning rust and know python

Hey, I think a good starting point to start working on rust-nostr libs, it's to try implement an easy NIP (like the NIP-30).