Skip to content

Conversation

@FeurJak
Copy link

@FeurJak FeurJak commented Jul 5, 2025

This ERC proposes a comprehensive capability-based security framework for smart contracts that implements zero-trust security principles through unforgeable capability tokens, policy enforcement points, and cryptographic proof systems. The framework enforces the principle of least privilege by requiring callers to present single-use capability tokens issued by recognized authorities through policy-constrained enforcement mechanisms. The system supports local-first architectures with on-chain data commitments, utilise transient storage for efficiency, and provides revocation mechanisms while maintaining upgradeability through established proxy patterns.

@eip-review-bot
Copy link
Collaborator

eip-review-bot commented Jul 5, 2025

File ERCS/erc-7986.md

Requires 1 more reviewers from @g11tech, @SamWilsn, @xinbenlv

@eip-review-bot eip-review-bot changed the title New ERC-7965: Capability-Based Security Framework for Smart Contracts Add ERC: Capability-Based Security Framework for Smart Contracts Jul 5, 2025
@github-actions
Copy link

github-actions bot commented Jul 5, 2025

The commit 13ee858 (as a parent of 82651b1) contains errors.
Please inspect the Run Summary for details.

@github-actions github-actions bot added the w-ci label Jul 5, 2025
@github-actions github-actions bot removed the w-ci label Jul 5, 2025
@eip-review-bot eip-review-bot changed the title Add ERC: Capability-Based Security Framework for Smart Contracts Add ERC: A Capability-Based Security Framework Jul 5, 2025

## Abstract

This ERC proposes a comprehensive capability-based security framework for smart contracts that implements zero-trust security principles through unforgeable capability tokens, policy enforcement points, and cryptographic proof systems. The framework enforces the principle of least privilege by requiring callers to present single-use capability tokens issued by recognized authorities through policy-constrained enforcement mechanisms. The system supports local-first architectures with on-chain data commitments, utilizes transient storage for efficiency, and provides revocation mechanisms while maintaining upgradeability through established proxy patterns.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might want to define local-first architecture.


Zero-trust security models offer several advantages for smart contract systems:

1. **Elimination of Ambient Authority**: Unlike traditional access control systems, capability-based security ensures that **"the capability is an unforgeable token of authority"** that directly designates resources and authorizes access.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this quoting?


### Core Interfaces

#### ICapabilityRegistry
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#### ICapabilityRegistry
#### `ICapabilityRegistry`

Put code snippets, even in titles, in backticks.

The central registry that maps capability pointers to function signatures and manages authority registration.

```solidity
// SPDX-License-Identifier: MIT
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code within the proposal itself must be CC0-1.0 licensed. You can include MIT code in your assets directory and link to it if you'd prefer.

The framework utilizes **[EIP-1153](eip-1153) transient storage** for gas-efficient temporary data management:

```solidity
library TransientCapabilityStorage {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Libraries are often an implementation detail. Is it necessary to use this exact code to implement your standard? If not, you should move it to the reference implementation section.

Protected functions use the capability enforcement modifier:

```solidity
modifier onlyWithCapability(bytes32 capabilityPointer, bytes calldata tokenData) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly, modifiers are also normally implementation details. The specification section should only describe the externally visible behaviours of a contract, not how it is implemented.

Comment on lines +871 to +878
Before production deployment, the framework requires:

1. **Formal Security Audit**: Independent review by recognized security firms
2. **Formal Verification**: Mathematical proof of critical security properties
3. **Bug Bounty Program**: Community-driven security testing
4. **Gradual Rollout**: Phased deployment with limited exposure

The framework follows **EthTrust Security Levels** specifications for comprehensive security certification.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You cannot enforce that implementations are audited. You can certainly recommend it, but that recommendation holds for nearly all contract code so it's somewhat implied.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants