pub struct OwnershipProof { /* private fields */ }Expand description
A proof of ownership of a KeyImage, produced by
crate::prove_ownership and checked by crate::verify_ownership.
It lets the holder of a secret key convince any third party that a
given key image (and hence the ballot it sits next to in the public
registry) is theirs — without revealing the secret key. The proof
is a non-interactive Chaum–Pedersen proof of equality of discrete
logarithms: it demonstrates knowledge of the scalar x such that, at
once, P = x·G (the prover’s public key) and I = x·B (the key
image), where B = H_p(election || P) is the same election-scoped
base the key image was built from.
Producing the proof intentionally de-anonymises the prover for
that key image: verify_ownership is handed the public key, so it ties
P ↔ I on purpose. That is the whole point — it is the opt-in inverse
of the ring signature’s anonymity, for use cases like proxy / mandated
voting where a voter must demonstrate how they voted.
The on-the-wire encoding is two canonical 32-byte scalars,
challenge || response, for 64 bytes total — independent of the ring
size.
Implementations§
Source§impl OwnershipProof
impl OwnershipProof
Sourcepub fn from_bytes(bytes: &[u8; 64]) -> Result<Self>
pub fn from_bytes(bytes: &[u8; 64]) -> Result<Self>
Deserialise 64 bytes produced by OwnershipProof::to_bytes.
Sourcepub fn to_prefixed(&self) -> String
pub fn to_prefixed(&self) -> String
Encode in the human-friendly prefixed format: own_<hex>_<checksum>.
Sourcepub fn from_prefixed(s: &str) -> Result<Self>
pub fn from_prefixed(s: &str) -> Result<Self>
Decode an own_<hex>_<checksum> string produced by
OwnershipProof::to_prefixed, verifying the tag and the checksum.
Trait Implementations§
Source§impl Clone for OwnershipProof
impl Clone for OwnershipProof
Source§fn clone(&self) -> OwnershipProof
fn clone(&self) -> OwnershipProof
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more