pub struct Instance {
pub van_nullifier: Base,
pub r_vpk_x: Base,
pub r_vpk_y: Base,
pub vote_authority_note_new: Base,
pub vote_commitment: Base,
pub vote_comm_tree_root: Base,
pub vote_comm_tree_anchor_height: Base,
pub proposal_id: Base,
pub voting_round_id: Base,
pub ea_pk_x: Base,
pub ea_pk_y: Base,
}Expand description
Public inputs to the Vote Proof circuit (11 field elements).
The voting client (prover) chooses these values when assembling the
proof; the verifier accepts them as the binding the proof must
satisfy and checks the proof without seeing any private witnesses.
The relationship is asymmetric: a malicious-custody client can
choose any public-input vector it likes, so the verifier must source
the correct values from authenticated chain state (see
crate::vote_proof::prove::verify_vote_proof for which fields
require caller authentication versus which are proof-attested
outputs).
Binding contract: shares_hash is deliberately absent from this public
instance vector. The circuit computes it as an internal condition-10 cell
and exposes it to the verifier only through vote_commitment.
Fields§
§van_nullifier: BaseThe nullifier of the old VAN being spent (prevents double-vote).
r_vpk_x: BaseRandomized voting public key (condition 4): x-coordinate of r_vpk = vsk.ak + [alpha_v] * G.
r_vpk_y: BaseRandomized voting public key: y-coordinate.
The new VAN commitment (with decremented proposal authority).
vote_commitment: BaseThe vote commitment hash.
vote_comm_tree_root: BaseRoot of the vote commitment tree at anchor height.
vote_comm_tree_anchor_height: BaseCaller-authenticated chain height used to source vote_comm_tree_root.
This public input is transcript-bound but not constrained to a witness
cell. Verifiers must check that vote_comm_tree_root is the chain root
at this height.
proposal_id: BaseGovernance session parameter: which proposal this vote is for.
The circuit constrains this to [1, 15] through condition 6 and binds
it into the new VAN and vote commitment. The verifier must separately
check that it is active for voting_round_id.
voting_round_id: BaseGovernance session parameter: the voting round identifier.
The circuit binds this into the VAN nullifier, new VAN, and vote commitment, but cannot authenticate that it is the active round.
ea_pk_x: BaseGovernance-announced election authority public key x-coordinate.
The verifier must pin this from the active round’s governance announcement. The circuit proves encryption under this coordinate pair, but cannot authenticate that it is the legitimate EA key.
ea_pk_y: BaseGovernance-announced election authority public key y-coordinate.
Must be authenticated with ea_pk_x; both coordinates are public so a
prover cannot substitute a negated curve point while preserving x.
Implementations§
Source§impl Instance
impl Instance
Sourcepub const NUM_PUBLIC_INPUTS: usize = 11
pub const NUM_PUBLIC_INPUTS: usize = 11
Number of public inputs serialized by Self::to_halo2_instance.
Sourcepub fn from_parts(
van_nullifier: Base,
r_vpk_x: Base,
r_vpk_y: Base,
vote_authority_note_new: Base,
vote_commitment: Base,
vote_comm_tree_root: Base,
vote_comm_tree_anchor_height: Base,
proposal_id: Base,
voting_round_id: Base,
ea_pk_x: Base,
ea_pk_y: Base,
) -> Self
pub fn from_parts( van_nullifier: Base, r_vpk_x: Base, r_vpk_y: Base, vote_authority_note_new: Base, vote_commitment: Base, vote_comm_tree_root: Base, vote_comm_tree_anchor_height: Base, proposal_id: Base, voting_round_id: Base, ea_pk_x: Base, ea_pk_y: Base, ) -> Self
Constructs an Instance from its constituent parts.
Callers should authenticate vote_comm_tree_root,
vote_comm_tree_anchor_height, proposal_id, voting_round_id,
ea_pk_x, and ea_pk_y out-of-band before passing them here.
proposal_id must be active for voting_round_id; the circuit only
checks the authority-bit index range. The EA key must come from the
active round’s governance announcement, not from the prover bundle. See
crate::vote_proof::prove::verify_vote_proof for the trust contract
and why wiring ea_pk_* from the same bundle as the proof is a
custody-attack surface. The remaining fields are proof-attested outputs
derived outside the circuit but constrained in-circuit against
authenticated inputs and private witnesses.
Sourcepub fn to_halo2_instance(&self) -> Vec<Scalar> ⓘ
pub fn to_halo2_instance(&self) -> Vec<Scalar> ⓘ
Serializes public inputs for halo2 proof creation/verification.
The order must match the instance column offsets defined at the
top of this file (VAN_NULLIFIER_PUBLIC_OFFSET, R_VPK_X_PUBLIC_OFFSET,
R_VPK_Y_PUBLIC_OFFSET, etc.).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Instance
impl RefUnwindSafe for Instance
impl Send for Instance
impl Sync for Instance
impl Unpin for Instance
impl UnsafeUnpin for Instance
impl UnwindSafe for Instance
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.