Author: Tier Nolan 2017-05-24 08:50:22
Published on: 2017-05-24T08:50:22+00:00
In an email conversation, Paul Sztorc and ZmnSCPxj discussed the technical details of implementing sidechains using OP codes. The critical hashes for sidechains are added when a coinbase is processed and any output having the form "OP_RETURN" counts as a potential critical hash. When a block is processed, the key-value pair (hash, block_height) is added to a hash map. The “OP_BRIBE” opcode checks that the given hash is in the hash map and replaces the top element on the stack with the pass/fail result. However, the height matching the current block is not checked, though it is noted as a TODO. There is also the issue of multiple bribes for the same chain in a single coinbase, which would not be fair. Therefore, it is suggested that only the first hash with a particular sidechain ID counts and miners can only accept the bribe from one miner for each sidechain for each block.“OP_BRIBE_VERIFY” would cause the script to fail if the hash wasn't in the coinbase or cause a script failure otherwise. Transactions can be propagated over the network by having the rule that the opcode passes as long as the hash is near the current block height. In case of deposit/withdrawal code, further details are still being examined.
Updated on: 2023-06-12T00:59:24.774086+00:00