public inbox for bitcoindev@googlegroups.com
 help / color / mirror / Atom feed
From: Prayank <prayank@tutanota•de>
To: Jeremy <jlrubin@mit•edu>
Cc: Bitcoin Dev <bitcoin-dev@lists•linuxfoundation.org>
Subject: Re: [bitcoin-dev] [Bitcoin Advent Calendar] Review of Smart Contract Concepts
Date: Thu, 23 Dec 2021 12:55:31 +0100 (CET)	[thread overview]
Message-ID: <Mrak4sc--7-2@tutanota.de> (raw)

[-- Attachment #1: Type: text/plain, Size: 1885 bytes --]

Hi Jeremy,

> This post covers some high-level smart contract concepts that different
opcodes or proposals could have (or not).
https://rubin.io/bitcoin/2021/12/04/advent-7/

Interesting post. I love the concept of recursion in programming. There is one Indian movie called 'Karthik calling Karthik' which is one of the ways I remember this concept. 

> Recursive is pretty much just a fancy way of saying “loops”. This is sometimesalso called “Turing Complete”.

Recently asked one dumb question on Stakexchange after reading a comment on reddit, maybe you can add anything new in this:

https://bitcoin.stackexchange.com/questions/111337/loops-in-bitcoin-scripting

> Here, the contract terminates after one canceled request by moving the coinelsewhere.  It’s possible to emulate recursive behavior a limited amount by“unrolling” a loop.

I think this is what I did in the above link where for loop was replaced with if-else statements.

> However, unrolling has it’s limits. When choices(action A or B) are introduced, unrolling can be less effective since you haveand exponential blowup (that means unrolling even like 32 steps might be toomany). However, there are some tricks that can be employed by a clever andcareful programmer to reduce this complexity through, for example, memoization.

Agree with limits and possibility of optimization.

> The key difference being that in the fully enumerated case we must know the exact specifics of the contract and how it will execute, and in the open ended contract case there are bits and pieces we can dynamically specify. If Alice is paid 1 BTC by December 25th, 2021 Midnight, then transfer 100 tokensto one of Bob’s Address B1, B2, or B3 at Bob’s discretion.

Interesting

> Signing the transaction fee rate as a function of locktime

TIL


-- 
Prayank

A3B1 E430 2298 178F

[-- Attachment #2: Type: text/html, Size: 2825 bytes --]

             reply	other threads:[~2021-12-23 11:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-23 11:55 Prayank [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-12-07 23:31 Jeremy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Mrak4sc--7-2@tutanota.de \
    --to=prayank@tutanota$(echo .)de \
    --cc=bitcoin-dev@lists$(echo .)linuxfoundation.org \
    --cc=jlrubin@mit$(echo .)edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox