DRep Delegation
DRep delegation is only available in Cardano Rosetta Java version 1.2.4 and later.
Delegated Representatives (DReps) are a key feature of Cardano's governance system introduced in CIP-1694. DReps allow ADA holders to delegate their voting power to trusted representatives who can vote on governance actions on their behalf, enabling broader participation in the governance process.
Construction API
In the request for /construction/preprocess
and /construction/payloads
endpoints, the operation type dRepVoteDelegation
is used to delegate voting power to a Delegated Representative (DRep) for Cardano governance. This operation allows users to participate in Cardano's governance system without having to vote directly on every proposal.
DRep Delegation Types
The Cardano Rosetta Java implementation supports four different types of DRep delegations:
- Abstain - Explicitly abstain from voting
- No Confidence - Express no confidence in the current governance system
- Key Hash - Delegate to a specific DRep identified by a key hash
- Script Hash - Delegate to a DRep managed by a script (identified by script hash)
DRep Vote Delegation Operations
A DRep vote delegation operation requires a staking credential and the DRep information. The staking key must be registered before delegation.
CIP-129 defines a tagged format for hashes where the first byte indicates the credential type (e.g., DRep key hash or script hash). This results in a 29-byte hash.
However, the cardano-rosetta-java API expects only the raw 28-byte hash. When providing a DRep ID for key_hash
or script_hash
types, you must remove the 1-byte prefix.
Example:
If your DRep key hash is 03_74984fae4ca1715fa1f8759f9d871015ac87f449a85dea6cf9956da1
(with prefix 03
), you must use 74984fae4ca1715fa1f8759f9d871015ac87f449a85dea6cf9956da1
in the API request.
- Abstain
- No Confidence
- Key Hash
- Script Hash
This option explicitly abstains from voting. No DRep ID is required.
{
"operation_identifier": {
"index": 0
},
"type": "dRepVoteDelegation",
"status": "success",
"account": {
"address": "stake1uxa5pudxg77g3sdaddecmw8tvc6hmynywn49lltt4fmvn7caek7a5"
},
"metadata": {
"staking_credential": {
"hex_bytes": "1B400D60AAF34EAF6DCBAB9BBA46001A23497886CF11066F7846933D30E5AD3F",
"curve_type": "edwards25519"
},
"drep": {
"type": "abstain"
}
}
}
This option expresses no confidence in the current governance system. No DRep ID is required.
{
"operation_identifier": {
"index": 0
},
"type": "dRepVoteDelegation",
"status": "success",
"account": {
"address": "stake1uxa5pudxg77g3sdaddecmw8tvc6hmynywn49lltt4fmvn7caek7a5"
},
"metadata": {
"staking_credential": {
"hex_bytes": "1B400D60AAF34EAF6DCBAB9BBA46001A23497886CF11066F7846933D30E5AD3F",
"curve_type": "edwards25519"
},
"drep": {
"type": "no_confidence"
}
}
}
When delegating to a specific DRep with a key hash, you must provide the DRep's ID (as a 28-byte raw hash, see notice above).
{
"operation_identifier": {
"index": 0
},
"type": "dRepVoteDelegation",
"status": "success",
"account": {
"address": "stake1uxa5pudxg77g3sdaddecmw8tvc6hmynywn49lltt4fmvn7caek7a5"
},
"metadata": {
"staking_credential": {
"hex_bytes": "1B400D60AAF34EAF6DCBAB9BBA46001A23497886CF11066F7846933D30E5AD3F",
"curve_type": "edwards25519"
},
"drep": {
"id": "74984fae4ca1715fa1f8759f9d871015ac87f449a85dea6cf9956da1",
"type": "key_hash"
}
}
}
Similar to key hash delegation, but delegating to a DRep managed by a script. This requires the script hash as the ID (as a 28-byte raw hash, see notice above).
{
"operation_identifier": {
"index": 0
},
"type": "dRepVoteDelegation",
"status": "success",
"account": {
"address": "stake1uxa5pudxg77g3sdaddecmw8tvc6hmynywn49lltt4fmvn7caek7a5"
},
"metadata": {
"staking_credential": {
"hex_bytes": "1B400D60AAF34EAF6DCBAB9BBA46001A23497886CF11066F7846933D30E5AD3F",
"curve_type": "edwards25519"
},
"drep": {
"id": "41868c2b4e5289022a3a1f6f47f86823bc605c609d2c47a2db58e04a",
"type": "script_hash"
}
}
}
Usage Notes
- The stake key must be registered before performing a DRep delegation.
- The operation includes a transaction fee but no deposit is required.
- DRep delegation can be combined with other operations in a single transaction.
Data API
The Data API support for DRep vote delegation is only available in version 1.3.0 and above (currently a work in progress).
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 Example
- Abstain
- No Confidence
- Key Hash
{
"transaction_identifier": {
"hash": "dcbff41c50c5b4012d49be5be75b11a0c5289515258ef4cf108eb6ec4ed5f37a"
},
"operations": [
// other operations
{
"operation_identifier": {
"index": 3
},
"type": "dRepVoteDelegation",
"status": "success",
"account": {
"address": "stake1uxa5pudxg77g3sdaddecmw8tvc6hmynywn49lltt4fmvn7caek7a5"
},
"metadata": {
"staking_credential": {
"hex_bytes": "1B400D60AAF34EAF6DCBAB9BBA46001A23497886CF11066F7846933D30E5AD3F",
"curve_type": "edwards25519"
},
"drep": {
"type": "abstain"
}
}
}
// other operations here
]
}
{
"transaction_identifier": {
"hash": "dcbff41c50c5b4012d49be5be75b11a0c5289515258ef4cf108eb6ec4ed5f37a"
},
"operations": [
// other operations
{
"operation_identifier": {
"index": 3
},
"type": "dRepVoteDelegation",
"status": "success",
"account": {
"address": "stake1uxa5pudxg77g3sdaddecmw8tvc6hmynywn49lltt4fmvn7caek7a5"
},
"metadata": {
"staking_credential": {
"hex_bytes": "1B400D60AAF34EAF6DCBAB9BBA46001A23497886CF11066F7846933D30E5AD3F",
"curve_type": "edwards25519"
},
"drep": {
"type": "no_confidence"
}
}
}
// other operations here
]
}
{
"transaction_identifier": {
"hash": "dcbff41c50c5b4012d49be5be75b11a0c5289515258ef4cf108eb6ec4ed5f37a"
},
"operations": [
// other operations
{
"operation_identifier": {
"index": 3
},
"type": "dRepVoteDelegation",
"status": "success",
"account": {
"address": "stake1uxa5pudxg77g3sdaddecmw8tvc6hmynywn49lltt4fmvn7caek7a5"
},
"metadata": {
"staking_credential": {
"hex_bytes": "1B400D60AAF34EAF6DCBAB9BBA46001A23497886CF11066F7846933D30E5AD3F",
"curve_type": "edwards25519"
},
"drep": {
"id": "74984fae4ca1715fa1f8759f9d871015ac87f449a85dea6cf9956da1",
"type": "key_hash"
}
}
}
// other operations here
]
}
Staking Workflow
A typical workflow for DRep delegation might include:
- Register a stake key (
stakeKeyRegistration
operation) - Delegate to a stake pool (
stakeDelegation
operation) - Delegate to a DRep (
dRepVoteDelegation
operation) - Update DRep delegation as needed with new
dRepVoteDelegation
operations - Optionally deregister the stake key when done (
stakeKeyDeregistration
operation)
Related Cardano Improvement Proposals
The DRep delegation functionality is based on the following Cardano Improvement Proposals: