4 ms·
> Second, Bitcoin transactions are order-dependent within a block. That's a little confused. Yes, bitcoin transactions are order dependent but only in the ext
by nullc 5y ago
> Second, Bitcoin transactions are order-dependent within a block.
That's a little confused. Yes, bitcoin transactions are order dependent but only in the extremely narrow sense that a transactions can't double spend the same inputs and can't spend an output that hasn't been created yet.
Significant care has gone into assuring that bitcoin's script language remains a pure function of the transaction itself, so that all script validation can be performed once for a given transaction, can be performed with total parallelism with all other transactions, and isn't changed by adding/removing/reordering transactions. This means that any dependency between transactions must be explicit, by having the transactions consume outputs (which can be zero value) from the transactions they depend on.
Reordering transactions might change their validity due to input conflicts (which can be resolved very quickly using a hash table), but not due to the expensive-to-validate scripts in the transactions.
In ethereum contracts have fairly promiscuous access to shared data, including arbitrarily computed on the fly addresses. To discover a transactions dependencies you must execute it. One could imagine an implementation that executed all transactions eagerly in parallel, recorded a transcript of the data they touched, performed a union-find to cluster them, accepted one transaction from each disjoint cluster, then sequentially executed every remaining transaction (you can't execute the clusters in parallel, because their dependencies will change on re-execution with different state). ... but since dependencies are extremely common (people love to think sequentially, and the system makes that the easiest way to program) I expect that this would actually be a lot slower in practice in spite of the initial parallelism.
Aside, please don't link "bitcoinsv" -- it's a scam site setup by a conman that pretends to be Bitcoin's creator and uses billion dollar lawsuits to silence people who call out his fraud.