Skip to content

About

A decentralized privacy management protocol, Ethereum smart contracts for granular user consent and an on-chain company registry.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ConsentChain: Decentralized Privacy Management Protocol

ConsentChain is a trustless, Web3-native application that shifts control of data privacy from central servers back to the user. It allows users to grant, manage, and automatically revoke data consent for third-party companies using time-bound smart contracts on the Ethereum blockchain.

⚡ Core Features

  • Time-Bomb Consent Logic: Consent is not permanent. Users set an exact duration (e.g., 30 days), and the smart contract automatically invalidates access the second the time expires without requiring an extra transaction.
  • Immutable Company Registry: Companies must permanently register their identity (name, privacyUrl) on-chain. This creates a transparent "Phone Book" of verified data consumers.
  • Granular Revocation: Users can manually revoke consent from a specific company at any time with a single transaction.
  • Immersive UI: A high-contrast, dark-mode interface featuring dynamic "aura" aesthetics and glassmorphism, built on Next.js 16.

🛠 Tech Stack

  • Smart Contracts: Solidity, Hardhat
  • Network: Ethereum (Sepolia Testnet)
  • Frontend: Next.js (App Router, Turbopack), TypeScript, Tailwind CSS
  • Web3 Integration: Wagmi, Viem, RainbowKit

📜 Smart Contract Architecture (V4)

The core logic is governed by ConsentV4.sol, which handles two primary mappings:

  1. The User Consent Vault: mapping(address => mapping(address => Consent)) Stores the boolean state and expiration timestamp of a user's consent to a specific company.
  2. The Registry Billboard: mapping(address => CompanyProfile) Stores the public profile of verified entities requesting data.

Key Functions

  • registerCompany(string, string): Onboards a new company to the protocol.
  • giveConsent(address, uint256): Grants time-locked permission to a registered entity.
  • checkConsent(address, address): A view function that checks both the boolean state and the time-bomb status.
  • revokeConsent(address): Immediately destroys the consent record.

🚀 Getting Started

Prerequisites

  • Node.js (v18+)
  • MetaMask or equivalent Web3 wallet funded with Sepolia ETH.

Installation

  1. Clone the repository:
    git clone [https://github.com/yourusername/Project-Consent-Chain.git](https://github.com/yourusername/Project-Consent-Chain.git)

About

A decentralized privacy management protocol, Ethereum smart contracts for granular user consent and an on-chain company registry.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages