public inbox for bitcoindev@googlegroups.com
 help / color / mirror / Atom feed
* [bitcoin-dev] Standard BIP Draft: Turing Pseudo-Completeness
@ 2015-12-10  1:35 Luke Durback
  2015-12-10  4:03 ` Jeff Garzik
  2015-12-10  5:38 ` Jorge Timón
  0 siblings, 2 replies; 10+ messages in thread
From: Luke Durback @ 2015-12-10  1:35 UTC (permalink / raw)
  To: bitcoin-dev

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

Hello Bitcoin-Dev,

I hope this isn't out of line, but I joined the mailing list to try to
start a discussion on adding opcodes to make Script Turing Pseudo-Complete
as Wright suggested is possible.

---

In line with Wright's suggestion, I propose adding a return stack alongside
the, already existing, control stack.

The principle opcodes (excluding conditional versions of call and
return_from) needed are

OP_DEFINITION_START FunctionName:  The code that follows is the definition
of a new function to be named TransactionSenderAddress.FunctionName.  If
this function name is already taken, the transaction is marked invalid.
Within the transaction, the function can be called simply as FunctionName.

OP_DEFINITION_END:  This ends a function definition

OP_FUNCTION_NAME FunctionName:  Gives the current transaction the name
FunctionName (this is necessary to build recursive functions)

---

OP_CALL Namespace.FunctionName Value TransactionFee:  This marks the
transaction as valid.  It also pushes the current execution location onto
the return stack, debits the calling transaction by the TransactionFee and
Value, and creates a new transaction specified by Namespace.FunctionName
with both stacks continued from before (this may be dangerous, but I see no
way around it) with the specified value.

OP_RETURN_FROM_CALL_AND_CONTINUE:  This pops the top value off the return
stack and continues from the specified location with both stacks in tact.

---

It would also be useful if a transaction can create another transaction
arbitrarily, so to prepare for that, I additionally propose

OP_NAMESPACE:  Pushes the current namespace onto the control stack

This, combined with the ability to make new transactions arbitrarily would
allow a function to pay its creator.



I understand that this isn't all that is needed, but I think it's a start.
I hope this proposal has met you all well,

Luke Durback

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

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

end of thread, other threads:[~2015-12-12 21:01 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-10  1:35 [bitcoin-dev] Standard BIP Draft: Turing Pseudo-Completeness Luke Durback
2015-12-10  4:03 ` Jeff Garzik
2015-12-10  4:23   ` Luke Durback
2015-12-10  5:38 ` Jorge Timón
2015-12-10  6:36   ` Luke Durback
2015-12-11 15:36     ` Jorge Timón
2015-12-11 15:38       ` Jorge Timón
2015-12-11 21:45       ` Luke Durback
2015-12-12 20:00         ` Jorge Timón
2015-12-12 21:01           ` Emin Gün Sirer

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