public inbox for bitcoindev@googlegroups.com
 help / color / mirror / Atom feed
* [bitcoin-dev] MATT: [demo] Optimistic execution of arbitrary programs
@ 2023-09-29 13:14 Johan Torås Halseth
  2023-10-02 15:10 ` Anthony Towns
  0 siblings, 1 reply; 3+ messages in thread
From: Johan Torås Halseth @ 2023-09-29 13:14 UTC (permalink / raw)
  To: Bitcoin Protocol Discussion

Hi, all!

I've been working on an implementation of the original MATT challenge
protocol[0], with a detailed description of how we go from a
"high-level arbitrary program" to something that can be verified
on-chain in Bitcoin Script.

You can find the write-up here, which also includes instructions of
how to run the code and inspect the transactions using a local block
explorer: https://github.com/halseth/mattlab/blob/main/docs/challenge.md

TLDR; Using the proposed opcode OP_CHECKCONTRACTVERIFY and OP_CAT, we
show to trace execution of the program `multiply` [1] and challenge
this computation in O(n logn) on-chain transactions:

func multiply(x int) int {
    i := 0
    while {
        if i < 8 {
            x = x + x
            i = i + 1
        } else {
            break
        }
    }
    return x
}

Next steps would be to make this a generic framework with tools to
automatically compile arbitrary high-level programs down to
MATT-compatible Bitcoin Scripts.

All feedback appreciated!

- Johan

[0] https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2022-November/021182.html
[1] https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2022-November/021205.html


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-10-03  7:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-29 13:14 [bitcoin-dev] MATT: [demo] Optimistic execution of arbitrary programs Johan Torås Halseth
2023-10-02 15:10 ` Anthony Towns
2023-10-03  7:53   ` Johan Torås Halseth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox