@retep, here's roughly how I imagine sharding a node could be done without diluting hashing power across multiple separate chains (that sounds terrible!):
First I'll assume we include in the block headers the digest of a utxo tree keyed by (txid:n, script) instead of by (script, txid:n), as this will turn out to be much more natural, for this purpose at least. Second, I'll assume the tx digest is created from the authenticated prefix tree of their txids, which will also turn out to be much more natural. (Last minute thought: doesn't the tx ordering matter in the usual tx Merkle tree, i.e. earlier txs can't spent TxOuts created by later txs? Or can it just be assumed that the block is valid if there exists
some valid ordering which is up to the verifier to construct?) The radix size turns out not to matter, but let's call it k.
Distributed block constructionDivision of labor is as follows: We have a
coordinator who directs the efforts of N well-mirrored
branch curators who separately update each of the utxo tree branches below level logk(N), and process subblocks of any number of transactions.
A branch curator downloads the incoming txs whose txids lie in his particular branch. Notice that due to our convenient choice of keying, all of his newly created TxOuts will lie in his own branch. For each TxIn in a given tx, he needs to download the corresponding TxOut from his relevant well-mirrored counterparts. Note that TxOuts will always be uniquely identifiable with only a few bytes, even for extremely large utxo sets. Also, having to download the TxOuts for the corresponding TxIns isn't typically that much extra data, relatively speaking - ~40 bytes/corresponding TxOut, compared to ~500 bytes for the average tx having 2-3 TxIns. With just these TxOuts, he can verify that his txs are self-consistent, but cannot know whether any given TxOut has already been spent.
This is where the coordinator comes into play. He cycles through the N branches, and for each branch, nominates one of the curator mirrors that wishes to submit a subblock. This branch curator then gathers a bunch of self-consistent txs, and compresses the few byte ids of their TxIns into a prefix tree. He sends his respective counterparts - or rather, one of their mirrors who are up to date with the previous subblock - the appropriate branches, and they send back subbranches of those that are invalid
with respect to the previous subblock. Note that this communication is cheap - a few bytes per tx. He then removes the invalid txs from his bunch, informs his counterparts of the TxIns that remain so they can delete the corresponding utxos from their respective utxo tree branches, deletes those relevant to him, inserts all of his newly created TxOuts into his utxo tree branch, and builds his tx tree. He submits his tx and utxo tree root hashes to the coordinator, who also gathers the other branch curators' updated utxo tree root hashes. This data is used to compute the full tx and utxo tree root hashes, which is then finally submitted to miners.
When the coordinator has cycled through all N branches, he goes back to the first who we note can perform very efficient updates to his existing tx tree.
Some notes:
- Mutual trust between all parties was assumed in lots of ways, but this could be weakened using a fraud detection and punishments scheme - ingredients being e.g. authenticated sum trees, fidelity bonds, and lots of eyes to audit each step. Trusted hardware or SCIP proofs at each step would be the ideal future tech for trust-free cooperation.
- The job of the coordinator is cheap and easy. The branch curators could all simultaneously replicate all of its functions, except nominating subblock submissions. For that they'd need a consensus forming scheme. Perhaps miners including into their coinbase a digest of their preferred next several subblock nominees, and broadcasting sub-difficulty PoW would be a good alternative.
- Subblock nominees could be selected by largest estimated total fee, or estimated total fee / total size of txs, or some more complicated metric that takes into account changes to the utxo set size.
- Revision requests for a chain of subblocks could be managed such that that the whole chain will be valid when each of the subblocks come back revised, thus speeding up the rate at which new blocks can be added to the chain.
- Nearby branch curators will have no overlap in txs submitted, and very little overlap in utxos spent by them (only happens for double spends).
Distributed block verificationTo catch up with other miners' blocks, branch curators would download the first few identifying bytes of the txids in their respective branches, to find which txs need to be included in the update. The ones they don't have are downloaded. Then in rounds, they would perform collective updates to the tx and utxo trees, so that txs that depend on previous txs will all eventually be covered. If by the end the tx and utxo tree root hashes match those in the block header, the block is valid.
Future tech: branch curators would instead simply verify a small chain of SCIP proofs
Additional note: branch curators can additionally maintain an index of (script: txid:n) for their branch, in order to aid lightweight clients doing lookups by script.