
Blockchain-Based Access Control System
A decentralized access control application built on the Ethereum blockchain, implementing the Next Generation Access Control (NGAC) model as part of a Bachelor's thesis. The system features four interconnected Solidity smart contracts — a Data Smart Contract (DATSC) as on-chain database, a Policy Smart Contract (PSC) for defining attribute-based policies with assignments, associations and prohibitions, a Resource Smart Contract (RSC) for registering protected resources, and a Decision Smart Contract (DSC) that autonomously evaluates access requests by deriving privileges from the policy graph. Users interact through a React-based DApp with MetaMask wallet integration.
A decentralized application (DApp) that implements the Next Generation Access Control (NGAC) model on the Ethereum blockchain — replacing traditional, centralized access control with a transparent, tamper-proof, and fully on-chain authorization system powered by four interconnected smart contracts.
The Problem
Traditional access control systems — whether role-based (RBAC) or attribute-based (ABAC) — rely on centralized servers to store policies and enforce access decisions. This creates single points of failure, makes audit trails opaque, and requires trust in the system administrator. In environments where data confidentiality and integrity are critical, there is no guarantee that policies haven't been tampered with or that access decisions are being enforced as defined. Furthermore, conventional models often express authorization rules verbally or through rigid role hierarchies, limiting their flexibility when access depends on dynamic conditions such as organizational structure, project membership, or content classification.
The Solution
A fully decentralized access control system built on the Ethereum blockchain that implements the NGAC standard. Instead of relying on a central authority, access policies are stored immutably on-chain through smart contracts. The system uses a graph-based policy model where access rights are derived from relationships between users, attributes, assignments, and associations — rather than being explicitly assigned. A dedicated Decision Smart Contract autonomously evaluates access requests by traversing the policy graph and computing derived privileges in real time.
How It Works
Smart Contract Architecture

The system is composed of four Solidity smart contracts that work together on the Ethereum blockchain. The Data Smart Contract (DATSC) acts as the central on-chain database, storing references to all deployed Policy and Resource contracts. When a user deploys a new Policy Smart Contract (PSC) or Resource Smart Contract (RSC), the contract address is registered in the DATSC. The Decision Smart Contract (DSC) is the core of the access control engine — when an access request arrives, it queries the DATSC to locate the relevant PSC, retrieves the derived privileges, and evaluates whether the requester's attributes match any privilege granting the requested access right on the target resource.
Access Decision Flow

When a user submits an access request through the DApp, the following process occurs entirely on-chain: The DSC reads the resource URI from the request and queries the DATSC to find the PSC that governs that URI. It then retrieves all derived privileges from the PSC. The DSC searches for a privilege that matches three criteria simultaneously — the requester's user attribute, the requested access right (read/write), and the target resource URI. If a matching privilege exists and no prohibitions override it, the DSC returns "Access Granted." Otherwise, it returns "Access Denied." The entire decision is transparent, verifiable, and recorded on the blockchain.
NGAC Policy Model

The NGAC model represents access policies as a directed graph with two sides: users and their attributes on the left, objects and their attributes on the right. Solid arrows represent assignment relationships (e.g., User1 is assigned to Group1, Group1 is assigned to Division). Dashed lines represent associations that carry access rights (e.g., Group1 has write access on Project2). Privileges are never stored directly — instead, they are derived by traversing the graph. For example, if User1 is assigned to Group1, and Group1 has an association granting read access to the Secret category, then User1 inherits the privilege (User1, read, Secret). Prohibitions can override derived privileges using wildcard patterns to revoke specific or broad access rights.
Key Features
MetaMask Wallet Integration
- Users authenticate by connecting their MetaMask wallet — no traditional username/password required
- Each user's Ethereum address serves as their unique identity within the system
- All smart contract interactions are signed transactions, ensuring non-repudiation
Dynamic Policy Creation
- Users define policies by inputting attributes (User, Group, Object, Project, etc.), assignments, and associations through an interactive form
- Input validation enforces NGAC constraints: no duplicate attributes, at least two attributes required, referenced attributes must exist
- Policies are stored immutably on-chain once created — new policies require deploying a new PSC
Prohibition System with Wildcards
- Supports fine-grained access revocation through prohibitions
- Wildcard operator (*) enables broad revocations (e.g., revoking all read access to a specific object across all users)
- Prohibitions can target specific users, specific access rights, or specific objects — or any combination
- When prohibitions are added or updated, all privileges are automatically recomputed
Automated Privilege Derivation
- Privileges are never hardcoded — they are algorithmically derived from the policy graph
- The system traverses assignment and association relationships to compute all valid (user, access_right, object) tuples
- Privilege computation accounts for transitive relationships (e.g., User → Group → Division → read access on Projects)
- Results are displayed to the user immediately after policy creation
Resource Registration and Management
- Resources are registered with a URI and associated attributes that link them to the policy graph
- Each resource must have at least two attributes to enable meaningful access control
- Registered resources are displayed in a table and can be deleted by their index number
- Resource attributes connect to the object-side of the NGAC graph for privilege derivation
On-Chain Access Decision Engine
- The DSC performs the complete access decision process on-chain without any off-chain dependencies
- Decision logic: locate PSC via DATSC → retrieve privileges → match against request → return result
- Access decisions are fully transparent and auditable on the Ethereum blockchain
- Supports both positive authorization (through privileges) and negative authorization (through prohibitions)
Technology Stack
- Blockchain: Ethereum (Sepolia/Ganache test networks) for decentralized smart contract execution
- Smart Contracts: Solidity for implementing the four core contracts (DATSC, PSC, RSC, DSC)
- Development Environment: Remix IDE for smart contract compilation, deployment, and testing
- Frontend: React 18 with functional components for the DApp user interface
- Blockchain Interaction: Web3.js and Ethers.js for communicating with deployed smart contracts
- Wallet: MetaMask browser extension for user authentication and transaction signing
- UI Framework: Bootstrap 5 for responsive layout and styling
- Security: OpenZeppelin Contracts for secure smart contract development patterns
- Build: react-app-rewired with custom Webpack overrides for Web3 polyfill compatibility