Skip to content

Commit

Permalink
Add getVotingKeys, rotateVotingKey, getCurrentVotingKey api methods t…
Browse files Browse the repository at this point in the history
…o the API
  • Loading branch information
ehanoc committed Aug 8, 2022
1 parent da74c10 commit 3c7db95
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions CIP-0062/README.md
Expand Up @@ -142,14 +142,16 @@ The vote options. This is the set of options we can vote for.

# **`Delegation API`**

## **api.getVotingKey**(path: KeyPath): Promise\<Bip32PublicKey>

Should derive and return the wallets voting public key
## **api.getVotingKeys**(): Promise<cbor<PublicKey\>[]>
Should return a list of all the voting keys for the current wallet.

### **Returns**
`cbor\<vkey>` - cbor serialized 32 bytes (x, y) Ed25519 public key
An array with the cbor hex encoded public keys.

## **api.rotateVotingKey**(): Promise<cbor<PublicKey\>>
This call should explicitly rotate the current in-use voting key. Given the current `address_index` in the derivation path defined in [CIP-36](https://cips.cardano.org/cips/cip36/), it should be incremented by 1.

The **`votingKey`** should be derived from the following path.
The key should be derived from the following path.

```
m / 1694' / 1815' / account' / role' / address_index'
Expand All @@ -159,6 +161,17 @@ m / 1694' / 1815' / account' / role' / address_index'

`address_index` - index of the key to use.

### **Returns**
cbor hex encoded representation of the public key


## **api.getCurrentVotingKey**(): Promise\<cbor<PublicKey\>>

Should return the current in-use voting public-key. The wallet should maintain a reference to the current `adress_index` counter and return the public key for that index.

### **Returns**
cbor hex encoded representation of the public key.

## **api.submitDelegation(delegation: Delegation): Promise\<SignedDelegationMetadata>**

This endpoint should construct the cbor encoded delegation certificate according to the specs in [CIP-36 Example](https://github.com/Zeegomo/CIPs/blob/472181b9c69feeedae0b5b2db8b42d0cf4eb1a11/CIP-0036/README.md#example).
Expand Down

0 comments on commit 3c7db95

Please sign in to comment.