Rename sk_iss to imk, the IssuanceKey struct to IssuanceMasterKey, and move to a two key structure#92
Conversation
PR Summary
The changes aim to improve determinism and randomness in various functions, thereby optimizing the algorithm performance. |
There was a problem hiding this comment.
This Pr seems inconsistent with our current spec and with the previous version of the zips.
We have two options here:
- Align the number of issuance key components to two. With redpalas as the underling curve. There is no
IssuanceAuthorizingKeyin the zip, isn't it? - Redact this PR and merge as part of your bigger PR.
I prefer the first option since we need the external interface as fast as possible.
src/bundle/burn_validation.rs
Outdated
| let sk_iss = IssuanceKey::from_bytes([0u8; 32]).unwrap(); | ||
| let isk: IssuanceAuthorizingKey = (&sk_iss).into(); | ||
| let imk = IssuanceMasterKey::from_bytes([0u8; 32]).unwrap(); | ||
| let isk: IssuanceAuthorizingKey = (&imk).into(); |
There was a problem hiding this comment.
we have no isk in the spec. We need to have only two components: imk and ik.
This PR should reflect it.
src/issuance.rs
Outdated
| let incorrect_sk_iss = IssuanceKey::random(&mut rng); | ||
| let incorrect_isk: IssuanceAuthorizingKey = (&incorrect_sk_iss).into(); | ||
| let incorrect_imk = IssuanceMasterKey::random(&mut rng); | ||
| let incorrect_isk: IssuanceAuthorizingKey = (&incorrect_imk).into(); |
There was a problem hiding this comment.
This seems inconsistent. In the zip we have imk -> ik.
src/keys.rs
Outdated
| /// [orchardkeycomponents]: https://zips.z.cash/protocol/nu5.pdf#orchardkeycomponents | ||
| #[derive(Debug, Copy, Clone)] | ||
| pub struct IssuanceKey([u8; 32]); | ||
| pub struct IssuanceMasterKey([u8; 32]); |
There was a problem hiding this comment.
the documentation should point to our version of the spec with the write paragraph link.
There was a problem hiding this comment.
Please make sure that all newly added key components are properly documented.
sk_iss to imk and the IssuanceKey struct to IssuanceMasterKeysk_iss to imk, the IssuanceKey struct to IssuanceMasterKey, and move to a two key structure
src/keys.rs
Outdated
| /// Checks whether the Orchard-ZSA issuance key is valid //TODO: What are the criteria? | ||
| pub fn is_valid(self) -> Choice { | ||
| 1u8.into() | ||
| } |
There was a problem hiding this comment.
let's remove is_valid() and use CtOption::new(isk, true.into())
…izingKey`, and move to a two key structure (#92) This performs a consistent renaming of the issuance authorizing key to make it consistent with the ZIP. It also reworks the `IssuanceAuthorizingKey` struct in place of the `IssuanceKey` and `IssuanceAuthorizingKey` structs, as part of using a two key structure for issuance, as specified in ZIP 227.
This PR performs a consistent renaming of the issuance master key to make it consistent with the ZIP.
It also removes the
IssuanceAuthorizingKeystruct as part of using a two key structure for issuance, as specified in ZIP 227.