FourthState / plasma-mvp-sidechain

Cosmos SDK (Tendermint consensus) side-chain implementation for plasma
Apache License 2.0
112 stars 35 forks source link

Add a way to broadcast signatures onchain #148

Open colin-axner opened 5 years ago

colin-axner commented 5 years ago

Problem

There currently exists no way to send confirmation signatures to all nodes without spending the utxo's.

Proposal

This can be implemented in the same way as `include-deposit`, though I think users should still have the option to spend utxo's without confirm signatures being broadcasted first.
hamdiallam commented 4 years ago

Also requires a design doc/spec before implementing regarding how this fits into the data store.

wesgraham commented 4 years ago

Thoughts on implementation approach below.

Sample Usage:

./plasmacli tx broadcast-sigs ./plasmacli tx broadcast-sigs <input1, input2> ./plasmacli tx broadcast-sigs --confirmSigs0 --confirmSig1

Broadcasting Steps as follows: 1) Retrieve confirm sigs from local storage (iterating over inputs - accessing via clistore) 2) Parse confirm sigs (checking for --confirmSig flag usage overwriting confirm sigs) 3) Create new sigMsg containing confirm Signatures 4) Validate sigMsg 5) Broadcast using cli.BroadcastAndAwaitCommit()

Validate sigMsg includes: { plasma.Input1 plasma.Input2 }

Handling Steps as follows: AnteHandler defines sigMsgHandler 1) Retrieves sigMsgSigner 2) Validates Inputs 2a) validateConfirmSignatures() already exists

Add route for sigMsgHandler 1) Receives validated sigMsg 2) Stores Signature type in DataStore - contains {signature, inputs, signer}

@hamdiallam would appreciate insight on other things needed here

hamdiallam commented 4 years ago

We don't need the signer because we want to allow anyone to broadcast the confirm signature. The ante handler would check that the confirm signature is correctly constructed.

Looks good to me