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

Implement PCZT support #146

Merged
merged 6 commits into from
Dec 12, 2024
Merged

Implement PCZT support #146

merged 6 commits into from
Dec 12, 2024

Conversation

str4d
Copy link
Contributor

@str4d str4d commented Nov 28, 2024

No description provided.

@str4d
Copy link
Contributor Author

str4d commented Dec 3, 2024

Force-pushed to fix a bug and add missing serialization methods.

@str4d str4d force-pushed the pczt branch 2 times, most recently from 5c45f48 to 290408a Compare December 3, 2024 00:36
@str4d
Copy link
Contributor Author

str4d commented Dec 3, 2024

Force-pushed to change Output::rseed to return &[u8; 32] instead of Rseed (and internally enforce that builders used to generate PCZTs require post-ZIP 212 outputs).

src/pczt/io_finalizer.rs Outdated Show resolved Hide resolved
@str4d
Copy link
Contributor Author

str4d commented Dec 3, 2024

Force-pushed to fix some bugs.

@str4d str4d marked this pull request as ready for review December 3, 2024 12:39
Copy link
Contributor

@nuttycom nuttycom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK 7696219 with nonblocking public API future compatibility question.

///
/// Once we have memo bundles, we will be able to set memos independently of Outputs.
/// For now, the Constructor sets both at the same time.
pub(crate) enc_ciphertext: [u8; ENC_CIPHERTEXT_SIZE],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should Output be polymorphic in the type here just so that the type doesn't have to change with ZIP 231?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have the time to design that such that I can ensure it's forward compatible. And we'll need to change much of the rest of the API anyway, so this isn't much extra.

Copy link
Contributor

@daira daira Dec 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For Orchard both ciphertexts are Vec<u8>. Isn't it better to do the same here for consistency? Non-blocking.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

src/builder.rs Outdated Show resolved Hide resolved
str4d and others added 3 commits December 5, 2024 17:07
This is needed in order to permit spending of internal notes after the
previous change to `Builder::add_spend`.
src/builder.rs Show resolved Hide resolved
rng: impl RngCore,
) -> Result<(crate::pczt::Bundle, SaplingMetadata), Error> {
match self.zip212_enforcement {
Zip212Enforcement::Off | Zip212Enforcement::GracePeriod => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why fail in the grace period? (Non-blocking; only matters in practice for tests.)

let rk = redjubjub::VerificationKey::from(&rsk);

if self.rk == rk {
self.spend_auth_sig = Some(rsk.sign(rng, &sighash));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I went down a rabbit hole here verifying that zcash/librustzcash#179 is fixed. It is.

Copy link
Contributor

@daira daira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK with non-blocking comments.

@str4d str4d merged commit e177a08 into main Dec 12, 2024
23 checks passed
@str4d str4d deleted the pczt branch December 12, 2024 02:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants