Skip to content

nova-sp/parsec-dapp

Repository files navigation

ParSec dApp

A blockchain-based decentralized application implementing collective authorization for document access control. Built on Ethereum with real-time collaborative editing capabilities.

Overview

Developed in the context of the ParSec project, this dApp replaces centralized administrative control with consensus-based access management. Every document access request must go through a petition-vote-authorization cycle by designated approvers.

For more information take a look at our Video Demo.

Key Features

Access Control (On-Chain via Smart Contract)

  • Consensus-based: Majority vote determines access approval.
  • Time-limited: Requests expire after 7 days (configurable).
  • Role-based: Read / ReadWrite permissions.
  • Non-blocking: Document operations continue during voting.
  • Immutable audit trail: All access requests, votes, and decisions logged on-chain.

Collaboration (Off-Chain via WebSockets + CRDTs)

  • Real-time collaborative editing using Yjs CRDT library.
  • Authenticated sessions via JWT tokens for ReadWrite users.
  • WebSocket-based synchronization for concurrent editing.

Architecture

Smart Contract Layer

  • Solidity contract enforcing access rights, version control, and on-chain voting.
  • Deployed on local Ethereum test network (Hardhat).
  • Handles approver management, access requests, and voting logic.

Backend Layer

  • Express.js server managing:
    • User metadata.
    • File storage.
    • JWT authentication for WebSocket sessions.
    • Real-time collaboration coordination.

Frontend Layer

  • React application combining:
    • Wallet (MetaMask).
    • Real-time collaborative editing (Yjs + WebSockets).
    • Document management interface.

Getting Started

1. Clone the repository

git clone https://github.com/nova-sp/parsec-dapp.git
cd parsec-dapp

2. Install dependencies

# Install root dependencies
npm install

# Install frontend dependencies
cd frontend
npm install
cd ..

# Install backend dependencies
cd backend
npm install
cd ..

3. Start local Ethereum network / Deploy smart contract / Start backend server / Start frontend application

./launch-dapp.sh

4. Configure MetaMask

  • Connect to localhost:8545

Testing

The project includes comprehensive unit tests:

npm test

Test Coverage: 95 passing tests.

Static Analysis

The smart contract has been analyzed with multiple tools:

  • Slither
  • Solhint
  • Solium/Ethlint
  • Aderyn
  • Mythril

Results can be found at security folder.

Funding

Developed as part of the DARE ACM Summer School project, in the context of the ParSec research project on 'Improving Parliamentary Cybersecurity through Collective Authorization'.

Reference: 2024.07643.IACDC/2024

About

ParSec: Astronomically Improving Parliamentary Cybersecurity through Collective Authorization

Resources

License

Stars

Watchers

Forks

Contributors