Skip to content

Draft: Add Android coinholder polling backend#1924

Closed
greg0x wants to merge 8 commits into
zcash:mainfrom
valargroup:shielded-vote
Closed

Draft: Add Android coinholder polling backend#1924
greg0x wants to merge 8 commits into
zcash:mainfrom
valargroup:shielded-vote

Conversation

@greg0x

@greg0x greg0x commented Apr 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add the Android SDK voting backend for coinholder polling
  • expose voting recovery, Keystone, and share-tracking primitives needed by the app flow
  • harden Android voting state transitions for round prep, resume, and multi-proposal submission parity

Issues

Companion PRs

  • companion app PR: zodl-inc/zodl-android#2206

Recording

Notes

  • this branch includes the original MOB-1108 SDK backend work plus the additional parity and recovery fixes needed to get live Android voting through end-to-end testing

Testing

  • ./gradlew :sdk-lib:assembleDebug

@greg0x greg0x marked this pull request as ready for review April 28, 2026 21:03
@greg0x greg0x changed the title Draft: Add Android coinholder polling backend Add Android coinholder polling backend Apr 28, 2026
greg0x added a commit that referenced this pull request May 7, 2026
Bring the Android Rust backend onto the released zcash_voting dependency line needed for shielded voting while keeping the initial JNI surface intentionally narrow.

The exposed VotingRustBackend.computeShareNullifier symbol is a pure linkage check over caller-supplied bytes. It proves Android can resolve, link, and dispatch into zcash_voting without adding wallet database access, voting database lifecycle, PIR or tree-sync networking, or a public SDK voting API.

orchard is pinned to =0.13.1 with the unstable-voting-circuits feature enabled, matching the Swift foundation split shape. No fork URLs or patch entries are introduced.
greg0x added a commit that referenced this pull request May 7, 2026
Bring the Android Rust backend onto the released zcash_voting dependency line needed for shielded voting while keeping the initial JNI surface intentionally narrow.

The exposed VotingRustBackend.computeShareNullifier symbol is a pure linkage check over caller-supplied bytes. It proves Android can resolve, link, and dispatch into zcash_voting without adding wallet database access, voting database lifecycle, PIR or tree-sync networking, or a public SDK voting API.

orchard is pinned to =0.13.1 with the unstable-voting-circuits feature enabled, matching the Swift foundation split shape. No fork URLs or patch entries are introduced.

Document voting dependency sources

Rephrase voting dependency comments
@greg0x greg0x marked this pull request as draft May 8, 2026 13:41
@greg0x

greg0x commented May 8, 2026

Copy link
Copy Markdown
Collaborator Author

We are splitting this up into multiple PRs but keeping this branch + draft PR as the integration reference target

@greg0x greg0x changed the title Add Android coinholder polling backend Draft: Add Android coinholder polling backend May 8, 2026
greg0x added a commit to valargroup/zcash-android-wallet-sdk that referenced this pull request May 8, 2026
Bring the Android Rust backend onto the released zcash_voting dependency line needed for shielded voting while keeping the initial JNI surface intentionally narrow.

The exposed VotingRustBackend.computeShareNullifier symbol is a pure linkage check over caller-supplied bytes. It proves Android can resolve, link, and dispatch into zcash_voting without adding wallet database access, voting database lifecycle, PIR or tree-sync networking, or a public SDK voting API.

orchard is pinned to =0.13.1 with the unstable-voting-circuits feature enabled, matching the Swift foundation split shape. No fork URLs or patch entries are introduced.

Document voting dependency sources

Rephrase voting dependency comments
greg0x added a commit that referenced this pull request May 10, 2026
Bring the Android Rust backend onto the released zcash_voting dependency line needed for shielded voting while keeping the initial JNI surface intentionally narrow.

The exposed VotingRustBackend.computeShareNullifier symbol is a pure linkage check over caller-supplied bytes. It proves Android can resolve, link, and dispatch into zcash_voting without adding wallet database access, voting database lifecycle, PIR or tree-sync networking, or a public SDK voting API.

orchard is pinned to =0.13.1 with the unstable-voting-circuits feature enabled, matching the Swift foundation split shape. No fork URLs or patch entries are introduced.

Document voting dependency sources

Rephrase voting dependency comments
greg0x added a commit that referenced this pull request May 11, 2026
[#1924] Add zcash_voting dependency foundation
nullcopy added a commit that referenced this pull request May 12, 2026
[#1924] Add Android voting delegation prep and signing
nullcopy added a commit that referenced this pull request May 12, 2026
[#1924] Add Android voting delegation proof and submission
@p0mvn p0mvn force-pushed the shielded-vote branch 2 times, most recently from 4b8e93c to a15b742 Compare May 12, 2026 22:40
nullcopy added a commit that referenced this pull request May 13, 2026
[#1924] Add Android voting snapshot wallet notes and note witnesses
nullcopy added a commit that referenced this pull request May 13, 2026
[#1924] Add Android voting tree sync, commitment, and cast-vote payloads
@greg0x

greg0x commented May 13, 2026

Copy link
Copy Markdown
Collaborator Author

This is stale now

#1953 is the last slice from the PR splits

@greg0x greg0x closed this May 13, 2026
@p0mvn p0mvn reopened this May 13, 2026
greg0x and others added 4 commits May 13, 2026 22:17
Rebase the shielded-vote integration surface onto the reviewed voting delegation stack, keeping the backend-lib JNI bridge and reviewed native handle ownership while layering the remaining tree sync, proof, recovery, submission, and SDK parity APIs.
Ensure delegation PCZTs pair the signed action with the governance output before proofing so randomized layouts do not later fail cmx validation.
zcash_voting 0.6.0 provides paired governance PCZT behavior directly, so remove the Android-side retry loop without changing the dependency pin.
@greg0x

greg0x commented May 13, 2026

Copy link
Copy Markdown
Collaborator Author

Handoff context: updating the shielded-vote known state onto upstream main.

Goal

  • Preserve the known shielded-vote state, including fixes committed while the SDK split PRs were under review.
  • Move that state onto upstream main, which already contains PR6/PR7 split work (SDK #1951 and SDK #1952) plus SDK #1937.
  • Make sure we do not lose parallel shielded-vote fixes, but also do not resurrect code that was intentionally removed during the split PR reviews.
  • PR8 (SDK #1953, greg/voting-recovery-share-tracking) is a separate review/test track. It was used only as a reference where it overlapped with recovery/JSON conflicts; this was not a wholesale PR8 merge.

Current state

  • This PR is valargroup:shielded-vote -> main; the local branch head used for this handoff is 2462e64d.
  • The remaining SDK delta over main is now focused on voting JNI/Rust recovery and integration APIs: backend-lib/Cargo*, VotingRustBackend, JniVotingModels, Rust voting/*, and internal TypesafeVotingBackend*.
  • The zodl companion PR for exercising this SDK branch is valargroup/zodl-android#24.

What changed during the rebase

  • Accepted upstream main as canonical for the landed PR6/PR7 split behavior from SDK #1951 and SDK #1952.
  • Accepted upstream main as canonical for SDK #1937 broadcaster behavior, even though SDK #1937 was not originally part of shielded-vote.
  • Reapplied only the remaining shielded-vote integration/fix surface on top of that base: voting DB/JNI bridge, recovery state APIs, commitment bundle storage, share delegation tracking, and SDK internal wrappers.
  • Kept the hotkey-seed direction where voting proof/signing code uses the explicit hotkey seed rather than deriving the hotkey address from the wallet seed plus address index.
  • Kept the recovery lookup behavior that treats missing recovery rows as expected missing state instead of crashing the caller.
  • Kept the unpaired governance PCZT retry handling, then dropped the paired-governance retry workaround that was no longer needed after the reviewed split changes.

Decisions made

  • Do not reintroduce code removed by the landed split PRs. In particular, the old blake2b dependency path and old json.rs module/path stayed dropped.
  • Keep SDK #1937 broadcaster changes from main; do not let older branch diffs remove or revert those files.
  • Keep recovery/share-tracking fixes that were already carried by shielded-vote where they were actual fixes.
  • Treat PR8 as separate. If a conflict was specifically recovery/JSON-related, the PR8 version was useful context; otherwise PR8 stayed out of this branch.

PR8 overlap kept in this branch

These are best understood as shielded-vote fixes that overlap with PR8, not as a PR8 merge:

  • Native recovery storage surface: delegation/vote tx hash storage and lookup, commitment bundle storage and lookup, recovery state clearing, share delegation recording/listing, confirmation marking, and sent-server tracking.
  • JNI/Kotlin models needed by that surface: JniCommitmentBundleRecord and JniShareDelegationRecord.
  • Full vote commitment bundle JSON serialization/deserialization using serde / serde_json so stored commitments can be recovered and reused.
  • zcash_voting bump to 0.6.0 as part of the rebased voting stack.
  • Hotkey seed propagation into delegation/signing paths where it was required by the recovery/signing model.
  • Missing-row handling for recovery lookups so expected absence is surfaced as missing state rather than an exception path.

PR8 work not brought over

  • PR8 was not merged wholesale.
  • PR8-only test expansions such as the larger TypesafeVotingBackendImplTest and JniVotingModelsTest changes were left with SDK #1953 rather than pulled into this rebase.
  • PR8 old-base artifacts that conflicted with current main, especially broadcaster-file deletions/reversions relative to SDK #1937, were not carried over.
  • Non-recovery/non-JSON PR8 review nits were kept out unless they were needed to make this rebased shielded-vote branch coherent.

Suggested verification path

  • In this SDK repo, run ./scripts/ci-local.sh fast, then ./scripts/ci-local.sh quick. Because this touches the Kotlin/JNI/Rust voting boundary, ./scripts/ci-local.sh full is the right final local validation before treating it as ready.
  • Then test through zodl using valargroup/zodl-android#24 with SDK_INCLUDED_BUILD_PATH pointing at this SDK checkout. In the current workspace, zodl uses SDK_INCLUDED_BUILD_PATH=../zcash-android-wallet-sdk.
  • Focus manual/regression testing on voting snapshot/witness generation, witness storage, vote commitment generation, cast-vote signing, hotkey seed propagation, and recovery/share tracking.

@p0mvn

p0mvn commented May 14, 2026

Copy link
Copy Markdown
Collaborator

Aligned with #1953

@p0mvn p0mvn closed this May 14, 2026
nullcopy added a commit that referenced this pull request May 14, 2026
[#1924] Add Android voting recovery and share tracking
nullcopy added a commit that referenced this pull request May 14, 2026
[#1924] Split governance PCZT API for Keystone vs software wallets
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