-
Notifications
You must be signed in to change notification settings - Fork 829
Add ERC: A Capability-Based Security Framework #1115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
The commit 13ee858 (as a parent of 82651b1) contains errors. |
|
|
||
| ## 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. |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| #### 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 |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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.
| 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. |
There was a problem hiding this comment.
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.
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.