-
Notifications
You must be signed in to change notification settings - Fork 25
📝CNS: Contract Name Service 🚧 #341
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
Draft
BertrandD
wants to merge
1
commit into
main
Choose a base branch
from
contract_name_service
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
# CNS: Contract Name Service | ||
|
||
## Register a new contract | ||
|
||
All contracts needs to have a registered identity on any existing identity provider | ||
|
||
Genesis provider could be: | ||
- "com", "fr", "eu"... restricted to existing internet domains (see section below) | ||
- "hyle" open to anyone | ||
|
||
A new contract "MyContract" could then have a name like | ||
- mycontract.hyle | ||
- mycontract.com | ||
|
||
To register a new contract owner has to | ||
|
||
1. Register a new identity "mycontract.hyle" | ||
2. Send a RegisterContract transaction | ||
|
||
```rust | ||
pub struct RegisterContractTransaction { | ||
//pub owner: String, | ||
pub verifier: String, | ||
pub program_id: Vec<u8>, | ||
pub state_digest: StateDigest, | ||
pub contract_name: ContractName, | ||
} | ||
``` | ||
3. Send a proof of ownership for that contract name | ||
|
||
```rust | ||
pub struct ProofTransaction { | ||
pub proof: ProofData, | ||
pub contract_name: ContractName, | ||
} | ||
``` | ||
Note: | ||
- `contract_name` of the `ProofTransaction` is the identity provider for the registered contract name. | ||
- `hyle_output` of this transaction should refer the `RegisterContractTransaction` | ||
|
||
4. If this proof is valid, the `RegisterContractTransaction` is settled and the contract registered. | ||
|
||
|
||
## For internet domains from DNS | ||
|
||
To have addresses like `apple.com`, `hyle.eu`... | ||
|
||
- Using official DNS certificate allows to delegate attribution to external authority | ||
-> This authority is centralized, not really in the "blockchain" mindset | ||
|
||
- Can be re-attributed if provided a valid certificate | ||
|
||
## New identity provider | ||
|
||
A new identity provider is just a new contract like any other. The developper register its own | ||
contract under any existing provider. | ||
|
||
Example: Twitter wants to have its own identity provider, where its user can have an on-chain identity | ||
given they have a twitter account. | ||
|
||
They have `x.com` registered and a certificate. | ||
They register they identity `x.com` and register a contract on this name (or a subdomain like `id.x.com`) | ||
They new contract verifies user identity using twitter sso, and anyone can have its identity (e.g.) `hyle-org.x.com` | ||
|
||
The end-user, can have an identity provided by X, without the need of having a `.com` certificate. | ||
|
||
Other example: | ||
Bob, a random developper of a new game called "Doom" wants to enable its users to log-in using a password. | ||
Bob register an identity `doom.hyle` because it's available. | ||
Bob register its game under `doom.hyle`. His contract is the game itself, but also its own identity provider (why not ?). | ||
|
||
Any doom user can register using a password and have identity "xxKillerxx.doom.hyle". | ||
|
||
This identity can be used in any other contract if the user wants to and can receive shitcoins/nft on its doom account | ||
if he wants to. | ||
|
||
## Initial Hyle contract | ||
|
||
Simple contract that use asymetric signature to validate identity (classic blockchains). | ||
|
||
### Revoke identity | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ça veut dire qu'on peut potentiellement être sans identité ? Inacessible? |
||
The `hyle` contract, can have a "Revoke" action on an identity to replace it by a new one. This action should be accepted | ||
by a node only if it has a BLST signature of 2f+1 validators. | ||
|
||
**Bad point**: for the `hyle` contract, the node has to parse the BlobData to check if it is not a "Revoke" action. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
J'ai l'impression qu'il faudrait envoyer la proof d'ownership du nom de domaine dans chaque transaction ? Car le nom de domaine peut changer de propriétaire après que le contrat ait été registered sur Hyle ?
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.
Si on veut mimic les dns classiques, il faut envoyer une preuve d'ownership du domaine au niveau de la tx, et faire en sorte que cette preuve ne soit valide qu'une fois pour cette transaction spécifiquement?
Un truc du genre: