-
Notifications
You must be signed in to change notification settings - Fork 356
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
base: master
Are you sure you want to change the base?
CIP-0155? | SRV Registry #1033
Changes from all commits
883c52c
98adfd8
b2e1919
0d100bb
c278d26
aa4fd70
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,133 @@ | ||||||||||||||
--- | ||||||||||||||
CIP: 0155 | ||||||||||||||
Title: SRV registry | ||||||||||||||
Status: Proposed | ||||||||||||||
Category: Network | ||||||||||||||
Authors: | ||||||||||||||
- Marcin Szamotulski <[email protected]> | ||||||||||||||
Implementors: N/A | ||||||||||||||
Discussions: | ||||||||||||||
- [PR](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 means of sharing authoritative information between SPOs who deploy services and _decentralised protocol_ (DP) 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]). | ||||||||||||||
coot marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||
|
||||||||||||||
In this CIP, we propose to make them usable by decentralised applications running on `Cardano`. | ||||||||||||||
|
||||||||||||||
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. | ||||||||||||||
coot marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||
|
||||||||||||||
All involved parties (SPOs, DP developers, etc) need to agree on SRV prefixes used by various DPs and thus a public registry governed by a public CIP process is required to foster DPs that co-exist with the **Cardano** network, like **Mithril** (see [CIP#137]). | ||||||||||||||
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.
Suggested change
Also, why not use the blockchain itself to store that information? 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. This gives greater flexibility to the SPOs and developers. |
||||||||||||||
|
||||||||||||||
We consider DPs as applications, which construct their own network and relay on ledger peers published on the block-chain. This include node implementations, or 2nd-layer solutions like Mithril or Hydra. | ||||||||||||||
coot marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||
|
||||||||||||||
### Problem | ||||||||||||||
|
||||||||||||||
Bootstraping networks requires sharing information about available services. | ||||||||||||||
|
||||||||||||||
Historically, this was done by sharing IP or DNS names and 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]). | ||||||||||||||
coot marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||
|
||||||||||||||
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 DP that requires constructing its own network. | ||||||||||||||
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. What does it mean that this is supported by the
Author
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.
Yes, you got it right :). |
||||||||||||||
|
||||||||||||||
SRV provides a mechanism for exposing DPs co-deployed with a node, like **mithril** or **hydra**. | ||||||||||||||
coot marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||
|
||||||||||||||
Making such services discoverable is one of the key features addressed by this CIP. | ||||||||||||||
|
||||||||||||||
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. | ||||||||||||||
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. It sounds like this sentence is describing the current state, correct? i.e. already the SRV records used by SPOs are expected to / required to begin with Or is this intended to be a breaking change, where there was no enforcement on the SRV record format so far, and this invalidates those, requiring them to be more consistent? 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. I understand this is the desired state. While it's possible today to register a stake pool with a SRV record, there's no particular requirement on the content of this record. 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. If so, and there's not already a standard / requirement of using the 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.
If one has an SRV record that uses a different semantics than what this CIP proposes, it will be broken. However, this doesn't affect |
||||||||||||||
|
||||||||||||||
DP developers SHOULD submit proposals to the SRV Prefix Registry, so SPOs, who deploy them, can have an authoritative information how to do it. | ||||||||||||||
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.
Suggested change
That's where having the "prefix registry" on-chain would be quite helpful. For example, one could imagine a modification to the registry to be a governance action subject to SPOs voting because that's their remit. 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. Making such a link would be a mistake. Consider a syncing node: depending on the era it would see invalid SRV records depending at which stage of syncing it is. There is a fundamental difference between the stability of deployment configuration and the elasticity of blockchain-stored information. 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. I don't understand your argument: No matter what, if a node is syncing then the information about its peers it can get from the ledger is not current, possibly outdated, etc, so it cannot be used anyhow even in its current form without SRV records. 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. You're right that reconfiguration of relays does occur, but we don't see stake shifting much, which is even more important for a syncing node due to security reasons. Note that once committed to a value, changing it would be impossible to do safely, as it would require reconfiguring DNS entries by all SPOs simultaneously. 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. I still don't understand how this invalidates my proposal, sorry. It's about storing and retrieving some information for the chain which is assumed to be safe. The DNS will need to be verified anyway hence my other proposal to sign those entries. 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. It will matter for nodes that are syncing recent history (which is the most common scenario for syncing). The value cannot change on-chain, as using a published genesis snapshot will result in invalid domains if SPO switches to the new value in the meantime, and Daedalus nodes won't be able to sync. If they cannot change on-chain, why add the complexity of storing it there in the first place? |
||||||||||||||
|
||||||||||||||
## Specification | ||||||||||||||
|
||||||||||||||
### SRV Prefix Registry | ||||||||||||||
|
||||||||||||||
| **service** | **scope** | **SRV prefix** | **Status** | | ||||||||||||||
|:------------|:--------------| ------------------------------------:|:-----------| | ||||||||||||||
| _cardano_ | | `_cardano._tcp` | Active | | ||||||||||||||
| _mithril_ | _dmq_ | `_.dmq._mithril._cardano._tcp` | Active | | ||||||||||||||
| _mithril_ | _aggregator_ | `_aggregator._mithril._cardano._tcp` | Active | | ||||||||||||||
|
||||||||||||||
### 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 DPs 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`. | ||||||||||||||
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. I get the semantics of "start with" from context, but it's a bit unintuitive, as What should services that plan to be multi-chain use as a prefix? for example, if a decentralized bridge or multi-chain layer zero type protocol with Cardano support; Should they have their own prefix, and avoid this CIP process? or should they have different prefixes for different chains? etc. 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. DNS entries are structured from the most particular to the most general, so 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. @Quantumplation for multi-chain services this process is focused only on cardano side of things, the other side ought to be managed by the other block-chain (unless it's also covered by the CIP process). |
||||||||||||||
|
||||||||||||||
#### SRV Registry Rules | ||||||||||||||
|
||||||||||||||
* Each DP can have at most one entry in the registry. | ||||||||||||||
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. This this still relevant? In the example above, Mithril has two entries. Perhaps a bit of detail on what the definitions / intended use of 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. Right, I'd be keen to remove 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. @coot, I guess that @Quantumplation asked for descriptions of the fields However, we could remove the scope and create multiple services for Mithril that would lead to the same DNS entries if this makes more sense:
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. I'd keep it simple and not introduce notions which we're not certain will be helpful in the future. Once a need arises, we'll find an appropriate solution. |
||||||||||||||
* A CIP process assigns new entries, after a careful consideration and consultation with all the involved parties (see #acceptance-criteria below). | ||||||||||||||
coot marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||
* Entries cannot be removed, but can be revoked by assigning a `Revoked` status. | ||||||||||||||
This can only happen if a DP 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. | ||||||||||||||
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. can you elaborate a bit this example, to show what the SRV query might return, and what the node might then do with it? That's a little bit outside of scope for this CIP, as it's just repeating what DNS would do, but I think it would be helpful (and inspirational) to see the example carried through to its conclusion. 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. There are good resources for that, e.g. https://www.cloudflare.com/en-gb/learning/dns/dns-records/dns-srv-record. I'll add a link. |
||||||||||||||
|
||||||||||||||
It may as well append `.` to indicate it is a top-level query, resulting in querying the `_cardano._tcp.example.com.` domain. | ||||||||||||||
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. Can you elaborate on why someone "may as well" do this? 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. We got this advice from @njd42, if I recall correctly, it will speed up a DNS query. |
||||||||||||||
|
||||||||||||||
|
||||||||||||||
## 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: | ||||||||||||||
|
||||||||||||||
* [ ] [**Amaru Team**][amaru] accepts the proposal | ||||||||||||||
* [ ] [**Cardano-Node Team**][cardano-node] accepts the proposal | ||||||||||||||
* [ ] [**Gouroboros Team**][gouroboros] accepts the proposal | ||||||||||||||
* [ ] [**Hydra Team**][hydra] accepts the proposal | ||||||||||||||
* [ ] [**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. | ||||||||||||||
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 little more detail here on "comply" would be helpful. What does it mean for Amaru, for example, to "comply" with this proposal? 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. It means to interpret the entries stored in the ledger according to this CIP, e.g. one needs to pretend |
||||||||||||||
|
||||||||||||||
## 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 DP developers. | ||||||||||||||
|
||||||||||||||
|
||||||||||||||
## 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 |
Uh oh!
There was an error while loading. Please reload this page.