@@ -314,60 +314,6 @@ \subsection{Implementation on Bitcoin}
314314 \Return {$ z_1 ,\dots ,z_n$ }
315315\end {algorithm }\label {alg:intermediate_steps }
316316
317- \begin {example }
318- Consider a fairly simple program $ f$ :
319- \begin {equation* }
320- f(a,b) = 25a^2b^2{(a+b)}^2
321- \end {equation* }
322-
323- Additionally, assume that we can abstract the multiplication operation
324- via the opcode \texttt {OP\_ MUL } (which, in fact, is already natively
325- implemented in Bitcoin Script, although the size of such script
326- for two 254-bit numbers exceeds 60kB).
327- Then, the implementation of $ f$ in Bitcoin Script could be:
328- \begin {empheqboxed }
329- \begin {align* }
330- &\elem {a} \elem {b} \opcode {\texttt {OP\_ 2DUP }}
331- \opcode {\texttt {OP\_ ADD }} \opcode {\texttt {OP\_ MUL }}
332- \opcode {\texttt {OP\_ MUL }}
333- \opcode {\texttt {OP\_ DUP }} \opcode {\texttt {OP\_ DUP }} \\ &
334- \opcode {\texttt {OP\_ ADD }} \opcode {\texttt {OP\_ DUP }}
335- \opcode {\texttt {OP\_ ADD }} \opcode {\texttt {OP\_ ADD }}
336- \opcode {\texttt {OP\_ DUP }} \opcode {\texttt {OP\_ MUL }}
337- \end {align* }
338- \end {empheqboxed }
339-
340- Fairly complex, right? Let us split the function into three shards
341- $ \textcolor {red!80!white}{f_1}$ , $ \textcolor {blue}{f_2}$ , and
342- $ \textcolor {green!60!black}{f_3}$ :
343- \begin {align* }
344- \textcolor {red!80!white}{f_1}(x,y) = xy(x+y), \quad
345- \textcolor {blue}{f_2}(z) = 5z, \quad
346- \textcolor {green!60!black}{f_3}(w) = w^2
347- \end {align* }
348-
349- This way, it is fairly easy to see that $ f(a,b) =
350- \textcolor {green!60!black}{f_3} \circ \textcolor {blue}{f_2} \circ
351- \textcolor {red!80!white}{f_1}(a,b)$ . In turn, in Bitcoin
352- script we can represent $ f$ as $ \textcolor {red!80!white}{f_1}
353- \parallel \textcolor {blue}{f_2} \parallel \textcolor {green!60!black}{f_3}$ :
354- \begin {empheqboxed }
355- \begin {align* }
356- &\elem {a} \elem {b}
357- \textcolor {red!80!white}{\opcode {\texttt {OP\_ 2DUP }}
358- \opcode {\texttt {OP\_ ADD }} \opcode {\texttt {OP\_ MUL }}
359- \opcode {\texttt {OP\_ MUL }}} &&
360- \textcolor {gray!80!black}{\text {// $ xy(x+y)$ }} \\
361- &\textcolor {blue}{\opcode {\texttt {OP\_ DUP }}
362- \opcode {\texttt {OP\_ DUP }} \opcode {\texttt {OP\_ ADD }}
363- \opcode {\texttt {OP\_ DUP }} \opcode {\texttt {OP\_ ADD }}
364- \opcode {\texttt {OP\_ ADD }}} && \textcolor {gray!80!black}{\text {// $ 5 z$ }} \\
365- &\textcolor {green!60!black}{\opcode {\texttt {OP\_ DUP }}
366- \opcode {\texttt {OP\_ MUL }}}&&\textcolor {gray!80!black}{\text {// $ w^2 $ }}
367- \end {align* }
368- \end {empheqboxed }
369- \end {example }
370-
371317\begin {example }
372318 Consider a fairly simple program $ f$ :
373319 \begin {equation* }
0 commit comments