Johan Torås Halseth [ARCHIVE] on Nostr: 📅 Original date posted:2023-09-29 🗒️ Summary of this message: The author has ...
📅 Original date posted:2023-09-29
🗒️ Summary of this message: The author has implemented the MATT challenge protocol in Bitcoin Script and provides a detailed description and instructions on how to run the code. They propose using OP_CHECKCONTRACTVERIFY and OP_CAT opcodes to trace program execution and challenge computations. The next steps involve creating a generic framework for compiling high-level programs into MATT-compatible Bitcoin Scripts.
📝 Original message:
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.mdTLDR; 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.htmlPublished at
2023-10-03 21:44:19Event JSON
{
"id": "7bc9c08fa1bc3ba722db8cbe49cc0211a5df2f16bebd09f7a6b47bcb0e809374",
"pubkey": "0866a9dfe968ace2a1cf22ff20e534684828184e3a538212dddae2abbb41465f",
"created_at": 1696369459,
"kind": 1,
"tags": [
[
"e",
"10089c2254f5cd090ca085a82e4fe62a2ce0652b8e5a2dae744d5f65cacbcc4a",
"",
"reply"
],
[
"p",
"a23dbf6c6cc83e14cc3df4e56cc71845f611908084cfe620e83e40c06ccdd3d0"
]
],
"content": "📅 Original date posted:2023-09-29\n🗒️ Summary of this message: The author has implemented the MATT challenge protocol in Bitcoin Script and provides a detailed description and instructions on how to run the code. They propose using OP_CHECKCONTRACTVERIFY and OP_CAT opcodes to trace program execution and challenge computations. The next steps involve creating a generic framework for compiling high-level programs into MATT-compatible Bitcoin Scripts.\n📝 Original message:\nHi, all!\n\nI've been working on an implementation of the original MATT challenge\nprotocol[0], with a detailed description of how we go from a\n\"high-level arbitrary program\" to something that can be verified\non-chain in Bitcoin Script.\n\nYou can find the write-up here, which also includes instructions of\nhow to run the code and inspect the transactions using a local block\nexplorer: https://github.com/halseth/mattlab/blob/main/docs/challenge.md\n\nTLDR; Using the proposed opcode OP_CHECKCONTRACTVERIFY and OP_CAT, we\nshow to trace execution of the program `multiply` [1] and challenge\nthis computation in O(n logn) on-chain transactions:\n\nfunc multiply(x int) int {\n i := 0\n while {\n if i \u003c 8 {\n x = x + x\n i = i + 1\n } else {\n break\n }\n }\n return x\n}\n\nNext steps would be to make this a generic framework with tools to\nautomatically compile arbitrary high-level programs down to\nMATT-compatible Bitcoin Scripts.\n\nAll feedback appreciated!\n\n- Johan\n\n[0] https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2022-November/021182.html\n[1] https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2022-November/021205.html",
"sig": "4398611dd2f3f626029592b0bada2fc5a1e0d47ff1b95a0627e5cdfd5768ca477579944f22923ccef8f87554c3428b7e961253de080c11b12bdbd7f99b411212"
}