Zcash Rust crates

This repository contains a (work-in-progress) set of Rust crates for working with Zcash.

⚠️ IMPORTANT: The only way to check Zcash consensus validity is to use a Zcash consensus node. ⚠️

The public API surfaces of these crates include many APIs that are used by the zcashd and Zebra node implementations, as well as other critical components in the Zcash ecosystem, but none of them expose any way to check consensus validity of transactions. In particular, APIs for parsing transactions only check a subset of validity constraints. The specific subset they check is not sufficient to guarantee any meaningful user-level validity constraints, and is not necessarily stable over time, or consistent with other implementations of parsers for Zcash transactions.

graph TB
    subgraph librustzcash
        direction TB
        subgraph main
            zcash_address
            zcash_primitives
            zcash_transparent
            zcash_proofs
            zcash_protocol
            pczt
            zcash_client_backend
            zcash_client_sqlite
            zcash_keys
            zip321
        end

        subgraph standalone_components
            equihash
            f4jumble
            zcash_encoding
        end
    end

    subgraph shielded_protocols
        sapling-crypto
        orchard
    end

    subgraph protocol_components
        zcash_note_encryption
        zip32
        zcash_spec
    end

    %% Direct edges that also have a transitive path are left in (so the linter checks
    %% they are deliberate edges) but commented out (to simplify the graph).

    zcash_client_sqlite --> zcash_client_backend

    zcash_client_backend --> pczt

    %% zcash_client_sqlite --> zcash_keys
    zcash_client_backend --> zcash_keys

    zcash_client_backend --> zcash_proofs

    zcash_proofs --> zcash_primitives
    pczt --> zcash_primitives
    %% zcash_client_backend --> zcash_primitives
    %% zcash_client_sqlite --> zcash_primitives

    %% zcash_client_sqlite --> zcash_transparent
    %% zcash_client_backend --> zcash_transparent
    %% pczt --> zcash_transparent
    zcash_keys --> zcash_transparent
    zcash_primitives --> zcash_transparent

    zcash_client_backend --> zip321

    zcash_transparent --> zcash_address
    %% zcash_keys --> zcash_address
    %% zcash_client_backend --> zcash_address
    %% zcash_client_sqlite --> zcash_address
    zip321 --> zcash_address

    %% zcash_transparent --> zcash_protocol
    %% zcash_keys --> zcash_protocol
    %% zcash_client_sqlite --> zcash_protocol
    %% zcash_primitives --> zcash_protocol
    %% zcash_client_backend --> zcash_protocol
    %% pczt --> zcash_protocol
    zcash_address --> zcash_protocol
    %% zip321 --> zcash_protocol

    %% zcash_client_sqlite --> zcash_encoding
    %% zcash_transparent --> zcash_encoding
    %% zcash_client_backend --> zcash_encoding
    %% zcash_keys --> zcash_encoding
    %% zcash_primitives --> zcash_encoding
    %% zcash_address --> zcash_encoding
    zcash_protocol --> zcash_encoding

    zcash_primitives --> equihash
    zcash_address --> f4jumble

    %% zcash_client_backend --> orchard
    %% pczt --> orchard
    zcash_keys --> orchard
    zcash_primitives --> orchard
    %% zcash_client_sqlite --> orchard

    %% zcash_client_sqlite --> sapling-crypto
    %% zcash_client_backend --> sapling-crypto
    zcash_keys --> sapling-crypto
    %% zcash_proofs --> sapling-crypto
    zcash_primitives --> sapling-crypto
    %% pczt --> sapling-crypto

    orchard --> zcash_note_encryption
    sapling-crypto --> zcash_note_encryption
    %% zcash_primitives --> zcash_note_encryption
    %% pczt --> zcash_note_encryption
    %% zcash_client_backend --> zcash_note_encryption

    %% zcash_client_sqlite --> zip32
    %% zcash_client_backend --> zip32
    %% zcash_keys --> zip32
    orchard --> zip32
    sapling-crypto --> zip32
    zcash_transparent --> zip32

    %% zcash_transparent --> zcash_spec
    %% orchard --> zcash_spec
    %% sapling-crypto --> zcash_spec
    zip32 --> zcash_spec

    main --> standalone_components

    librustzcash --> shielded_protocols
    shielded_protocols --> protocol_components

    click equihash "https://docs.rs/equihash/" _blank
    click f4jumble "https://docs.rs/f4jumble/" _blank
    click orchard "https://docs.rs/orchard/" _blank
    click pczt "https://docs.rs/pczt/" _blank
    click sapling-crypto "https://docs.rs/sapling-crypto/" _blank
    click zcash_address "https://docs.rs/zcash_address/" _blank
    click zcash_encoding "https://docs.rs/zcash_encoding/" _blank
    click zcash_client_backend "https://docs.rs/zcash_client_backend/" _blank
    click zcash_client_sqlite "https://docs.rs/zcash_client_sqlite/" _blank
    click zcash_keys "https://docs.rs/zcash_keys/" _blank
    click zcash_note_encryption "https://docs.rs/zcash_note_encryption/" _blank
    click zcash_primitives "https://docs.rs/zcash_primitives/" _blank
    click zcash_proofs "https://docs.rs/zcash_proofs/" _blank
    click zcash_protocol "https://docs.rs/zcash_protocol/" _blank
    click zcash_spec "https://docs.rs/zcash_spec/" _blank
    click zcash_transparent "https://docs.rs/zcash_transparent/" _blank
    click zip321 "https://docs.rs/zip321/" _blank
    click zip32 "https://docs.rs/zip32/" _blank

Crates

librustzcash: a Rust Crates Walkthrough w/ nuttycom

Zcash Protocol

Keys, Addresses & Wallet Support

Utilities & Common Dependencies

Security Warnings

These libraries are under development and have not been fully reviewed.

License

All code in this workspace is licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.