hillstreetlabs / kimono

👘 Opening the kimono one time-lock at a time
32 stars 10 forks source link

Proposal and Creation #11

Closed dmdque closed 6 years ago

dmdque commented 6 years ago

We want to ensure that the staked funds corresponds with the committed messages (which contain all the hashes of the fragments).

There are two approaches:

  1. Make the "propose" and "create" steps atomic. Since createMessage consumes the hash of the IPFS location, the file must have already been uploaded (complete with all the fragments encrypted with revealers' public keys.) This requires the revealers to be "pre-selected" before performing the propose-create atomic action.

  2. Do some internal accounting to keep track of which funds have been staked for a secret revealing scheme that is actually active.

We're going with the simpler approach (1.) for now.

pfletcherhill commented 6 years ago

Solution for now:

  1. Ask each revealer to set total stake and stake per message.
  2. Client pulls eligible revealers from contract and decides which to pick (given total stake, available stake, stake per message). To avoid a race condition in most cases, client can choose revealers that have a lot of available stake.
  3. Client creates message with revealers from step (2).