[][src]Struct cryptoballot::ElectionTransaction

pub struct ElectionTransaction {
    pub id: Identifier,
    pub authority_public: PublicKey,
    pub encryption_public: EciesPublicKey,
    pub ballots: Vec<Uuid>,
    pub trustees: Vec<Trustee>,
    pub trustees_threshold: u8,
    pub authenticators: Vec<Authenticator>,
    pub authenticators_threshold: u8,
}

Transaction 1: Election

Fields

id: Identifierauthority_public: PublicKey

Election Authority Public Key

The election authority's public key should be posted in a trusted and well-known location.

If using sawtooth, before you can post an Election transation, you must register an Election Authority's public key via sawset.

encryption_public: EciesPublicKey

Election public key for encrypting votes. It is an uncompressed secp256k1::PublicKey.

This public key is used to encrypt all votes using ECIES encryption. This keeps all the votes secret until the trustees post SecretShare transaction to allow decryption of the voters after the election is over.

After generating the keypair, the secret should be distributed to the trustees using Shamir Secret Sharing and then destroyed.

Future plans include moving to Distributed key generation, so no one entity ever has the secret key, even temporarily.

ballots: Vec<Uuid>

List of ballots that can be cast in this election

trustees: Vec<Trustee>

List of trustees that have been given a secret key share

trustees_threshold: u8

Minimum number of trustees needed to reconstruct the secret key and decrypt votes.

authenticators: Vec<Authenticator>

Authenticators who can authenticate voters

authenticators_threshold: u8

Mininum number of authenticators that might provide a signature for a voter for that voter to post a Vote transaction.

Methods

impl ElectionTransaction[src]

pub fn new(authority_public: PublicKey) -> (Self, SecretKey)[src]

Create a new ElectionTransaction

The returned SecretKey should be distributed to the trustees using Shamir Secret Sharing

pub fn get_ballot(&self, ballot_id: Uuid) -> Option<()>[src]

Get a ballot with the given ID

pub fn get_authenticator(&self, authn_id: Uuid) -> Option<&Authenticator>[src]

Get an authenticator with the given ID

pub fn get_trustee(&self, trustee_id: Uuid) -> Option<&Trustee>[src]

Get a trustee with the given ID

Trait Implementations

impl AsRef<ElectionTransaction> for SignedTransaction[src]

impl Clone for ElectionTransaction[src]

impl Debug for ElectionTransaction[src]

impl<'de> Deserialize<'de> for ElectionTransaction[src]

impl Serialize for ElectionTransaction[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,