Skip to content

thebeyondr/sekiva

 
 

Repository files navigation

Sekiva - Privacy-Preserving Voting DApp

A decentralized application for conducting private, verifiable voting on Partisia Blockchain. Built with zero-knowledge proofs and multi-party computation (MPC) to ensure vote privacy while maintaining verifiability.

Author

thebeyondr on behalf of Raid Guild

Quick Links

Documentation

Getting Started

Deployment

Architecture

Development

Reference

Contract Documentation

Example Commands

Deploy Factory Contract

cargo pbc transaction deploy \
  --gas 10000000 \
  --privatekey <PK-FILE> \
  target/wasm32-unknown-unknown/release/sekiva.pbc \
  'file:target/wasm32-unknown-unknown/release/ballot.zkwa' \
  'file:target/wasm32-unknown-unknown/release/ballot.abi' \
  'file:target/wasm32-unknown-unknown/release/collective.wasm' \
  'file:target/wasm32-unknown-unknown/release/collective.abi'

Deploy Organization

cargo pbc transaction action <SEKIVA_CONTRACT_ADDRESS> deploy_organization \
  <ORG_NAME> \
  <ORG_DESCRIPTION> \
  <ORG_PROFILE_IMAGE> \
  <ORG_BANNER_IMAGE> \
  <X_URL> \
  <DISCORD_URL> \
  <WEBSITE_URL> \
  <ORG_ADMINISTRATOR> \
  --abi <SEKIVA_ABI> \
  --gas 10000000 \
  --privatekey <PRIVATE_KEY_FILE>

Deploy Ballot

cargo pbc transaction action <ORG_CONTRACT_ADDRESS> deploy_ballot \
  [ <UP_TO_5_OPTIONS_SEPARATED_BY_A_SPACE> ] \
  <BALLOT_TITLE> \
  <BALLOT_DESC> \
  <ADMIN> \
  <DURATION_IN_SECONDS> \
  --abi <ORG_PBC> \
  --gas 10000000 \
  --privatekey <PRIVATE_KEY_FILE>

Example:

cargo pbc transaction action 02a51cbe067086205f82c48b4714d3781070c4cdd5 deploy_ballot \
  [ YES NO ] \
  'Does this work?' \
  "Let's see..." \
  '00ccb2dd9d08a91f1815c0945762597f48bc5323c6' \
  300 \
  --abi target/wasm32-unknown-unknown/release/collective.pbc \
  --gas 10000000 \
  --privatekey 006e0dd6c0dfa4b012e0b3ac085b1105754879503a.pk

License

This project is licensed under the MIT License - see the LICENSE file for details.

Resources

🛠 How to Deploy a Sekiva

1. Build the Contracts

cargo pbc build --release

This will output the compiled artifacts to:

target/wasm32-unknown-unknown/release/

For each package in the workspace, you'll see:

<name>.pbc

<name>.abi

<name>.wasm

(If ZK): <name>.zkwa, <name>.zkbc, <name>.jar


2. (Optional) Create an Account

If you don't already have an account, create one:

cargo pbc account create

This will generate a file named like:

[public-address].pk

You can rename it to something simpler (e.g. Account-A.pk). We'll refer to it as:

<PK-FILE>

3. Deploy the Factory

Option 1

Use the following command to deploy the Sekiva factory contract:

cargo pbc transaction deploy \
  --gas 10000000 \
  --privatekey <PK-FILE> \
  target/wasm32-unknown-unknown/release/sekiva.pbc \
  'file:target/wasm32-unknown-unknown/release/ballot.zkwa' \
  'file:target/wasm32-unknown-unknown/release/ballot.abi' \
  'file:target/wasm32-unknown-unknown/release/collective.wasm' \
  'file:target/wasm32-unknown-unknown/release/collective.abi'

Option 2

Go to https://browser.testnet.partisiablockchain.com/contracts/deploy in your browser

and add the <FACTORY_ABI> and <FACTORY_WASM> files on the left. Then add the other initialization files through the revealed upload buttons, connect a funded wallet and click "DEPLOY"


🧪 Example

cargo pbc transaction deploy \
  --gas 10000000 \
  --privatekey Account-A.pk \
  target/wasm32-unknown-unknown/release/sekiva.pbc \
  'file:target/wasm32-unknown-unknown/release/ballot.zkwa' \
  'file:target/wasm32-unknown-unknown/release/ballot.abi' \
  'file:target/wasm32-unknown-unknown/release/collective.wasm' \
  'file:target/wasm32-unknown-unknown/release/collective.abi'

✅ Deployment Success

If the deployment succeeds, you will see output like this:

Deployed contract successfully.
Contract deployed at: <CONTRACT_ADDRESS>
View it in browser here: https://browser.testnet.partisiablockchain.com/contracts/<CONTRACT_ADDRESS>

You can update the FACTORY_ADDRESS in sekiva-frontend useFactoryContract to your newly deployed address to make the frontend functions work. Front end requires a deployed factory contract as well as the generated files if you make any changes.

📝 Deploy notes

  • Ensure you've built all packages before deploying.

  • If a contract uses ZK, ensure its .zkwa, .zkbc, and .jar are present.

  • You can script the file collection by globbing target/wasm32-unknown-unknown/release/.

Deploying a collective

Requires the deployment of sekiva (factory contract). once deployed the contract address will become <SEKIVA_CONTRACT_ADDRESS>

cargo pbc transaction action <SEKIVA_CONTRACT_ADDRESS> deploy_organization <ORG_NAME> <ORG_DESCRIPTION> <ORG_PROFILE_IMAGE> <ORG_BANNER_IMAGE> <X_URL> <DISCORD_URL> <WEBSITE_URL> <ORG_ADMINISTRATOR> --abi <SEKIVA_ABI> --gas 10000000 --privatekey <PRIVATE_KEY_FILE>

Deploying a ballot

Requires the deployment of organzization contract. once deployed the transaction will come back as

Transaction successfully sent: https://browser.testnet.partisiablockchain.com/transactions/d8ad20e9ced6ac5a520734e7a51cbe067086205f82c48b4714d3781070c4cdd5

you can get the contract address by looking for the deployed contract address in the UI

cargo pbc transaction action <ORG_CONTRACT_ADDRESS> deploy_ballot [ <UP_TO_5_OPTIONS_SEPARATED_BY_A_SPACE> ] <BALLOT_TITLE> <BALLOT_DESC> <ADMIN> <DURATION_IN_SECONDS> --abi <ORG_PBC> --gas 10000000 --privatekey <PRIVATE_KEY_FILE>

Example

cargo pbc transaction action 02a51cbe067086205f82c48b4714d3781070c4cdd5 deploy_ballot [ YES NO ] 'Does this work?' "Let's see..." '00ccb2dd9d08a91f1815c0945762597f48bc5323c6' 300 --abi target/wasm32-unknown-unknown/release/collective.pbc --gas 10000000 --privatekey 006e0dd6c0dfa4b012e0b3ac085b1105754879503a.pk

About

Private voting for modern collectives — powered by Partisia Blockchain, made by Raid Guild

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 81.4%
  • Rust 16.1%
  • CSS 1.2%
  • JavaScript 0.6%
  • Dockerfile 0.4%
  • Shell 0.2%
  • HTML 0.1%