The Royal Protocol offers an immutable solution to register and verify authorship of creative works. The protocol is completely open-source and permissionless and designed for multiple parties to utilize and build on.
Registering provenance onchain will enable provability of authorship or creation across a wide range of creative works, including:
- Music
- Digital Artwork
- Essays & Blog Posts
- Software packages
This repository contains all the contracts deployed and used by the Royal Protocol (the core protocol contracts), as well as sample contracts for entities that want to interact with the Royal Protocol or extend it.
The core protocol contracts are divided between the Account system, the Provenance system, and the Delegation system.
Account System:
Users create accounts by registering them through the IdGateway
.
The account system is ID-based, not address based.
Because of this, you can transfer the account between addresses if desired, and recover an account a different address if needed (if you set up recovery in advance).
- IdRegistry - track account data for Royal Protocol accounts.
- IdGateway - wrapper for account creation & update logic - handles all write functions.
Provenance System:
A ProvenanceClaim
ties together a Royal Protocol Account ID with a blake3 hash of some piece of content.
This lets us tie identities, of both the creator and the AI model if relevant, with a creative work such as a piece of music, artwork, etc.
The ProvenanceRegistry
holds ProvenanceClaim
data for creative works.
Each ProvenanceClaim
may be associated with an NFT owned by the "originator" of the ProvenanceClaim
.
Any given NFT can only be associated with a single ProvenanceClaim
.
- ProvenanceRegistry - track
ProvenanceClaim
data, claimed by Royal Protocol accounts. - ProvenanceGateway - wrapper for
ProvenanceClaim
registration logic - handles all write functions.
Delegation System:
Users can delegate certain actions on the protocol to other protocol Account IDs. For example, one account may register provenance on behalf of another account that has delegated permissions to it. Delegations may also be used by 3rd-party extensions of the protocol.
- DelegateRegistry - track
Delegation
data, written by Royal Protocol accounts.
The v1.0 contracts are deployed on both Base Mainnet and Base Sepolia, to the same canonical addresses on both networks.
Contributions are welcome!
This is a Foundry repo - if you haven't used Foundry before, read more here.
The basic commands:
forge build
- Builds the contracts.forge fmt
- Formats the contracts (think Prettier).yarn lint
- Runs solhint - a Solidity linter, with our lint config.slither . --skip-assembly
- Runs slither - a security-focused code analyzerforge test
- Runs tests. If you contribute, hopefully there are more tests after your contribution!