What are you thinking of adding a second sequence number to, txs?
Right now, in bitcoin, adding a signature to a tx can change it from invalid to valid. You cannot change the amount of money that goes to each output. The only thing you can change by applying the signature is making it valid.
Some txs require signatures from multiple people. Once such a tx is part way signed, if you want to edit the contents of the tx, you have to have everyone re-sign the tx.
So if there are 5 things we are betting on, and I want you to commit to paying me if I win, then there are (5^2) - 1 different transactions you need to sign.
Maybe you are proposing that Hivemind will have a version of bitcoin script where adding a signature can change the amount of money that goes to each output, which would be a very radical change to bitcoin.
In Flying Fox I use 3 signatures when closing a channel.
BobOrAliceSigns(BobSigns(AliceSigns(ChannelTx)), BetResults)
The final 3rd signature wraps up the results of each bet into the tx.
Without the 3rd signature, it would be possible for miners to remove some of the BetResults before processing your Tx, and then the right person wouldn't win the bet.
Bitcoin scripting would look pretty different if you made the 3rd signature process possible. Bitcoin has an opcode for checking signatures, but the opcode expects the entire transaction to be signed in the normal way. What we need is to check a separate signature for each bet in the BetResults, and make sure that the signatures in BetResults is from the judges specified in ChannelTx, and make sure that the final balances are correctly summed from all the validator's judgements.
so you need an opcode that expects all this on the stack: [Sig1 Sig2 Bets SequenceNumber BetResults Sig3]
and the opcode will check that sig2 and sig1 sign over bets and SequenceNumber,
and that betresults is a valid result from bets,
and that sig3 is over betResults,
And that sig3 is from one of the 2 participants.
Bets would need to be a lists of merkle roots of things being bet on, paired with the amount bet on it.
BetResults uses the merkle root to show the pubkey of the oracles, and it has a signature from the oracle that is over: the hash of the bet, and the outcome.
When spending from this tx, to calculate the value of the unspent outputs, you need to look in the outcomes in BetResults.
As well as being a part of the scriptpubkey of the tx that closes channels, BetResults needs to be in the scriptsig. That way, if Bob tries to provide counter-evidence, we have something to compare his evidence against.
We need a way to enforce that the same BetResults are used in both the scriptsig and scriptpubkey.
Since BetResults is the biggest part, it is especially unfortunate if we have to write it out twice on each tx.
We need a timer stopping spending from the channel Alice closed, that way Bob has a chance to provide more evidence about the channel's history.
nlocktime is no good in this situation, because Bob needs to be able to spend from the tx to provide evidence.
We would need the behaviour of nlocktime in an opcode, so that we can use a conditional so the nlocktime only applies to taking the money from the channel, and not to updating it's history. I think an opcode that gives the current blockheight would be the perfect addition.
We would need a way to tell if Bob provided any evidence that Alice failed to reveal. Bitcoin script doesn't have looping, so this needs to be a new opcode.
Have you written much bitcoin script before?
Can you tell the outputs from these?
01 02 01 02 93
01 01 64 01 02 67 01 03 68 01 02 87 64 01 07 68
If you added the better lightening network to truthcoin, maybe they would eventually put it into bitcoin too.
Bitcoin tx are currently limited to 10k bytes.
A single bet's space takes: hash of the bet, oracle's pubkey, 3 signatures, which would be around 100-150 bytes once we optimized.
So we could fit around 60 to 100 simultaneous bets into a channel made in this way, even more if we change tx size limit.
The forum is really buggy for me lately. I have to use my browser memory to find long URLs that point to this website, just to see the page.