cashubtc / nuts

Cashu protocol specifications https://cashubtc.github.io/nuts/
MIT License
152 stars 52 forks source link

NUT-02: Test Vectors #13

Closed clarkmoody closed 1 year ago

clarkmoody commented 1 year ago

The spec should include test vectors for generating a keyset and deriving the keyset ID. A small MAX_ORDER would be fine to illustrate the concept.

callebtc commented 1 year ago

The spec should include test vectors for generating a keyset and deriving the keyset ID. A small MAX_ORDER would be fine to illustrate the concept.

That would be a good idea. I can refer to the tests in nutshell here: https://github.com/cashubtc/cashu/blob/c3752fb20aeca448831c24b82b8777f2df90f303/tests/test_mint.py#L55

And here for the individual crypto steps:

https://github.com/cashubtc/cashu/blob/main/tests/test_crypto.py

I agree, we should define vectors in this repo though.

thunderbiscuit commented 1 year ago

I was coming to the repo to ask about exactly this (test vectors in general, not just for NUT-02). Would be great to have a bunch here and easier to develop with than to dig into the Python/TypeScript/Go/Rust libraries for their tests (although they're all fairly easy to find).

I'm not sure how best to add those, but here's a start: #18. Let me know if you'd prefer a different format/approach. I tried to take inspiration from the BIP-32 Test Vectors.

thunderbiscuit commented 1 year ago

Test vectors for exactly this (keysets) are being added in #27. Let me know if you'd like to add more variations.

callebtc commented 1 year ago

Thank you! I'll close this issue for now since we have test vectors now!