IntersectMBO / cardano-cli

This repository contains sources for the command-line interface (CLI) tool for interacting with the Cardano blockchain.
Apache License 2.0
39 stars 15 forks source link

[FEATURE] - Add support for registering scripts as DReps. #559

Closed CarlosLopezDeLara closed 9 months ago

CarlosLopezDeLara commented 9 months ago

What

Add support for registering scripts as DReps.

Expand cardano-cli conway governance drep registration-certificate so that it can also take --script-file and --script-hash as inputs.

The new flags should be alternatives to the existing --drep-verification-key, --drep-verification-key-file, and --drep-key-hash

The resulting certificate must comply with the conway cddl, where:

reg_drep_cert = (16, drep_credential, coin, anchor / null)

drep_credential = credential

credential =
  [  0, addr_keyhash
  // 1, scripthash
  ]

Why

From CIP1694

Registered DReps are identified by a credential that can be either:

A verification key (Ed25519) A native or Plutus script

Personas

Definition of Done (DoD)

NOTE: Ideally, we should merge only fully implemented and tested features into the master branch. So all the above steps are required for the PR to be merged.
In order to avoid the PRs becoming stale and requiring to be rebased on master, these can be merged after a reasonable time (current agreement is 3 days) if the System Test Engineer Owner's sign-off was not provided (last step in the DoD).

IMPORTANT: Any deviation from the plan should be discussed and agreed as a comment in the Feature file.

Sign-off

Related PRs

  1. PR # here

Acceptance Criteria

carlhammann commented 9 months ago

We'll also have to make sure that the filtering by DRep credential done in the drep-state and drep-stake-distribution queries works with scripts and keys.

Edit: I opened an issue: #562