[FEATURE] - Add a `certificate view` command to decode certificates into human-readable form
维护者通常 1 天内回复
评估
这个 Issue 还没有评估数据。
描述
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.
- 主要语言
- Haskell
- 星标
- 72
- 派生
- 26
- 平均合并
- 2 天 1 小时
- 30 天内合并 PR
- 22
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
IntersectMBO/cardano-cli 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
IntersectMBO/cardano-cli#1306 · 2 条评论 ·
维护者通常 1 天内回复
-
Show genesis hash mismatches in plain words可能已有人在做 @palas 于 7 天前认领。 未关闭enhancement
IntersectMBO/cardano-cli#1481 · 已指派 1 人 ·
维护者通常 1 天内回复
-
Add a dedicated pool registration certificate creation command to register or update a pool’s BLS key using existing pool parameters可能已有人在做 @carbolymer 于 2 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 52/100
IntersectMBO/cardano-cli#1479 · 已指派 1 人 ·
维护者通常 1 天内回复
-
performance
难度 4/5 3-5 天 新手友好度 56/100
IntersectMBO/cardano-cli#1472 ·
维护者通常 1 天内回复
-
Clarify the origin and intended use of Plutus V2/V4 test fixtures可能已有人在做 @Jimbo4350 于 17 天前认领。 未关闭
IntersectMBO/cardano-cli#1464 · 已指派 1 人 ·
维护者通常 1 天内回复
查看 IntersectMBO/cardano-cli 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 62/100
-
area:stack expires:card-driven gap
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
koalaman/shellcheck#3606 ·
维护者通常 2 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 72/100
alunduil/collection-json.hs#436 ·
维护者通常 1 天内回复
-
feature: language report
难度 2/5 1-3 小时 新手友好度 68/100
haskellfoundation/haskell-2010-revised-report#107 · 3 条评论 ·
维护者通常 1 天内回复