Skip to content

Support loading zk-SNARK parameters#4

Merged
ebfull merged 2 commits into
zcash:masterfrom
ebfull:zksnark-param-loading
Apr 19, 2018
Merged

Support loading zk-SNARK parameters#4
ebfull merged 2 commits into
zcash:masterfrom
ebfull:zksnark-param-loading

Conversation

@ebfull
Copy link
Copy Markdown
Collaborator

@ebfull ebfull commented Apr 17, 2018

No description provided.

Copy link
Copy Markdown
Contributor

@str4d str4d left a comment

Choose a reason for hiding this comment

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

utACK, comment about global bool is non-blocking.

Comment thread src/rustzcash.rs
let sprout_vk = prepare_verifying_key(&sprout_vk);

// Caller is responsible for calling this function once, so
// these global mutations are safe.
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.

Or we could set a global bool, and error at the top of this function if it is already set.

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.

Yeah, I think this comment actually may be misleading. It's not necessarily that it should only be called once, it just needs to be called independently of any other calls, to avoid data races.

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.

Opened #5 to address this later.

Comment thread src/rustzcash.rs
sprout_path: *const c_char,
) {
// These should be valid CStr's, but the decoding may fail on Windows
// so we may need to use OSStr or something.
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.

Good to know. I'm happy merging this for now, and then detecting / fixing Windows later once we have CI for it.

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.

Yeah, I don't know how encoding works on Windows, I just know it causes problems that require the use of insane hacks like this.

Comment thread src/rustzcash.rs
let output_params = Parameters::<Bls12>::read(&mut output_fs, false)
.expect("couldn't deserialize Sapling spend parameters file");
let sprout_vk = VerifyingKey::<Bls12>::read(&mut sprout_fs)
.expect("couldn't deserialize Sprout Groth16 verifying key");
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 Parameters is serialized as VerifyingKey || ProvingKey? And for Sprout, we'll just pass the same path in to get both at proving time?

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.

So Parameters is serialized as VerifyingKey || ProvingKey?

Yes.

And for Sprout, we'll just pass the same path in to get both at proving time?

Yes. :)

@ebfull ebfull merged commit 6cc1813 into zcash:master Apr 19, 2018
zkbot added a commit to zcash/zcash that referenced this pull request Apr 20, 2018
Load Sapling testnet parameters into memory

This PR depends on zcash/librustzcash#4.

The parameters are not loaded into memory if `zcashd` is configured as a mainnet node -- this is something we can change in the weeks before `2.0.0`.
str4d referenced this pull request in str4d/librustzcash Aug 28, 2018
Group Hash implementation in the circuit
str4d referenced this pull request in str4d/librustzcash Jan 6, 2019
miodragpop referenced this pull request in miodragpop/librustzcash Apr 25, 2021
Update librustzcash June 2020
nuttycom added a commit that referenced this pull request Nov 5, 2025
…14868de..d978256a2

d978256a2 Merge pull request #1 from zcash/compact_tx_transparent
7eeb82e7c Merge pull request #4 from zcash/add_changelog
a95359dc9 Apply suggestions from code review
592b637a8 Add transparent data to the `CompactBlock` format.
9d1fb2c41 Add a CHANGELOG.md that documents the evolution of the light client protocol.
180717dfa Merge pull request #3 from zcash/merge_librustzcash_history
450bd4181 Merge the history of the .proto files from `librustzcash` for complete history preservation.
a4859d11d Move protobuf files into place for use in `zcash/lightwallet-protocol`
2e66cdd9e Update zcash_client_backend/proto/service.proto
eda012519 fix comment
f838d10ad Add gRPC LightdInfo Donation Address
db12c0415 Merge pull request #1473 from nuttycom/wallet/enrichment_queue
698feba96 Apply suggestions from code review
20ce57ab3 zcash_client_backend: Add `block_height` argument to `decrypt_and_store_transaction`
a6dea1da8 Merge pull request #1482 from zancas/doc_tweak
4d2d45fc9 fix incorrect doc-comment
e826f4740 update CompactBlock doc-comment, to cover non-Sapling shielded notes, and addresses
e9a6c00bf Various documentation improvements
988bc7214 Merge pull request #872 from nuttycom/feature/pre_dag_sync-suggest_scan_ranges
58d07d469 Implement `suggest_scan_ranges` and `update_chain_tip`
a9222b338 Address comments from code review.
e20310857 Rename proto::compact::{BlockMetadata => ChainMetadata}
ac63418c5 Reorganize Sapling and Orchard note commitment tree sizes in CompactBlock.
0fdca14f1 zcash_client_backend: Add note commitment tree sizes to `CompactBlock` serialization.
2a0c2b8b7 zcash_client_backend: Add gRPC bindings behind feature flag
1342f0480 zcash_client_backend: Address compact_formats.proto comments
68aa4e01b zcash_client_backend: Bring in latest `compact_formats.proto`
e712eb1bc Add prevHash field to CompactBlock
440384c3e Build protobufs for compact formats

git-subtree-dir: zcash_client_backend/lightwallet-protocol
git-subtree-split: d978256a2bf33bb5f83846d8994e7377512f5f05
nuttycom added a commit that referenced this pull request Dec 8, 2025
…14868de..23f0768ea

23f0768ea Release lightwallet-protocol v0.4.0
41156c767 Merge pull request #11 from zcash/feature/get_mempool_tx_pools
7c130e883 Add `lightwalletProtocolVersion` field to `LightdInfo` struct.
edbb726d7 Apply suggestion from code review
38fddd73b Apply suggestions from code review
0250f2720 Add pool type filtering to `GetMempoolTx` argument.
54ccaadd5 Change semantics of pool-based pruning of compact transactions from "may prune" to "must prune".
b0667ec99 Merge pull request #9 from zcash/2025-11-doc-TransparentAddressBlockFilter
f3fea7bd4 doc: TransparentAddressBlockFilter doesn't include mempool
a67dd323a Merge pull request #8 from zcash/2025-11-lightdinfo-upgrade-info
11da4b7e3 add next upgrade info to LightdInfo structure (GetLightdInfo)
42cd8f720 Transparent data docs update (#7)
c0cf957ac Merge pull request #5 from zcash/2025-11-comments
912fc3609 Minor clarification in GetBlockRange documentation.
6b03f2cce Documentation (comments) only
d978256a2 Merge pull request #1 from zcash/compact_tx_transparent
7eeb82e7c Merge pull request #4 from zcash/add_changelog
a95359dc9 Apply suggestions from code review
592b637a8 Add transparent data to the `CompactBlock` format.
9d1fb2c41 Add a CHANGELOG.md that documents the evolution of the light client protocol.
180717dfa Merge pull request #3 from zcash/merge_librustzcash_history
450bd4181 Merge the history of the .proto files from `librustzcash` for complete history preservation.
a4859d11d Move protobuf files into place for use in `zcash/lightwallet-protocol`
2e66cdd9e Update zcash_client_backend/proto/service.proto
eda012519 fix comment
f838d10ad Add gRPC LightdInfo Donation Address
db12c0415 Merge pull request #1473 from nuttycom/wallet/enrichment_queue
698feba96 Apply suggestions from code review
20ce57ab3 zcash_client_backend: Add `block_height` argument to `decrypt_and_store_transaction`
a6dea1da8 Merge pull request #1482 from zancas/doc_tweak
4d2d45fc9 fix incorrect doc-comment
e826f4740 update CompactBlock doc-comment, to cover non-Sapling shielded notes, and addresses
e9a6c00bf Various documentation improvements
988bc7214 Merge pull request #872 from nuttycom/feature/pre_dag_sync-suggest_scan_ranges
58d07d469 Implement `suggest_scan_ranges` and `update_chain_tip`
a9222b338 Address comments from code review.
e20310857 Rename proto::compact::{BlockMetadata => ChainMetadata}
ac63418c5 Reorganize Sapling and Orchard note commitment tree sizes in CompactBlock.
0fdca14f1 zcash_client_backend: Add note commitment tree sizes to `CompactBlock` serialization.
2a0c2b8b7 zcash_client_backend: Add gRPC bindings behind feature flag
1342f0480 zcash_client_backend: Address compact_formats.proto comments
68aa4e01b zcash_client_backend: Bring in latest `compact_formats.proto`
e712eb1bc Add prevHash field to CompactBlock
440384c3e Build protobufs for compact formats

git-subtree-dir: zcash_client_backend/lightwallet-protocol
git-subtree-split: 23f0768ea4471b63285f3c0e9b6fbb361674aa2b
S1nus added a commit to S1nus/librustzcash that referenced this pull request Mar 10, 2026
greg0x referenced this pull request in valargroup/librustzcash Mar 12, 2026
greg0x referenced this pull request in valargroup/librustzcash Mar 12, 2026
Co-authored-by: Cursor <cursoragent@cursor.com>
greg0x referenced this pull request in valargroup/librustzcash Mar 12, 2026
greg0x referenced this pull request in valargroup/librustzcash Mar 12, 2026
- Add sentinel injection (k*2^250 for k=0..16) to pir-export to satisfy
  circuit gap-width constraint (#3)
- Change Tier 2 empty-leaf padding from Fp::zero() to -Fp::one() so
  trailing entries sort after real leaves, fixing binary search (#2)
- Make TierServer::answer_query() return Result with input validation
  (length checks, alignment) instead of panicking on malformed
  requests; handlers return HTTP 400 on error (#1)
- Replace unwrap/assert with fallible returns in pir-client and
  Tier0Data::from_bytes (#4)
nuttycom pushed a commit that referenced this pull request Mar 20, 2026
fix(keys): enforce debug redaction for AccountPubKey/UFVK, extend tests, and update changelogs
TyphooN- added a commit to TyphooN-/junocash that referenced this pull request May 24, 2026
Load Sapling testnet parameters into memory

This PR depends on zcash/librustzcash#4.

The parameters are not loaded into memory if `zcashd` is configured as a mainnet node -- this is something we can change in the weeks before `2.0.0`.
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.

2 participants