Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

[FEATURE] - Add a `certificate view` command to decode certificates into human-readable form

已关闭
#1,487 0 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 1 天内回复

@palas 已经在做这个了。

开始于 2026年10月27日。

  • #1488 来自 @palas —— 未关闭

评估

这个 Issue 还没有评估数据。

描述

leios

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-file should accept - / pipes (via fileOrPipe) 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 view or 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 view and 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.me or cbor-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

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

IntersectMBO/cardano-cli 的其他 Issue

查看 IntersectMBO/cardano-cli 的全部 Issue

相似的 Issue

更多 Haskell Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。