Author: ZmnSCPxj 2022-03-23 00:20:16
Published on: 2022-03-23T00:20:16+00:00
In a bitcoin-dev post, ZmnSCPxj has proposed the idea of microcode for Bitcoin script. The proposal involves defining a generic, low-level RISC language and a specific high-level language mapping to the low-level language (the microcode). Users can sacrifice Bitcoins to define new microcodes. The microcode can include general instructions like arithmetic, SECP256K1 scalar and point math, bytevector concatenation, sha256 midstates, bytevector bit manipulation, transaction introspection, etc. LLVM can be used to execute the defined microcode faster than expanding an OP-code SCRIPT to a UOP-code SCRIPT and having an interpreter loop over the UOP-code SCRIPT. However, concerns were raised regarding introducing a huge new dependency to the definition of consensus. Bugs in existing microcodes can be fixed by basing a new microcode from the existing one and redefining the buggy implementation. Existing Tapscripts need to be re-spent to point to the new bug-fixed microcode, but this requires an on-chain spend.
Updated on: 2023-06-15T18:19:11.132877+00:00