Skip to content

jgphilpott/bitgov

Repository files navigation

BitGov

BitGov is an exploration of decentralized digital democracy using Solidity smart contracts on the Ethereum blockchain.


What is Solidity?

Solidity is a statically-typed, object-oriented programming language designed specifically for writing smart contracts — self-executing programs that live on the Ethereum blockchain.

Key properties:

  • Deterministic — the same inputs always produce the same outputs, on every node worldwide.
  • Trustless — no central authority controls execution; the EVM (Ethereum Virtual Machine) does.
  • Immutable — once deployed, contract code cannot be changed (unless explicitly designed to be upgradeable).
  • Transparent — all contract code and state is publicly verifiable on-chain.

These properties make Solidity a natural fit for governance applications where trust, transparency, and censorship-resistance matter.


Contracts

Contract Description Docs
HelloWorld Classic starter — stores and updates a greeting string on-chain docs/HelloWorld.md
BallotContract One-person-one-vote ballot with delegation support docs/BallotContract.md
TokenWeightedVote Token-weighted voting with partial/split vote support docs/TokenWeightedVote.md

Each contract page includes a full interface reference, event list, step-by-step deployment instructions, and an interactive Hardhat console walkthrough.


Project Setup

This project uses Hardhat — the most widely used Ethereum development environment.

Prerequisites

Install dependencies

npm install

Compile contracts

npm run compile

Run tests

npm test

Deploy locally (Hardhat network)

# Start a local Hardhat node (first terminal)
npx hardhat node

# Deploy a contract (second terminal)
npx hardhat ignition deploy ignition/modules/BallotContract.ts --network localhost
npx hardhat ignition deploy ignition/modules/TokenWeightedVote.ts --network localhost
npx hardhat ignition deploy ignition/modules/HelloWorld.ts --network localhost

Project Structure

bitgov/
├── contracts/          # Solidity smart contracts
│   ├── HelloWorld.sol
│   ├── BallotContract.sol
│   └── TokenWeightedVote.sol
├── docs/               # Contract-specific documentation and interaction guides
│   ├── HelloWorld.md
│   ├── BallotContract.md
│   └── TokenWeightedVote.md
├── ignition/
│   └── modules/        # Hardhat Ignition deployment modules
│       ├── HelloWorld.ts
│       ├── BallotContract.ts
│       └── TokenWeightedVote.ts
├── test/               # TypeScript test suite (Mocha + Ethers.js)
│   ├── HelloWorld.ts
│   ├── BallotContract.ts
│   └── TokenWeightedVote.ts
├── hardhat.config.ts   # Hardhat configuration
└── tsconfig.json       # TypeScript configuration

Next Steps

From this foundation, BitGov will grow to explore on-chain governance primitives:

  • Proposals — on-chain creation, discussion, and execution of governance proposals
  • Identity — decentralized citizen identity using OpenZeppelin
  • Treasury — collectively controlled funds released by vote outcome

License

MIT

About

Solidity smart contract framework for decentralized digital democracy.

Topics

Resources

License

Stars

4 stars

Watchers

1 watching

Forks

Contributors