Skip to content
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

CIP0006 Stake pool extended metadata #15

Merged
merged 11 commits into from
Mar 8, 2021
157 changes: 157 additions & 0 deletions CIP-0006/CIP-0006.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
---
CIP: 6
Title: Extended Metadata
papacarp marked this conversation as resolved.
Show resolved Hide resolved
Authors: Markus Gufler <[email protected]>, Mike Fullman <[email protected]>
Comments-URI:
Status: Draft
Type: Standards
Created: 2020-07-20 original draft
Updated: 2020-11-24 2nd key-pair for validation
License: CC-BY-4.0
---

## Abstract

This CIP defines the concept of extended metadata for pools that is referenced from the pool registration data stored on chain.

## Motivation

As the ecosystem around Cardano stake pools proliferate so will the desire to slice, organize and search pool information dynamically. Currently the metadata referenced on chain provides 512 bytes that can be allocated across the four information categories ([delegation-design-specification Section 4.2)](https://hydra.iohk.io/build/790053/download/1/delegation_design_spec.pdf):

| key | Value | Rules |
| --- | --- | --- |
| `ticker` | Pool ticker. uppercase | 5 Characters Maximum, Uppercase letters and numbers |
| `description` | Pool Description. Text that describes the pool | 50 Characters Maximum |
| `homepage` | A website URL for the pool | 64 Characters Maximum, must be a valid URL |
Comment on lines +25 to +26
Copy link

@pintaric pintaric Feb 15, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this really accurate? As far as I can tell, the Design Specification (Section 4.2) doesn't impose an explicit character limit on the "description" and "homepage" metadata fields. All it requires is a total size of the on-chain metadata of 512 bytes or less.

Edit: To be clear, I am talking about the current metadata specification here. CIP0006 is proposing to shorten the "description" character limit to 50 and the "homepage" character limit to 64, correct?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point. I'm not sure what is effectively true, but I'm aware of multiple different origins and specifications.

For example the incentivised testnet metadata registry
https://github.com/cardano-foundation/incentivized-testnet-stakepool-registry#submission-well-formedness-rules
afaik this was used as a template for the mainnet metadata registration file.

I also remember another proposal/definition/example I can't find now.
And there is what currently is implemented by the SMASH server as input validation
https://github.com/input-output-hk/smash/blob/479fc6d8fa62537cd6c8560176d6a8a7ffda6e9e/smash-servant-types/src/Cardano/SMASH/Types.hs#L212-L252

With the additional fields, we need to increase the current max size from 512 to (proposed) 1024 bytes
By not specifying additional max sizes for individual fields would make it very unpredictable (for example for UI design)
One could consciously use the shortest possible URLs, and fill an unlimited description or name field with >900 characters.

So I propose to align to what Smash server currently has implemented and is also using in his SQL DB schema.

| `name` | A name for the pool | 50 Characters Maximum |

Many additional attributes can be envisioned for future wallets, pool explorers, and information aggregators. The proposal below outlines an initial strategy for capturing this extended metadata.

## Specification

### On Chain referenced (main) metadata file
We define two more fields for the on chain referenced metadata file that references another json file on a url with the extended metadata. The proposed metadata is as follows:

| key | Value | Rules |
| --- | --- | --- |
| `ticker` | Pool ticker. uppercase | 5 Characters Maximum, Uppercase letters and numbers |
| `description` | Pool Description. Text that describes the pool | 50 Characters Maximum |
| `homepage` | A website URL for the pool| 64 Characters Maximum, must be a valid URL |
| `name` | A name for the pool | 50 Characters Maximum |
| `extDataUrl` | A URL for extended metadata | optional, 128 Characters Maximum, must be a valid URL |
| `extHashUrl` | A URL with the extended metadata hash | optional, 128 Characters Maximum, must be a valid URL |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you don't mean extHashUrl but rather extSigUrl. This file contains the signature of the data file, which can be verified with the extVkey.

| `extVkey` | the public Key for verification | optional, 68 Characters |

In order to include the additional ext Field data, we suggest increasing the maximum size of the main metadata file from currently 512 to 1024 bytes.

### Extended Metadata - flexible but validable

In difference to the main metadata, the extended metadata should be updateable without having to use the cold key of the pool and without having to perform an on-chain transaction. The consumer of these data should still have the possibility to verify the authenticity of the data.

The operator notes all his additional pool information in the extended metadata (`extData.json`).

We propose the pool operator generate a new public-secret key-pair (`extData.skey` and `extData.vkey`)

```shell
cardano-cli shelley node key-gen
--cold-verification-key-file extData.vkey
--cold-signing-key-file extData.skey
--operational-certificate-issue-counter-file extData.counter
```

Then a new (not available yet) `cardano-cli` command generate the signed hash (`extData.sign`) .

```shell
cardano-cli shelley stake-pool rawdata-hash
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
cardano-cli shelley stake-pool rawdata-hash
cardano-cli shelley stake-pool rawdata-sign

--raw-metadata-file extData.json
--signing-key-file extData.skey
--out-file extData.sign
```

The operator now:

- has the `extData.json` and `extData.sign` files
- will publish them at some https:// URL (probably same host as the main metadata)
- use the `extData.vkey` string and the two extend file URLs to re-register the main metadata

This re-registration of the main metadata file with the `extData.vkey` and the two URLs is only necessary once. Afterwards, the operator can update his extended metadata at any time, generate the new signature and put both files online.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I understand, but the text is not clear.

Make clear which fields in the main metadata file these things correspond to. Say that you need the URL of the extended metadata json file, and signature file, that these are to fill in the extDataUrl and extSigUrl fields.

And what format exactly is the extVkey? Bech32 I presume? What prefix?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gufmar - can we get this addressed to have it merged next meeting?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about poolmd_vk for the bech32 prefix?


### Extended Metadata structure

In the following we describe a first minimal version of the extended Json file format

Since this extended metadata file can be updated at any time by the pool operator, a **serial number** is useful to easily identify updates.

There are main thematic sections with respective subordinate data fields:

- the **itn** section is about the verifiable linking of an ITN pool ticker with its counterpart in Mainnet to identify fraudulent duplicates. (already used as not standardized extension)
- the **pool** section contains additional information about the pool instance
- the **operator** section contains additional information about the people operating this pool
- the **owner** section contains additional information about the pool owner(s)



ToDo: describe the initial basic format, and a standard on how future CIPs need to approach an evolution of the extended metadata schema



#### Extended Metadata Schema
```
work in progress
```



#### Infrastructure Mapping
```
[
{"Code": "aws", "Name": "Amazon Cloud"},
{"Code": "google", "Name": "Google Cloud"},
{"Code": "azure", "Name": "Microsoft Cloud"},
{"Code": "digitalocean", "Name": "Digital Ocean"},
{"Code": "baremetall", "Name": "Bare Metal Server(local)"},
{"Code": "baremetalh", "Name": "Bare Metal Server(hosted)"},
{"Code": "ovh", "Name": "OVH Cloud"},
{"Code": "hetzner", "Name": "Hetzner"},
{"Code": "vultr", "Name": "Vultr"},
{"Code": "godaddy", "Name": "Go Daddy"},
{"Code": "aruba", "Name": "Aruba"},
{"Code": "hostinger", "Name": "Hostinger"},
{"Code": "othervps", "Name": "Other VPS"},
{"Code": "lpcsbc", "Name": "Low Power/Cost SBC (pi, rockspi, etc)"},
{"Code": "undisclosed", "Name": "Undisclosed"}
]
```

#### Operating System Mapping
```
[
{"Code": "linux", "Name": "Linux"},
{"Code": "osx", "Name": "Apple OSX"},
{"Code": "win", "Name": "Windows"},
{"Code": "freebsd", "Name": "FreeBSD"},
{"Code": "undisclosed", "Name": "Undisclosed"}
]
```

#### Pool Status Mapping
```
[
{"Code": "act","Name": "Active"},
{"Code": "ret","Name": "Retired"},
{"Code": "off","Name": "Offline for Maintenance"},
{"Code": "exp","Name": "Experimental"},
{"Code": "dnu","Name": "Do Not Delegate To This Pool"}
]
```
## Backwards compatibility

No fields are removed or changed in the current on chain metadata. The new `ext...` fields are optional and not necessary to parse for any entities that do not need additional information about a pool

## Reference implementation

N/A

## Copyright

This file is documentation, and therefore subject to CC-BY-4.0 (and not subject to Apache 2.0).
Loading