Runera's Approach to Verifying Computations on Bitcoin
Last updated
Last updated
Runera adopts a method similar to BitVM for verifying arbitrary computations on the Bitcoin blockchain. It uses the primitive, non-Turing-complete Bitcoin Script code to simulate the effect of logic gate circuits, employing a large number of these circuits to achieve the functionality of complex virtual machines.
Logic Gate Circuits and Virtual Machines
Computers and processors are essentially input-output systems made up of numerous logic gate circuits. Runera simulates these input-output effects using Bitcoin Script, making it possible, in theory, to realize a Turing machine capable of performing all computable tasks by simulating logic gate circuits.
Interactive Fraud Proof Protocol
In the interactive fraud proof protocol used by Arbitrum, disputing parties engage in multiple rounds of communication to narrow down a disputed transaction instruction to a specific opcode. This opcode, along with its input and output results, is then executed directly on the Ethereum blockchain for verification. This process identifies the correct party and penalizes the malicious one.
Verification on Bitcoin
In the Bitcoin and BitVM schemes, the simplicity of Bitcoin Script prevents direct verification of EVM opcodes as done in Ethereum Layer2 solutions. Therefore, an alternative approach is used: opcodes compiled from any high-level language are decoded into the form of logic gate circuits. Bitcoin Script then simulates the operation of these circuits, allowing for the indirect simulation of virtual machine opcodes, such as those of the EVM, on the Bitcoin blockchain. The logic gate circuits serve as an Intermediate Representation (IR) between EVM opcodes and Bitcoin Script opcodes.
Using the Bristol Format in Runera
Runera employs the Bristol format to illustrate its logic gate circuit structure. The Bristol format is a standardized method used in circuit design to describe the layout of complex logic gate circuits, including inputs, outputs, gate functions, and connections. Here's an example of Bristol format code:
Components of the Bristol Format:
Circuit Size Information: The first line indicates the circuit has 4 logic gates and 7 signal lines.
Input Information: The second line shows the circuit has a one-bit input signal, consisting of three separate inputs (0), (2), and (3).
Output Information: The third line indicates the circuit has one output, represented by a single digit (6).
Gate Description: The remaining lines describe each logic gate's function, including the number of input and output lines, identifiers for these lines, and the gate function (e.g., INV for NOT, AND for AND).
Example Explanation:
1 1 0 1 INV
: A logic gate with one input line (0) and one output line (1) performing an INV (NOT) operation.
2 1 3 5 6 AND
: A logic gate with two input lines (3 and 5) and one output line (6) performing an AND operation.
In the example, the gates perform as follows:
INV (NOT) gate: If the input is 0, the output is 1, and vice versa.
AND gate: The output is 1 only if both input signals are 1.
Conclusion
Runera uses this approach to simulate and verify complex computations on the Bitcoin blockchain, ensuring secure and efficient operation without the need for a Turing-complete system. This method allows Runera to maintain the integrity and reliability of off-chain computations and state transitions.