Skip to content

Commit

Permalink
removed spendingCount and epiration
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Williams committed Feb 2, 2023
1 parent 86275eb commit 3ed292a
Showing 1 changed file with 9 additions and 35 deletions.
44 changes: 9 additions & 35 deletions CIP-0062/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,67 +90,47 @@ interface VotingCredentials {
```
Information used to represent a wallet's voting credentials.

* voteKey - Derivation as described within [CIP-0036](https://github.com/cardano-foundation/CIPs/tree/master/CIP-0036), wallets should use `address_index`= 0.
* voteKey - Derivation as described within [CIP-0036](https://github.com/cardano-foundation/CIPs/tree/master/CIP-0036), wallets should use `address_index` = 0.
* stakingCredential - At the moment, the only supported staking credential is a public staking key. This is used to represent the wallet's staked ADA.

#### BlockDate

```ts
interface BlockDate {
epoch: number
slot: number
}
```

* epoch - an epoch value on the voting blockchain.
* slot - a block slot number on the voting blockchain.

#### Proposal

```ts
interface Proposal {
votePublic: false
votePublic: boolean //false
votePlanId: string
proposalIndex: number
voteOptions: number
voteEncKey: string
}|{
votePublic: true
votePublic: boolean //true
votePlanId: string
proposalIndex: number
}
```

Proposal information.
* votePublic - Boolean flag for if this `Proposal` should be included in a public or private vote. Addtional fields are required in the `Proposal` for private votes. IF the incorrect fields are provided based on `votePublic` then a `InvalidProposalError` should be thrown.
* votePublic - Boolean flag for if this `Proposal` should be included in a public or private vote. Additional fields are required in the `Proposal` for private votes. IF the incorrect fields are provided based on `votePublic` then a `InvalidProposalError` should be thrown.
* votePlanId - Hex encoded string to represent vote plan unique identifier. This will be the same as anchored on voting blockchain, and is managed by the dApp.
* proposalIndex - The index of the `Proposal` within the vote plan.
* voteOptions - Total number of vote options. Only present in a private/encrypted vote.
* voteEncKey - If this vote is private, this field is present and contains the key used to encrypt the vote. When the vote is public, this key is absent from the `Proposal`.
* voteEncKey - If this vote is private, this field is present and contains the key used to encrypt the vote. When the vote is public, this key is absent from the `Proposal`. ***ADD DESCRIPTION IN HERE***

#### Vote

```ts
interface Vote {
proposal: Proposal;
choice: number;
expiration: BlockDate;
purpose: VotingPurpose;
spendingCounter?: number;
spendingCounterLane?: number;
}
```

An individual raw Unsigned Vote record.

* proposal - The [Proposal](#proposal) being voted on.
* choice - This value MUST match one of the available `voteOptions` in the `proposal` element. An `UnknownChoiceError` should be thrown if the value is not one of the valid `voteOptions` of the `proposal`.
* expiration - voting blockchain epoch \& slot for when the vote will expire. This value is supplied and maintained by the dApp, and forms a necessary component of a [Vote](#vote)
* purpose - The [voting purpose](#voting-purpose) being voted on. (Currently always 0).
* spendingCounter - *Optional*, but if present, the spending counter is used to prevent double voting. The spending counter for the vote transaction will be supplied and maintained by the dApp. The dApp will manage supplying this in the correct order, and this should not be enforced by the Wallet. If not present but required defaults to 0.
* spendingCounterLane - *Optional*, if not present but required defaults to 0. The spending counter may be spread across multiple lanes, this field defines which lane the spending counter relates to.

Note: `spendingCounter` and `spendingCounterLane` are fully managed by the voting dApp and if present are used to create the vote fragment for proper submission to the voting system. The wallet should simply use the values defined, and does not need to track them.

#### Delegation

Expand All @@ -164,7 +144,7 @@ interface Delegation {
The record of a voters delegation.

* delegations - List of [Weighted Keys](#WeightedKey) denoting the `voteKey` and `weight` of each delegation.
* purpose - The assoicated [Voting Purpose](#voting-purpose). A voter may have multiple active delegations for different purposes, but only once active delegation per unique `Voting Purpose`.
* purpose - The associated [Voting Purpose](#voting-purpose). A voter may have multiple active delegations for different purposes, but only once active delegation per unique `Voting Purpose`.

#### DelegatedCertificate

Expand Down Expand Up @@ -203,10 +183,9 @@ type enum APIErrorCode {
UnsupportedVotingPurpose = -100
InvalidArgumentError = -101
UnknownChoiceError = -102
InvalidBlockDateError = -103
InvalidProposalError = -103
InvalidVotePlanError = -104
InvalidVoteOptionError = -105
InvalidProposalError = -106
}

interface APIError {
Expand Down Expand Up @@ -236,10 +215,9 @@ API Error Codes, which are continue to be valid for this API Extension.
* InvalidArgumentError - Generic error for errors in the formatting of the arguments.
* UnknownChoiceError - If a `choice` is not within the
[`proposal`](#proposal) option set.
* InvalidBlockDateError - If a [block date](#blockdate) is invalid.
* InvalidProposalError - If the incorrect fields are provided based on if a `Proposal` is meant to be public or private.
* InvalidVotePlanError - If the `votePlanId` is not a valid vote plan.
* InvalidVoteOptionError - If the `index` is not a valid vote option.
* InvalidProposalError - If the incorrect fields are provided based on if a `Proposal` is meant to be public or private.

##### APIError elements

Expand Down Expand Up @@ -408,10 +386,6 @@ Recall from [CIP-36](https://github.com/cardano-foundation/CIPs/tree/master/CIP-
TODO
### Test Vector
See [test vector file](./test-vector.md).
## Rationale
To provide [CIP-36](https://cips.cardano.org/cips/cip36/) style governance specific functionality to wallet's and expose such API to the dApps (i.e Voting Centers).
Expand All @@ -436,4 +410,4 @@ The other reason for this specification is to have a specific, but optional, nam

## Copyright

This CIP is licensed under [CC-BY-4.0](https://creativecommons.org/licenses/by/4.0/legalcode)
This CIP is licensed under [CC-BY-4.0](https://creativecommons.org/licenses/by/4.0/legalcode).

0 comments on commit 3ed292a

Please sign in to comment.