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.
thebeyondr on behalf of Raid Guild
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'
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>
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
This project is licensed under the MIT License - see the LICENSE file for details.
- Partisia Blockchain Documentation
- ZK Smart Contracts Guide
- ZK Rust Language
- Partisia Community Discord
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
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>
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'
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"
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'
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.
-
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/
.
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>
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