-
Notifications
You must be signed in to change notification settings - Fork 360
CIP-0155? | SRV Registry #1033
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
Merged
Merged
CIP-0155? | SRV Registry #1033
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
883c52c
CIP-???? | SRV
coot 98adfd8
Assigned CIP number 0155
coot b2e1919
Addressed @Ryun1 editing comments
coot 0d100bb
Addressed @perturbing editing comments
coot c278d26
Use 'Decentralised Protocol' instead of DAP
coot aa4fd70
Added rationale
coot 537c744
removed leading zeroes from header CIP number
rphair f22df01
Update CIP-0155/README.md
coot 049d493
Addressed @Quantumplation's review comments
coot 7e67a10
Addressed @abailly's review comments
coot 4222592
Addressed @rphair's review comments
coot 284cf67
Added registry.json and its schema
coot 12c368f
Addressed @Crypto2099's review comment
coot 7d6a7dd
Update CIP-0155/README.md
coot 31d4b1e
Mithril team approval
coot 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,136 @@ | ||
--- | ||
CIP: 155 | ||
Title: SRV registry | ||
Status: Proposed | ||
Category: Network | ||
Authors: | ||
- Marcin Szamotulski <[email protected]> | ||
Implementors: N/A | ||
Discussions: | ||
- Submission: https://github.com/cardano-foundation/CIPs/pull/1033 | ||
Created: 2025-04-22 | ||
License: CC-BY-4.0 | ||
--- | ||
|
||
## Abstract | ||
|
||
This CIP defines the procedure for assigning Service Record (SRV) prefixes for Cardano applications (like `cardano-node`, `mithril`, etc.). | ||
|
||
This creates a means of sharing authoritative information between SPOs who deploy services and _decentralised protocol_ developers who write them. | ||
|
||
## Motivation: why is this CIP necessary? | ||
|
||
The **Cardano Ledger** allows the use of SRV records in the **SPO** registration certificate (see [register-stake-pool]). | ||
|
||
Having access to the ledger (either directly or through tools like `cardano-cli`) will allow decentralised protocols developers to construct networks based on registered relays. | ||
|
||
In this CIP, we propose to make them usable by decentralised applications running on `Cardano`. | ||
|
||
|
||
All involved parties (SPOs, decentralised protocol developers, etc) need to agree on SRV prefixes used by various decentralised protocols and thus a public registry governed by a public CIP process is required to foster decentralised protocols that co-exist with the **Cardano** network, like **Mithril** (see [CIP#137]). | ||
|
||
We consider decentralised protocols as applications, which construct their own network and relay on ledger peers published on the block-chain. This include node implementations, overlay networks like Mithril, or Layer 2 protocols like Hydra. | ||
|
||
### Problem | ||
|
||
Bootstraping networks requires sharing information about available services. | ||
|
||
Historically, this was done by sharing IP or DNS names and PORT numbers (note that `A` or `AAAA` records do not contain PORT numbers), but this approach has its limitations. | ||
SRV records were designed to make deployment independent of hard-coded service end-points (see [RFC#2782] or [cloudflare documentation][srv]). They include PORT numbers together with a DNS name (point to an `A` or `AAAA` record) together with `TTL`, priority, weight, and some other data. | ||
Thus they can be instrumental in `Cardano`, since relays are registered on the blockchain through the registration certificate. | ||
coot marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
By using SRV records in the registration certificate (which is supported by the `cardano-ledger`, but not by `cardano-node`), we wish to solve this problem not just for `Cardano` node implementation, but also for any decentralised protocol that requires constructing its own network. | ||
|
||
SRV provides a mechanism for exposing decentralised protocols co-deployed with a node, like **mithril** or **hydra**. | ||
|
||
Making such services discoverable is one of the key features addressed by this CIP. | ||
coot marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
In this CIP, we propose prefixes for both **Cardano** and **Mithril**; in the future, other services can be registered through a CIP process, thus starting a registry of prefixes used by the **Cardano** ecosystem. | ||
|
||
SPOs who deploy services need to configure their system according to the registry, e.g. SPO's cardano relays node MUST be available at `_cardano._tcp.<SPO_DOMAIN_NAME>`, as other nodes on the system will be looking at this address. | ||
coot marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
Decentralised protocol developers SHOULD submit proposals to the SRV Prefix Registry, so SPOs, who deploy them, can have an authoritative information how to do it. | ||
|
||
## Specification | ||
|
||
### SRV Prefix Registry | ||
|
||
The registry is available in `JSON` format [registry.json]. | ||
|
||
### SRV Prefix Semantics | ||
|
||
When a **cardano** node implementation reads an SRV record from a ledger, it must add the _cardano_ prefix from the table above before making a DNS lookup, e.g. it should do a DNS query for `_cardano._tcp.<srv-record-from-ledger>`. | ||
|
||
This design allows decentralised protocols to use SRV records registered in the ledger for different purposes, e.g. a **mithril** node can use them to learn about end-points of its network. | ||
|
||
Each prefix SHOULD start with `_cardano._tcp` or `_cardano._udp`, to avoid clashes with services not related to `Cardano`. | ||
coot marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
#### SRV Registry Rules | ||
|
||
* Each decentralised protocol can have at most one entry in the registry. | ||
* A CIP process assigns new entries to [registry.json], after a careful consideration and consultation with all the involved parties (see #acceptance-criteria below). | ||
* Entries cannot be removed, but can be revoked by assigning a `Revoked` status. | ||
This can only happen if a decentralised protocol is no longer supported. | ||
|
||
### Example | ||
|
||
When registering a cardano pool on `example.com` domain using an `SRV` record, one should use: | ||
```shell | ||
cardano-cli latest stake-pool ... --multi-host-pool-relay example.com | ||
``` | ||
(see [register-stake-pool]); and configure SRV record at `_cardano._tcp.example.com` to point to **Cardano** relays, `_mithril._tcp.example.com` to point to **Mithril** relays (see [srv], currently under development). | ||
|
||
A **Cardano** node implementation, when retrieving information from a registration certificate from the ledger, will receive `example.com`, and it must prepend the `_cardano._tcp` prefix to make an SRV query. Such a query might return: | ||
|
||
``` | ||
_cardano._tcp.example.com 86400 IN SRV 10 5 3001 cardano.example.com | ||
``` | ||
From this, we learn that a Cardano node is available on port `3001` on IPs resolved by a regular DNS query to `cardano.example.com`. | ||
Refer to the [Cloudflare documentation][srv] for a deeper understanding of other fields. | ||
|
||
|
||
## Rationale: how does this CIP achieve its goals? | ||
|
||
This CIP constructs a process to maintain SRV registry, and thus provides authritative information for SPOs and decentralised protocol developers. | ||
|
||
|
||
## Path to Active | ||
|
||
### Acceptance Criteria | ||
|
||
The CIP should be accepted by: | ||
|
||
* [ ] [**Technical Steering Committee**][tsc] | ||
|
||
And when there's no major objection from one of the currently involved parties: | ||
|
||
* [x] [**Cardano-Node Team**][cardano-node] accepts the proposal | ||
* [ ] [**Amaru Team**][amaru] accepts the proposal | ||
rphair marked this conversation as resolved.
Show resolved
Hide resolved
|
||
* [ ] [**Gouroboros Team**][gouroboros] accepts the proposal | ||
* [ ] [**Hydra Team**][hydra] accepts the proposal | ||
* [x] [**Mithril Team**][mithril] accepts the proposal | ||
|
||
### Implementation Plan | ||
|
||
Each **Cardano** node implementation or other tools which rely on SRV records stored in the ledger should comply with this proposal, | ||
e.g. whenever obtaining _multi-pool relay information_ one needs to prepend a registered prefix before making an SRV query. | ||
|
||
|
||
## Copyright | ||
|
||
This CIP is licensed under [CC-BY-4.0]: https://creativecommons.org/licenses/by/4.0/legalcode | ||
|
||
[CIP#137]: ../CIP-0137 | ||
[register-stake-pool]: https://developers.cardano.org/docs/operate-a-stake-pool/register-stake-pool | ||
[RFC#2782]: https://datatracker.ietf.org/doc/html/rfc2782 | ||
[srv]: https://www.cloudflare.com/en-gb/learning/dns/dns-records/dns-srv-record/ | ||
|
||
[amaru]: https://github.com/pragma-org/amaru | ||
[cardano-node]: https://github.com/IntersectMBO/cardano-node | ||
[mithril]: https://github.com/input-output-hk/mithril | ||
[gouroboros]: https://github.com/blinklabs-io/gouroboros | ||
[tsc]: https://docs.intersectmbo.org/intersect-overview/intersect-committees/technical-steering-committee-tsc | ||
[hydra]: https://github.com/cardano-scaling/hydra | ||
[register-stake-pool]: https://developers.cardano.org/docs/operate-a-stake-pool/register-stake-pool/#generate-the-stake-pool-registration-certificate | ||
|
||
[registry.json]: ./registry.json |
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,14 @@ | ||
[ | ||
{ "service": "cardano", | ||
"prefix": "_cardano._tcp", | ||
"status": "Active" | ||
}, | ||
{ "name": "mithril.dmq", | ||
"prefix": "_dmq._mithril._cardano._tcp", | ||
"status": "Active" | ||
}, | ||
{ "name": "mithril.aggregator", | ||
"prefix": "_aggregator._mithril._cardano._tcp", | ||
"status": "Active" | ||
} | ||
] |
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,32 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"$id": "https://github.com/cardano-foundation/CIPs/blob/master/CIP-0155", | ||
"title": "SRV Registry", | ||
"description": "JSON schema for the SRV registry", | ||
"type": "array", | ||
"items": { | ||
"type": "object", | ||
"properties": { | ||
"service": { | ||
"type": "string", | ||
"description": "A unique identifier for the service name." | ||
}, | ||
"prefix": { | ||
"type": "string", | ||
"description": "A unique SRV prefix.", | ||
"maxLength": 255 | ||
}, | ||
"status": { | ||
"type": "string", | ||
"description": "Status of the entry. Can be one of: \"Active\", \"Revoked\"" | ||
} | ||
}, | ||
"required": [ | ||
"service", | ||
"prefix", | ||
"status" | ||
], | ||
"additionalProperties": false | ||
} | ||
} | ||
|
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.
Uh oh!
There was an error while loading. Please reload this page.