Skip to content

feat: add NuTachyon support to forked librustzcash crates - #178

Open
S1nus wants to merge 18 commits into
mainfrom
c/nu-tachyon
Open

feat: add NuTachyon support to forked librustzcash crates#178
S1nus wants to merge 18 commits into
mainfrom
c/nu-tachyon

Conversation

@S1nus

@S1nus S1nus commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

Motivation

Add experimental NuTachyon support to the forked librustzcash crates used by
Zakura. This includes ZIP-233-compatible V7 transactions containing Tachyon
bundles and the V4 history-tree format needed to commit to Tachyon state.

Overview

  • Adds a cfg-gated zcash_tachyon::TachyonBundle to transaction data, using
    TachyonBundle::NoBundle to represent absence.
  • Makes V7 follow V6's ZIP-233 header format when the NU7 configuration and
    zip-233 feature are enabled.
  • Includes Tachyon bundle serialization, value balance accounting,
    transaction IDs, signature hashes, and authorization digests.
  • Pins cross-implementation serialization vectors generated by Zakura for
    empty, Adjunct, single-action Proven, and multi-action Proven V7 bundles.
  • Forks zcash_history as zakura-history and adds cfg-gated NuTachyon V4
    history nodes, including Tachyon anchors and transaction counts.
  • Adds the new crate to workspace CI, maintenance, documentation, and package
    metadata.

All experimental Tachyon behavior is gated by
zcash_unstable="nutachyon". ZIP-233 support additionally uses the existing
zcash_unstable="nu7" configuration and zip-233 feature.

Follow-up Work

  • The transaction builder currently initializes Tachyon bundles to
    TachyonBundle::NoBundle. V7 transactions with Tachyon bundles can be
    constructed without the builder; builder support will be added separately.
  • Complete the required supply-chain audits for the git-sourced Tachyon stack
    and the new history dependencies.

Dependencies

  • Uses zcash/librustzcash main,
    pinned at c7235b1fc4b4296b8af2e26bf2f6adb24f873f56. The Tachyon bundle and V4
    history changes not yet present upstream are maintained in this repository's
    forks.
  • zakura-core/zakura#795
    pins this PR and adds the node-side NuTachyon and V7 support.

Validation

  • cargo +1.91.0 test -p zakura-history --all-features --locked
  • NuTachyon-gated zakura-history tests on Rust 1.91.0
  • NU7+NuTachyon-gated zakura-primitives tests on Rust 1.97.1
  • NuTachyon-only zakura-primitives tests on Rust 1.97.1, including exact Zakura V7 serialization vectors
  • Focused Clippy with warnings denied for both changed crates
  • zakura-history no-std build for thumbv7em-none-eabihf
  • Formatting, Markdown lint, and changelog policy checks

@S1nus
S1nus marked this pull request as ready for review August 24, 2026 18:31
@S1nus S1nus changed the title feat: add NuTachyon librustzcash forks feat: add V7 support to forked librustzcash crates Aug 28, 2026
@S1nus S1nus added rust Pull requests that update rust code dependencies Pull requests that update a dependency file labels Aug 28, 2026
@socket-security

socket-security Bot commented Sep 1, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedcargo/​primitive-types@​0.12.210010093100100
Addedcargo/​zcash_encoding@​0.5.010010093100100

View full report

@S1nus S1nus changed the title feat: add V7 support to forked librustzcash crates feat: add NuTachyon support to forked librustzcash crates Sep 1, 2026
@TalDerei
TalDerei self-requested a review September 2, 2026 11:34

@TalDerei TalDerei left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

left some observations that need to be fixed.

Comment thread crates/zcash_history/src/lib.rs
Comment on lines +296 to +314
/// V4 node metadata.
///
/// This extends the NU6.3 history node format with metadata for the Tachyon
/// shielded pool. Tachyon has no note commitment tree; its pool state is a
/// running anchor, so the anchor takes the place a tree root has for the other
/// pools.
#[cfg(zcash_unstable = "nutachyon")]
#[derive(Debug, Clone, Default)]
#[cfg_attr(test, derive(PartialEq, Eq))]
pub struct V4 {
/// The V3 node data retained in V4.
pub v3: V3,
/// Tachyon anchor at the start of this node's interval.
pub start_tachyon_anchor: [u8; 32],
/// Tachyon anchor at the end of this node's interval.
pub end_tachyon_anchor: [u8; 32],
/// Number of transactions containing a Tachyon bundle.
pub tachyon_tx: u64,
}

@TalDerei TalDerei Sep 2, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I know this copies V3's structure, but something came to mind when thinking about the tachyon_tx field that sources back to a previous zebra review tachyon-zcash/zebra#32 (comment).

This PR documents bundle presence and zakura-core/zakura#795 calculates bundle presence. For Ironwood, a present bundle implies at least one action

/// A bundle of actions to be applied to the ledger.
#[derive(Clone)]
pub struct Bundle<T: Authorization, V> {
/// The list of actions that make up this bundle.
actions: NonEmpty<Action<T::SpendAuth>>,
/// Orchard-specific transaction-level flags for this bundle.

but we're breaking that equivalence by allowing a bundle with zero actions. I don't know if that's the right decision or how deeply this decision is grounded in our proof tree? cc @turbocrime

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this still hasn't been addressed and is an open question, but shouldn't block PR. can we put a todo comment?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

can we rebase over main and exercise CI now that zakura-core/zakura#903?

Comment thread crates/zcash_primitives/src/transaction/mod.rs
Comment thread crates/zcash_primitives/src/transaction/mod.rs
Comment thread crates/zcash_primitives/src/transaction/components/tachyon.rs
pub tachyon_tx: u64,
}

#[cfg(zcash_unstable = "nutachyon")]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

so there's a coverage gap in CI. experimental nutachyon requires MSRV 1.97 (since it's inheriting downstream configs as a cfg-gated zcash_tachyon) so it doesn't build zakura-primitives with that configuration in CI since that crate requires MSRV 1.91.

we should ideally bump MSRV for entire common, but we can just have a separate CI job that builds and tests the tachyon enabled zakura-primitives using rust 1.97.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Bumping it seems better

Comment thread crates/zcash_primitives/src/transaction/tests.rs

@TalDerei TalDerei left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

another round

Comment on lines +296 to +314
/// V4 node metadata.
///
/// This extends the NU6.3 history node format with metadata for the Tachyon
/// shielded pool. Tachyon has no note commitment tree; its pool state is a
/// running anchor, so the anchor takes the place a tree root has for the other
/// pools.
#[cfg(zcash_unstable = "nutachyon")]
#[derive(Debug, Clone, Default)]
#[cfg_attr(test, derive(PartialEq, Eq))]
pub struct V4 {
/// The V3 node data retained in V4.
pub v3: V3,
/// Tachyon anchor at the start of this node's interval.
pub start_tachyon_anchor: [u8; 32],
/// Tachyon anchor at the end of this node's interval.
pub end_tachyon_anchor: [u8; 32],
/// Number of transactions containing a Tachyon bundle.
pub tachyon_tx: u64,
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this still hasn't been addressed and is an open question, but shouldn't block PR. can we put a todo comment?

Comment on lines +296 to +314
/// V4 node metadata.
///
/// This extends the NU6.3 history node format with metadata for the Tachyon
/// shielded pool. Tachyon has no note commitment tree; its pool state is a
/// running anchor, so the anchor takes the place a tree root has for the other
/// pools.
#[cfg(zcash_unstable = "nutachyon")]
#[derive(Debug, Clone, Default)]
#[cfg_attr(test, derive(PartialEq, Eq))]
pub struct V4 {
/// The V3 node data retained in V4.
pub v3: V3,
/// Tachyon anchor at the start of this node's interval.
pub start_tachyon_anchor: [u8; 32],
/// Tachyon anchor at the end of this node's interval.
pub end_tachyon_anchor: [u8; 32],
/// Number of transactions containing a Tachyon bundle.
pub tachyon_tx: u64,
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

can we rebase over main and exercise CI now that zakura-core/zakura#903?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file rust Pull requests that update rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants