Bitcoin Forum
May 07, 2024, 04:13:01 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: OP_MERKLE (an alternative to OP_CAT, SHASTREAM, SUBSTRING)  (Read 73 times)
watashi-kokoto (OP)
Sr. Member
****
Offline Offline

Activity: 682
Merit: 269



View Profile
December 21, 2021, 02:08:59 AM
 #1

I think a sha256 operation in bitcoin script that took two operands would fill all the requirements for substring (ignoring sha256 collision).

OP_MEKLE(a, b) = SHA256(a OP_CAT b)

Proving substrings using OP_MERKLE

We assume there are no sha256 collisions. If we validate in script, that:

OP_MERKLE(x,y) = SHA256(z)

Then we can be sure that x is a prefix of z, and y is a suffix of z. If z is constant, sha calculation can be amortized.

Proving substring checking can be of course done recursively, to prove even smaller substrings.

I wonder if Eltoo or covenants are somehow made easier using this.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!