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

pczt: Define the structure and semantics of the PCZT format #1577

Merged
merged 18 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
140 changes: 136 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ bitvec = "1"
blake2s_simd = "1"
bls12_381 = "0.8"
jubjub = "0.10"
redjubjub = "0.7"
sapling = { package = "sapling-crypto", version = "0.3", default-features = false }

# - Orchard
Expand All @@ -66,10 +67,13 @@ orchard = { version = "0.10", default-features = false }
pasta_curves = "0.5"

# - Transparent
bip32 = { version = "0.5", default-features = false, features = ["secp256k1-ffi"] }
bip32 = { version = "0.5", default-features = false }
ripemd = "0.1"
secp256k1 = "0.27"

# Boilerplate
getset = "0.1"

# CSPRNG
rand = "0.8"
rand_core = "0.6"
Expand Down Expand Up @@ -181,3 +185,7 @@ debug = true

[workspace.lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(zcash_unstable, values("zfuture"))'] }

[patch.crates-io]
orchard = { git = "https://github.com/zcash/orchard.git", rev = "bcd08e1d23e70c42a338f3e3f79d6f4c0c219805" }
sapling-crypto = { git = "https://github.com/zcash/sapling-crypto.git", rev = "f228f52542749ea89f4a7cffbc0682ed9ea4b8d1" }
67 changes: 67 additions & 0 deletions pczt/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,70 @@ license.workspace = true
categories.workspace = true

[dependencies]
zcash_note_encryption = { workspace = true, optional = true }
zcash_primitives = { workspace = true, optional = true }
zcash_protocol = { workspace = true, optional = true }

blake2b_simd = { workspace = true, optional = true }
rand_core = { workspace = true, optional = true }

# Encoding
postcard = { version = "1", features = ["alloc"] }
serde.workspace = true
serde_with = "3"

# Payment protocols
# - Transparent
secp256k1 = { workspace = true, optional = true }

# - Sapling
bls12_381 = { workspace = true, optional = true }
ff = { workspace = true, optional = true }
jubjub = { workspace = true, optional = true }
redjubjub = { workspace = true, optional = true }
sapling = { workspace = true, optional = true }

# - Orchard
nonempty = { workspace = true, optional = true }
orchard = { workspace = true, optional = true }
pasta_curves = { workspace = true, optional = true }

# - Bolierplate
getset = "0.1"

[dev-dependencies]
incrementalmerkletree.workspace = true
secp256k1 = { workspace = true, features = ["rand"] }
shardtree.workspace = true
zcash_primitives = { workspace = true, features = ["test-dependencies", "transparent-inputs"] }
zcash_proofs = { workspace = true, features = ["bundled-prover"] }
zip32.workspace = true

[features]
orchard = [
"dep:ff",
"dep:nonempty",
"dep:orchard",
"dep:pasta_curves",
"dep:zcash_protocol",
]
sapling = [
"dep:bls12_381",
"dep:ff",
"dep:jubjub",
"dep:redjubjub",
"dep:sapling",
"dep:zcash_note_encryption",
"dep:zcash_protocol",
]
transparent = ["dep:secp256k1", "dep:zcash_primitives", "dep:zcash_protocol"]
zcp-builder = ["dep:zcash_primitives", "dep:zcash_protocol"]
io-finalizer = ["orchard", "sapling"]
prover = ["dep:rand_core", "sapling?/temporary-zcashd"]
Copy link
Contributor

@daira daira Dec 3, 2024

Choose a reason for hiding this comment

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

Is the sapling/temporary-zcashd feature dependency strictly necessary? Consider filing an issue (if there isn't one already) against sapling to make the necessary APIs stable.

Copy link
Contributor

@daira daira Dec 6, 2024

Choose a reason for hiding this comment

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

This was previously necessary due to a use of SpendValidatingKey::temporary_zcash_from_bytes, but that appears to have been removed in a recent push, and this branch now compiles for me without the temporary-zcashd feature dependency (using --all-targets --all-features).

Suggested change
prover = ["dep:rand_core", "sapling?/temporary-zcashd"]
prover = ["dep:rand_core"]

Copy link
Contributor

Choose a reason for hiding this comment

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

Still relevant.

signer = ["dep:blake2b_simd", "dep:rand_core", "orchard", "sapling", "transparent"]
spend-finalizer = ["transparent"]
tx-extractor = ["dep:rand_core", "orchard", "sapling", "transparent"]
daira marked this conversation as resolved.
Show resolved Hide resolved

[[test]]
name = "end_to_end"
required-features = ["io-finalizer", "prover", "signer", "tx-extractor"]
Loading
Loading