Submission to GitCoin GR9 Hackathon
An off-chain implementation of Conviction Voting where organization members can vote on proposals by allocating a percentage of their tokens to the proposal. Conviction is calculated with a snapshot service that runs regularly. Instead of staking tokens, it is implemented using off-chain, verifiable data structures managed by Ceramic and IDX.
contract: https://github.com/dynamiculture/offchain-cv-contract
snapshot service: https://github.com/dynamiculture/offchain-cv-snapshot
- Ceramic HTTP Client: Provides access to the Ceramic Network via a remote node running Ceramic.
- 3ID Connect: Provides authentication to a DID (used by Ceramic) from a blockchain wallet, and stores a link from this blockchain account to your DID in IDX.
- IDX: Provides a way to create identity records for a DID. Records are stored on Ceramic and can represent links to blockchain accounts or other user data.
- Angular: Web application framework.
- NgRx: Reactive state management.
Uses Ceramic's Clay testnet network to store Ceramic and IDX documents. Clone project and run:
cd offchain-cv-dapp
npm i
ng serve
Navigate to http://localhost:4200/
. The app will automatically reload if you change any of the source files.
Clone project and install packages:
cd offchain-cv-dapp
npm i
Run npm run ceramic
for the local ceramic server.
Switch to local Ceramic Network by updating path in bootstrap.js
and ceramic-token.ts
to:
const CERAMIC_URL = 'http://localhost:7007'
run to create seed for IDX identity:
node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"
https://github.com/dynamiculture/offchain-cv-contract
then run:
SEED=<your seed from above> npm run bootstrap
from config.json get definitions->convictions definitionID
idx index:set local <definitionID from above> '{"context":"blank", "proposals":[], "convictions":[]}'
Run ng build
to build the project. The build artifacts will be stored in the dist/
directory. Use the --prod
flag for a production build.
- Trust minimized, off-chain conviction voting: https://blog.ceramic.network/trust-minimized-off-chain-conviction-voting/
- Ceramic Documentation: https://developers.ceramic.network/build/writes/
- IDX Documentation: https://developers.idx.xyz/build/writing/
- IDX Sample App: https://github.com/ceramicstudio/idx-demo-app and blog post https://blog.ceramic.network/how-to-build-a-simple-notes-app-with-idx/
- Ceramic Web Playground https://ceramicstudio.github.io/web-playground/