[FEATURE] - Add a `certificate view` command to decode certificates into human-readable form
I maintainer di solito rispondono entro 1 giorno
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
Internal/External
Internal
Area
Other: Certificates (stake pool registration, delegation, governance)
Describe the feature you'd like
A command, similar to cardano-cli debug transaction view, that takes a certificate file, decodes its CBOR, and prints the contents in a human-readable format (JSON or YAML). Users could then inspect a certificate before including it in a transaction.
Today a certificate file is a text envelope with a hex-encoded CBOR payload:
{
"type": "Certificate",
"description": "Stake Pool Registration Certificate",
"cborHex": "8a03581c..."
}
The CLI has no way to see what this certificate says without building a transaction around it and running debug transaction view on the result.
Motivating use case: stake pool registration
The pool operator and the pool owners are often different people. The operator creates the certificate with stake-pool registration-certificate, using the pool parameters (pledge, cost, margin, reward account, owners, relays, metadata). Later, the owners witness the transaction that registers the pool. Before that, they should be able to check the certificate's contents directly, without waiting for a transaction to be built. An owner should be able to run:
cardano-cli debug certificate view --certificate-file pool-registration.cert
and see, for example:
{
"Pool registration": {
"pool id": "pool1...",
"vrf key hash": "...",
"pledge": 100000000000,
"cost": 170000000,
"margin": "1/100",
"reward account": "stake1...",
"owners": [
"<stake key hash>"
],
"relays": [
{ "single host name": { "dnsName": "relay1.example.com", "port": 3001 } }
],
"metadata": {
"url": "https://example.com/pool.json",
"hash": "..."
}
}
}
With this output the owner can check that:
- the pledge is what they agreed to, and their stake covers it,
- the reward account, margin and cost are as agreed,
- the metadata URL and hash point to the expected file.
Proposed interface
Mirror the options of debug transaction view:
Usage: cardano-cli debug certificate view [--output-json | --output-yaml]
[--out-file FILEPATH]
--certificate-file FILEPATH
Print a certificate.
Available options:
--output-json Format certificate view output to JSON (default).
--output-yaml Format certificate view output to YAML.
--out-file FILEPATH Optional output file. Default is to write to stdout.
--certificate-file FILEPATH
Input filepath of the certificate.
- JSON is the default output format and YAML is optional, as in
debug transaction view. --certificate-fileshould accept-/ pipes (viafileOrPipe) like the tx view input does.- The command should support every certificate type the CLI can create: stake address registration/deregistration/delegation, pool registration/retirement, DRep registration/update/retirement, committee hot key authorization/cold key resignation, and the combined registration+delegation certificates.
Acceptance criteria
-
cardano-cli debug certificate viewor similar exists with--output-json(default),--output-yaml,--out-file,--certificate-file. - All certificate types produced by the CLI in the supported eras decode and render without falling through to
"unsupported certificate". - Pool registration output shows pool id, VRF key hash, pledge, cost, margin, reward account, owners, relays and metadata (URL + hash) in a readable form.
-
debug transaction viewand the new command render a given certificate identically. - Golden tests cover each certificate type in JSON and YAML; help goldens updated.
- Changelog fragment added.
Describe alternatives you've considered
- Build a transaction and run
debug transaction view. This works, but it means building a throwaway transaction (inputs, fee, etc.) only to inspect a certificate. The certificate also ends up next to unrelated transaction fields, and the pool params rendering is still the raw ledger form. - Decode the CBOR manually (e.g. with
cbor.meorcbor-diag). This needs knowledge of the ledger CDDL, gives no field names, and is error-prone. It isn't a reasonable expectation for pool owners. - Put the command under
stake-pool(e.g.stake-pool registration-certificate view). This is too narrow; the same need applies to delegation and governance certificate.
- Lingua principale
- Haskell
- Stelle
- 72
- Fork
- 26
- Merge medio
- 2g 1h
- PR unite (30g)
- 22
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di IntersectMBO/cardano-cli
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
IntersectMBO/cardano-cli#1306 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Show genesis hash mismatches in plain wordsForse già presa @palas l’ha presa 7 giorni fa. Apertaenhancement
IntersectMBO/cardano-cli#1481 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Add a dedicated pool registration certificate creation command to register or update a pool’s BLS key using existing pool parametersForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
IntersectMBO/cardano-cli#1479 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
performance
Difficoltà 4/5 3-5 giorni Idoneità per principianti 56/100
IntersectMBO/cardano-cli#1472 ·
I maintainer di solito rispondono entro 1 giorno
-
Clarify the origin and intended use of Plutus V2/V4 test fixturesForse già presa @Jimbo4350 l’ha presa 16 giorni fa. Aperta
IntersectMBO/cardano-cli#1464 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di IntersectMBO/cardano-cli
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
koalaman/shellcheck#3606 ·
I maintainer di solito rispondono entro 2 giorni
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
alunduil/collection-json.hs#436 ·
I maintainer di solito rispondono entro 1 giorno
-
feature: language report
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
haskellfoundation/haskell-2010-revised-report#107 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
newcomers
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
JacquesCarette/Drasil#5597 ·
I maintainer di solito rispondono entro 4 giorni
-
`unsafeReleaseAll` throws `ResourceRegistryUsedFromUntrackedThread` when called from an untracked threadForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100