Skip to content

CIP-129 header byte should allow inferring DRep type #657

@linconvidal

Description

@linconvidal

Context

Description

Per the original spec discussion in #288, the drep.type field should be optional when a CIP-129 compliant hex identifier is provided. The CIP-129 format includes a header byte that encodes the credential type:

  • 0x22 = DRep Key Hash (bits [7;4]=0010 DRep, bits [3;0]=0010 key hash)
  • 0x23 = DRep Script Hash (bits [7;4]=0010 DRep, bits [3;0]=0011 script hash)

Example from test:

"drep": {
  "id": "22f72050aa252ccc6bf75747184910c0b9386298167656f935d6b6c26a"
}

Here 22 indicates a DRep with key hash credential, so the type field should be inferable.

Current behavior

{
  "code": 5000,
  "message": "An error occurred",
  "details": {
    "message": "[operations[2].metadata.drep.type must not be null]"
  }
}

Expected behavior

When drep.id contains a CIP-129 hex identifier with header byte, the API should infer the type automatically and not require the type field.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Status

    Ready

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions