Skip to content

Expose API for merkle hash#3

Merged
str4d merged 4 commits into
zcash:masterfrom
ebfull:params-and-merkle-hash
Apr 15, 2018
Merged

Expose API for merkle hash#3
str4d merged 4 commits into
zcash:masterfrom
ebfull:params-and-merkle-hash

Conversation

@ebfull
Copy link
Copy Markdown
Collaborator

@ebfull ebfull commented Apr 12, 2018

No description provided.

Comment thread include/librustzcash.h Outdated
/// Initializes some parameters for sapling-crypto,
/// returning a pointer to the parameters. You should
/// free this when you're done with
/// `librustzcash_init_params()`.
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.

librustzcash_free_params

Comment thread src/rustzcash.rs Outdated
).into_xy().0.into_repr();

// Should be okay, caller is responsible for ensuring the pointer
// is valid.
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.

is a valid pointer to 32 bytes.

Comment thread src/rustzcash.rs
}

let tmp = pedersen_hash::<Bls12, _>(
Personalization::MerkleTree(depth),
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.

What happens if a depth larger than 62 is passed in? Relatedly, how do panics unroll into the C++ code - as segfaults?

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.

If a depth larger than 62 is passed in, undefined behavior. Probably a segfault.

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.

Could we add a panic!() if the provided depth is larger than 62?

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.

The code this calls will panic if the depth is larger then 62.

@ebfull
Copy link
Copy Markdown
Collaborator Author

ebfull commented Apr 12, 2018

I configured it to abort the process on panics, rather than causing chaos downstream over the FFI boundary. Also enabled link-time optimizations so the static lib is smaller.

Comment thread src/rustzcash.rs

lazy_static! {
static ref JUBJUB: JubjubBls12 = {
JubjubBls12::new()
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.

Just to confirm, this is only the Jubjub parameters? The Sapling and Sprout CRSs will be loaded/unloaded via pointers? Or will the Sapling CRS be similarly statically-loaded?

Copy link
Copy Markdown
Contributor

@str4d str4d Apr 15, 2018

Choose a reason for hiding this comment

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

@ebfull and I discussed this. The Sapling and Sprout CRSs will be loaded via an API through which zcashd passes the paths to the params. Both verification keys along with the Sapling proving key will be loaded into memory immediately, while the Sprout proving key will be loaded and unloaded on-demand.

@ebfull ebfull changed the title Expose API for init/free of parameters Expose API for merkle hash Apr 13, 2018
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.

@str4d str4d requested review from daira and gtank and removed request for daira and gtank April 15, 2018 01:06
@str4d
Copy link
Copy Markdown
Contributor

str4d commented Apr 15, 2018

@daira ACKed zcash/zcash#3169 which includes this.

@str4d str4d merged commit 2a86c91 into zcash:master Apr 15, 2018
ebfull added a commit to ebfull/librustzcash that referenced this pull request Feb 23, 2019
Fq inverse (addition chain for fq)
str4d added a commit that referenced this pull request Feb 26, 2019
swasilyev added a commit to paritytech/librustzcash that referenced this pull request Mar 20, 2020
str4d added a commit that referenced this pull request Jun 4, 2021
ZIP-225/244 #3: Create separate bundles for each part of the transaction.
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
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