Catalyst Automation Support Tables

This table defines the data necessary to support continuous automation of Catalyst 1.0 Backend.

Event Table Diagram



erd

Catalyst Event Database - Automation


tally_committee


tally_committee

Column

Type

Description


row_id


integer+


Unique ID for this committee member for
this event.

event

integer

The event this committee member is for.

committee_pk

text

Encrypted private key for the committee
wallet. This key can be used to get the
committee public address.

committee_id

text

The hex-encoded public key for the
committee wallet.

member_crs

text

Encrypted Common Reference String
shared in the creation of every set of
committee member keys.

election_key

text

Public key generated with all
committee member public keys, and is
used to encrypt votes. NULL if the
event.committee_size is 0.


Table for storing data about the tally committee per voting event.



event


event

Column

row_id


ABRIDGED



tally_committee:event_out->event:row_id





voting_node


voting_node

Column

Type

Description


hostname


text


Unique hostname for the voting node.


event


integer


Unique event this node was configured
for.

pubkey

text

Public key from Ed25519 pair for the
node. Used as consensus_leader_id when
the node is a leader.

seckey

text

Encrypted secret key from Ed25519 pair
for the node. Used as the node secret.

netkey

text

Encrypted Ed25519 secret key for the
node. Used as the node p2p topology key.


This table holds information for all nodes in the event.
It is used by nodes to self-bootstrap the blockchain.



voting_node:event_out->event:row_id





LEGEND


LEGEND

Type

Example


Primary Key


integer+

Standard Field

bytea

Nullable Field

text

Sized Field

varchar(32)

Autoincrement Field

integer+



Schema

-- Catalyst Event Database

-- Voting Nodes Table - Defines nodes in the network
-- This table is looked up by hostname and event
CREATE TABLE voting_node (
    hostname TEXT NOT NULL,
    event INTEGER NOT NULL,

    pubkey TEXT NOT NULL,
    seckey TEXT NOT NULL,
    netkey TEXT NOT NULL,

    PRIMARY KEY (hostname, event),
    FOREIGN KEY(event) REFERENCES event(row_id)  ON DELETE CASCADE
);

COMMENT ON TABLE voting_node IS
'This table holds information for all nodes in the event.
It is used by nodes to self-bootstrap the blockchain.';
COMMENT ON COLUMN voting_node.hostname IS 'Unique hostname for the voting node.';
COMMENT ON COLUMN voting_node.event IS 'Unique event this node was configured for.';
COMMENT ON COLUMN voting_node.seckey IS 'Encrypted secret key from Ed25519 pair for the node. Used as the node secret.';
COMMENT ON COLUMN voting_node.pubkey IS 'Public key from Ed25519 pair for the node. Used as consensus_leader_id when the node is a leader.';
COMMENT ON COLUMN voting_node.netkey IS 'Encrypted Ed25519 secret key for the node. Used as the node p2p topology key.';


-- Tally Committee Table - Stores data about the tally committee per voting event
-- This table is looked up by event
CREATE TABLE tally_committee (
    row_id SERIAL PRIMARY KEY,

    event INTEGER NOT NULL UNIQUE,

    committee_pk TEXT NOT NULL,
    committee_id TEXT NOT NULL,
    member_crs TEXT,
    election_key TEXT,

    FOREIGN KEY(event) REFERENCES event(row_id)  ON DELETE CASCADE
);

COMMENT ON TABLE tally_committee IS 'Table for storing data about the tally committee per voting event.';
COMMENT ON COLUMN tally_committee.row_id IS 'Unique ID for this committee member for this event.';
COMMENT ON COLUMN tally_committee.event  IS 'The event this committee member is for.';
COMMENT ON COLUMN tally_committee.committee_pk  IS 'Encrypted private key for the committee wallet. This key can be used to get the committee public address.';
COMMENT ON COLUMN tally_committee.committee_id  IS 'The hex-encoded public key for the committee wallet.';
COMMENT ON COLUMN tally_committee.member_crs  IS 'Encrypted Common Reference String shared in the creation of every set of committee member keys.';
COMMENT ON COLUMN tally_committee.election_key  IS 'Public key generated with all committee member public keys, and is used to encrypt votes. NULL if the event.committee_size is 0.';


-- Committee Member Table - Stores data about the tally committee members
-- This table is looked up by committee
CREATE TABLE committee_member (
    row_id SERIAL PRIMARY KEY,

    committee INTEGER NOT NULL,

    member_index INTEGER NOT NULL,
    threshold INTEGER NOT NULL,
    comm_pk TEXT NOT NULL,
    comm_sk TEXT NOT NULL,
    member_pk TEXT NOT NULL,
    member_sk TEXT NOT NULL,

    FOREIGN KEY(committee) REFERENCES tally_committee(row_id)
);

COMMENT ON TABLE committee_member IS 'Table for storing data about the tally committee members.';
COMMENT ON COLUMN committee_member.row_id IS 'Unique ID for this committee member for this event.';
COMMENT ON COLUMN committee_member.member_index IS 'the zero-based index of the member, ranging from 0 <= index < committee_size.';
COMMENT ON COLUMN committee_member.committee IS 'The committee this member belongs to.';
COMMENT ON COLUMN committee_member.comm_pk  IS 'Committee member communication public key.';
COMMENT ON COLUMN committee_member.comm_sk  IS 'Encrypted committee member communication secret key.';
COMMENT ON COLUMN committee_member.member_pk  IS 'Committee member public key';
COMMENT ON COLUMN committee_member.member_sk  IS 'Encrypted committee member secret key';