Skip to main content

DRep Delegation

Version Compatibility

DRep delegation is only available in Cardano Rosetta Java version 1.2.4 and later.

A DRep (Delegated Representative) is an entity defined in CIP-1694 that can vote on your behalf in Cardano governance.

This guide shows how to build and read dRepVoteDelegation operations in Cardano Rosetta Java, including how delegation state affects reward withdrawal flows.

What this operation does

Use operation type dRepVoteDelegation in /construction/preprocess and /construction/payloads when you want to delegate governance voting power.

At a high level, you provide:

  • a staking credential (who is delegating), and
  • DRep information (who receives the delegation, or a special delegation mode like abstain).

When to use each delegation mode

The Cardano Rosetta Java implementation supports four different types of DRep delegations:

  1. Abstain - Explicitly abstain from voting
  2. No Confidence - Express no confidence in the current governance system
  3. Key Hash - Delegate to a specific DRep identified by a key hash
  4. Script Hash - Delegate to a DRep managed by a script (identified by script hash)
DRep ID Format for key_hash/script_hash (CIP-129)
info

CIP-129 defines a tagged id format. In practice, this means a DRep id may include a prefix byte that already tells the id kind (key_hash or script_hash).

Accepted formats

  • 29-byte id with CIP-129 prefix (0x22 key hash, 0x23 script hash)
  • 28-byte id without prefix (raw hash)

type rules

  • Prefixed id: type is optional (inferred from prefix). If provided, it must match the prefix.
  • Raw 28-byte id: type is required (key_hash or script_hash).
  • API responses use 28-byte ids with a separate type field.

Examples:

  • With prefix (key hash): "id": "22abcdef0123456789abcdef0123456789abcdef0123456789abcdef01"
  • With prefix (script hash): "id": "23abcdef0123456789abcdef0123456789abcdef0123456789abcdef01"
  • Without prefix: "id": "abcdef0123456789abcdef0123456789abcdef0123456789abcdef01"

Input rules

A dRepVoteDelegation operation requires staking credential data and DRep data.

  • The stake key must be registered before delegation.
  • The operation includes a transaction fee but no deposit.
  • DRep delegation can be combined with other operations in a single transaction.

Construction examples

This option explicitly abstains from voting. No DRep ID is required.

{
"operation_identifier": {
"index": 0
},
"type": "dRepVoteDelegation",
"account": {
"address": "stake1uxa5pudxg77g3sdaddecmw8tvc6hmynywn49lltt4fmvn7caek7a5"
},
"metadata": {
"staking_credential": {
"hex_bytes": "1B400D60AAF34EAF6DCBAB9BBA46001A23497886CF11066F7846933D30E5AD3F",
"curve_type": "edwards25519"
},
"drep": {
"type": "abstain"
}
}
}

Data API representation

note

Data API support for DRep vote delegation is available in version 2.1.0 and later.

DRep vote delegation operations are also returned in /block and /block/transaction endpoints when applicable. Since a DRep delegation is included in the transaction as a certificate, every transaction that contains a DRep delegation certificate will include a corresponding DRep vote delegation operation in the API response.

Response examples

{
"transaction_identifier": {
"hash": "dcbff41c50c5b4012d49be5be75b11a0c5289515258ef4cf108eb6ec4ed5f37a"
},
"operations": [
// other operations
{
"operation_identifier": {
"index": 3
},
"type": "dRepVoteDelegation",
"account": {
"address": "stake1uxa5pudxg77g3sdaddecmw8tvc6hmynywn49lltt4fmvn7caek7a5"
},
"metadata": {
"staking_credential": {
"hex_bytes": "1B400D60AAF34EAF6DCBAB9BBA46001A23497886CF11066F7846933D30E5AD3F",
"curve_type": "edwards25519"
},
"drep": {
"type": "abstain"
}
}
}
// other operations here
]
}

DRep Delegation Workflow

A typical DRep delegation workflow includes:

  1. Ensure the stake key is registered (stakeKeyRegistration if needed).
  2. Submit a dRepVoteDelegation operation with one supported delegation mode.
  3. Verify the applied delegation in Data API responses (/block or /block/transaction).
  4. Update delegation later by submitting a new dRepVoteDelegation operation (for example, changing DRep or setting abstain/no_confidence).
  • CIP-1694: DRep governance model.
  • CIP-0129: prefixed hash format used by DRep ids.