Skip to content

Commit

Permalink
WIP-0002: fix tally change output formula
Browse files Browse the repository at this point in the history
  • Loading branch information
aesedepece committed Apr 14, 2020
1 parent e1c2228 commit 85fbaf3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions wip-0002.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,10 @@ message TallyTransaction {

**Tally evaluation.** The rules for deciding whether committers which have produced valid reveal transactions for the referred request such that they exist prior to the tally transaction itself (revealers) belong to the `output` or `slashed_identities` fields remain the same as they were before this proposal.

**Change output.** Given a request such that (1) it had insufficient commits, or (2) its count of committers outnumbers that of revealers, or (3) its count of slashed identies is not zero, or (4) any combination of 1, 2 and 3, a first `ValueTransferOutput` entry (change output) must exist in `outputs` such that it is spendable by the requestor, and its value equals the total value that was expected to be used for the `commit_fee` of the missing commits, plus the total value that was expected to be used for the `reward` and `reveal_fee` of the missing reveals, plus all the value that that was expected to be used as the `reward` of the slashed identities:
**Change output.** Given a request such that (1) it had insufficient commits, or (2) its count of committers outnumbers that of revealers, or (3) its count of slashed identies is not zero, or (4) any combination of 1, 2 and 3, a first `ValueTransferOutput` entry (change output) must exist in `outputs` such that it is spendable by the requestor, and its value equals the total value of the `reward`, `commit_fee` and `reveal_fee` of the missing commits, plus the total value of the `reward` and `reveal_fee` of the missing reveals, plus all the value that that was expected to be used as the `reward` of the slashed identities:

change = (reward + commit_fee) * (witnesses - committers_count) +
(reward + reveal_fee) * (witnesses - revealers_count) +
change = (reward + commit_fee + reveal_fee) * (witnesses - committers_count) +
reveal_fee * (committers_count - revealers_count) +
reward * slashed_count

**All outputs are equal in value.** All the `ValueTransferOutput` entries in `outputs` must have the same value, with the only exception of the change output.
Expand Down

0 comments on commit 85fbaf3

Please sign in to comment.