Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API changes required for FROST #430

Open
conradoplg opened this issue Jul 29, 2024 · 3 comments
Open

API changes required for FROST #430

conradoplg opened this issue Jul 29, 2024 · 3 comments
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.

Comments

@conradoplg
Copy link

conradoplg commented Jul 29, 2024

I've updated our signing tool to the latest ECC crates and mapped out the API changes that are required in this crate:

  • Allowing constructing a SpendValidatingKey from bytes. Done in Allow SpendValidatingKey to be constructed from bytes #428
  • Allow creating a FullViewingKey from a given SpendValidatingKey. The other components can be randomly generated, but there may be some utility in specifying them too. Done in Allow creating a FullViewingKey from a given SpendValidatingKey #432
    • Locally I did this by adding a FullViewingKey::from_sk_ak(sk: &SpendingKey, ak: SpendValidatingKey) method, but not sure what is the best approach.
  • Allow creating a UnifiedFullViewingKey from a FullViewingKey. Done in [#1477] Allow Orchard-only UFVK be created from an Orchard FVK librustzcash#1478
  • Allowing getting the generated randomizers (alphas) (done in add SigningParts getters #433), or preferrably, allow specifying which alphas to use.
    • I did the former by adding a alpha() getter to SigningParts (also added ak() getter which is useful to sanity check if I'm accessing the right SigningParts). The latter would be more complicated and would require passing the alphas in Builder::build() (which is awkward) or doing some refactoring.
    • (This might be moot now, see comment below) The reason the latter would be preferred is that Re-randomized FROST specifies a mechanism to generate alphas from the FROST signing package along with randomness, making sure that different packages will have different alphas. But the crate seems to assume that randomness will always be generated correctly (which is a fair assumption in this context) so this might not be needed.
    • While writing this I also realized that this crate does not seem to strictly follow Zcash's spec on how the alpha is generated (it doesn't use the H* hash function). Again, not a big deal for the same reason.

My intention is to spark discussion on these API changes but let me know if you'd prefer individual tickets for each of those. I can also create PRs if you're happy with the proposed APIs or can also create PRs with other APIs you suggest.

@conradoplg
Copy link
Author

I realized there is a chicken-and-egg problem regarding the second approach to alpha handling:

  • The sighash, which is the thing FROST signs, depends on rk, which depends on alpha
  • The "FROST alpha generation" requires the SigningPackage, which contains the message, which is the sighash

So it seems the "FROST alpha generation" can't be used.

@pacu
Copy link
Contributor

pacu commented Jul 31, 2024

please edit:

pacu added a commit to pacu/orchard that referenced this issue Jul 31, 2024
Allows creating a FullViewingKey from a given SpendValidatingKey and
from the other components which can be randomly generated, but there
may be some utility in specifying them too like supporting FROST backup
schemes that don't centralize spend authority

closes zcash#431

see related zcash#430
@pacu
Copy link
Contributor

pacu commented Jul 31, 2024

please edit:
Allow creating a FullViewingKey from a given SpendValidatingKey. The other components can be randomly generated, but there may be some utility in specifying them too.
Locally I did this by adding a FullViewingKey::from_sk_ak(sk: &SpendingKey, ak: SpendValidatingKey) method, but not sure what is the best approach.

#432

pacu added a commit to pacu/orchard that referenced this issue Aug 2, 2024
Allows creating a FullViewingKey from a given SpendValidatingKey and
from the other components which can be randomly generated, but there
may be some utility in specifying them too like supporting FROST backup
schemes that don't centralize spend authority

closes zcash#431

see related zcash#430
pacu added a commit to pacu/orchard that referenced this issue Aug 2, 2024
Allows creating a FullViewingKey from a given SpendValidatingKey and
from the other components which can be randomly generated, but there
may be some utility in specifying them too like supporting FROST backup
schemes that don't centralize spend authority

closes zcash#431

see related zcash#430

PR Suggestions
pacu added a commit to pacu/orchard that referenced this issue Aug 17, 2024
Allows creating a FullViewingKey from a given SpendValidatingKey and
from the other components which can be randomly generated, but there
may be some utility in specifying them too like supporting FROST backup
schemes that don't centralize spend authority

closes zcash#431

see related zcash#430

PR Suggestions
@mpguerra mpguerra added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

No branches or pull requests

3 participants