A decentralized set management system built on the Stacks blockchain, enabling developers and businesses to efficiently manage, track, and control sets of data with granular access and comprehensive logging.
DApp Set provides a robust solution for managing complex data sets with secure, transparent, and traceable set operations. The system enables:
- Set registration on the blockchain
- Granular set management
- Comprehensive access control
- Detailed audit logging
- Versioned set tracking
The system is built around a single smart contract that manages set registrations, set operations, access permissions, and audit trails.
graph TD
A[Set Owner] -->|Create Set| B[Set Registry]
A -->|Modify Set| C[Set Management]
C -->|Track| D[Set References]
C -->|Log| E[Audit Trail]
A -->|Manage Access| F[Permission System]
G[Collaborators] -->|Interact with Set| C
F -->|Control| G
C -->|Record| E
- Set Registry: Stores set information and ownership
- Set Management: Manages set operations and modifications
- Permission System: Controls access rights
- Audit System: Tracks all set interactions
PERMISSION-NONE (u0)
: No accessPERMISSION-VIEW (u1)
: View-only accessPERMISSION-MODIFY (u2)
: Can modify set contentsPERMISSION-ADMIN (u3)
: Can manage permissionsPERMISSION-OWNER (u4)
: Full control
ACTION-CREATE (u1)
: Set creationACTION-VIEW (u2)
: Set accessACTION-MODIFY (u3)
: Set modificationACTION-SHARE (u4)
: Permission changesACTION-DELETE (u5)
: Set deletion
- Clarinet
- Stacks wallet
- Node.js environment
- Create a set:
(contract-call? .set-manager create-set "set123" "Financial Data")
- Add an element:
(contract-call? .set-manager add-element
"set123"
0x1234...
"element-details")
- Grant access:
(contract-call? .set-manager grant-set-permission
"set123"
'ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM
u1)
(create-set (set-id (string-ascii 64)) (name (string-ascii 256)))
Creates a new set on the platform.
(add-element
(set-id (string-ascii 64))
(element (buff 32))
(details (string-utf8 500)))
Adds a new element to a set.
(grant-set-permission
(set-id (string-ascii 64))
(user principal)
(permission-level uint))
Grants access permissions to a user.
- Clone the repository
- Install dependencies
- Run tests:
clarinet test
- Start Clarinet console:
clarinet console
- Deploy contract:
clarinet deploy
- Only set owners can modify sets
- Permission levels are strictly enforced
- All access attempts are logged
- Set owners have full control
- Only set references are stored on-chain
- Access control is managed through permission levels
- Audit trail maintains accountability
- Limited to 64-character set IDs
- Permission changes require admin access