Pages:
Author

Topic: Using OP_CAT (Read 4560 times)

sr. member
Activity: 352
Merit: 250
https://www.realitykeys.com
September 09, 2014, 09:11:03 PM
#46
You just have to have alice and bob prove that they know the discrete logs of their own pubkeys (e.g. they sign a message with it while setting up their exchange). Work through the algebra and you'll see why.

Ah, sweet.

I guess we already fulfill this in my demo example (this script run with the --ecc-voodoo flag):
https://github.com/edmundedgar/realitykeys-examples/blob/master/realitykeysdemo.py
...because for convenience we have Alice and Bob temporarily queue up the funds that they intend to put into the contract transaction by paying to the hash of their own pubkey, so the contract transaction never happens unless they can both fund it by signing with the private keys of the pubkeys they've exchanged.

If you have logs for #bitcoin from last year, I walked through the somewhat different pay to contract case, which is I think mostly what you're referring to-- in that case you alwas make the contract key G*HMAC(message,pubkey) to avoid someone setting their pubkey to an alternative contract.

I haven't been able to find this so any more hints would be helpful, although I'm learning a lot wading through various IRC logs looking for it...
staff
Activity: 4284
Merit: 8808
September 07, 2014, 02:17:29 PM
#45
You just have to have alice and bob prove that they know the discrete logs of their own pubkeys (e.g. they sign a message with it while setting up their exchange). Work through the algebra and you'll see why.

If you have logs for #bitcoin from last year, I walked through the somewhat different pay to contract case, which is I think mostly what you're referring to-- in that case you alwas make the contract key G*HMAC(message,pubkey) to avoid someone setting their pubkey to an alternative contract.
sr. member
Activity: 352
Merit: 250
https://www.realitykeys.com
September 06, 2014, 10:26:07 PM
#44
If you really just want something conditionally redeemable by one person or another, I would recommend the transaction type I recommend for reality keys:

Reality keys will reveal private key A if a true/false fact is true, and private key B if it's false.

Alice and Bob want to make a contract to hedge the outcome of a fact because they each have opposing short positions relative to the fact.  Alice will be paid if the fact is true, Bob will be paid if the fact is false.

Reality keys publishes the pubkey pairs  a := gA ; b := gB

Alice has private key X and corresponding pubkey x, Bob has private key Y and corresponding pubkey y.

Alice and Bob compute new pubkeys  q:=x+a  and r:=y+b  and they send their coins to a 1 of 2 multisig of those new pubkeys, q,r.

The values q,r are zero-knoweldge indistinguishable from a and b unless you know x and/or y, so no one except alice and bob, not even reality keys can tell which transaction on the network is mediated by the release of A vs B.

Later, realitykeys releases A or B,  lets say alice wins.  She computes a new private key X+A, and uses it to redeem the multisig.  Bob cannot redeem the multisig because he knows neither X or B.

This looks like a perfectly boring transaction to everyone else. Alice and Bob collectively cannot be robbed by a third party, though they could be held up or if realitykeys conspires with Alice or Bob then there could be cheating. This risk could be reduced by using a threshold of multiple observers— which this scheme naturally extends to.

Sorry for hijacking the thread over this but just one thing to add on this pattern to avoid people getting into trouble - hopefully gmaxwell will correct me if I've got this wrong.

Since these x + a and y + b operations are invertible, you need to be careful that Alice doesn't know x, and Bob doesn't know y, until they've shown each other their own keys, a and b respectively. If they know the Reality Keys pubkeys in advance, it seems to be possible to make a special tricksy a or b key such that, when combined to make q or r, the owner could get the combined private key Q or R without knowing the relevant Reality Key private key X or Y.

See Alan Reiner's comment here:
http://permalink.gmane.org/gmane.comp.bitcoin.devel/4173

In theory it looks like everything should be OK as long as you don't register the Reality Key until after you've seen the other party's public key, but if you're able to avoid this restriction it would be safer; Not only do you have to make sure you do everything in the right order, you also have to rely on us (Reality Keys) keeping our public keys secret until after you've made the exchange. The public keys are indeed supposed to be secret until they're allocated, but they're harder for us to secure than the private keys, since we need to be able to give them out to people on demand in real time. (Also there are some benefits to the same keys being shared for multiple people's contracts, rather than being assigned uniquely every time.)

I suspect you could defeat tricksy key attacks by Alice and Bob each producing an extra private key, sending it to their counter-party and requiring them to combine it with their Reality Key in a non-invertible operation, but I'm too far out of my depth to assess this. (It might also have some privacy benefits, so I'd be interested to hear what knowledgeable people think.) For now when I've been building demo applications on Reality Keys I've gone with the non-standard branching transaction approach, since sending these transactions to Eligius is practical at the moment and they should become standard in the next major Bitcoin release.
newbie
Activity: 12
Merit: 0
September 05, 2014, 06:43:20 PM
#43
I'd just like to emphasize that it is the core of my last post.  Can anyone answer that?

There is a plan that P2SH will effectively accept nearly all scripts.

https://github.com/gavinandresen/bitcoin-git/commit/7f3b4e95695d50a4970e6eb91faa956ab276f161
https://github.com/bitcoin/bitcoin/blob/master/src/main.cpp#L692

https://gist.github.com/gavinandresen/88be40c141bc67acb247

The limit is that your script must be less than 520 bytes and can't have more than 15 signature operations.

The update will presumably be in the next major release, since it is part of the main branch.

Does that mean yes or no?

What does it mean and imply that it's part of the main branch?

Is there ETA for the next major release?
legendary
Activity: 1232
Merit: 1094
September 05, 2014, 05:32:27 PM
#42
I'd just like to emphasize that it is the core of my last post.  Can anyone answer that?

There is a plan that P2SH will effectively accept nearly all scripts.

https://github.com/gavinandresen/bitcoin-git/commit/7f3b4e95695d50a4970e6eb91faa956ab276f161
https://github.com/bitcoin/bitcoin/blob/master/src/main.cpp#L692

https://gist.github.com/gavinandresen/88be40c141bc67acb247

The limit is that your script must be less than 520 bytes and can't have more than 15 signature operations.

The update will presumably be in the next major release, since it is part of the main branch.
newbie
Activity: 12
Merit: 0
September 05, 2014, 02:01:40 PM
#41
Code:
inputs: pubkey signature secret
OP_DUP OP_EQUAL
OP_IF OP_ELSE OP_EQUALVERIF OP_ENDIF
OP_ROT OP_CHECKSIGVERIFY OP_SWAP OP_HASH160 OP_EQUAL
That script is perfectly standard as a P2SH in current code.

Though I suspect you've confused the operation of the machine somewhat.


The script may be perfectly fine, but would bitcoin mainnet nodes broadcast transactions that contain that script?

I'd just like to emphasize that it is the core of my last post.  Can anyone answer that?
newbie
Activity: 12
Merit: 0
September 04, 2014, 09:43:55 PM
#40
Code:
inputs: pubkey signature secret
OP_DUP OP_EQUAL
OP_IF OP_ELSE OP_EQUALVERIF OP_ENDIF
OP_ROT OP_CHECKSIGVERIFY OP_SWAP OP_HASH160 OP_EQUAL
That script is perfectly standard as a P2SH in current code.

Though I suspect you've confused the operation of the machine somewhat.


The script may be perfectly fine, but would bitcoin mainnet nodes broadcast transactions that contains that script?


I need a definition of what a standard script is and what a non-standard script is; the bitcoind gives me:
Code:
"scriptPubKey" : {
"asm" : "OP_DUP aaaaaaaaaa OP_IF bbbbbbbbbb OP_ELSE cccccccccc OP_EQUALVERIFY dddddddddd OP_ENDIF OP_ROT OP_CHECKSIGVERIFY OP_SWAP OP_HASH160 OP_EQUAL",
"hex" : "7605aaaaaaaaaa6305bbbbbbbbbb6705cccccccccc8805dddddddddd687bad7ca987",
"type" : "nonstandard"
}

And I think I missed a few OP_DROPs
What operation do you suspect I am confusing?
The stack goes like this:
inputspubkey signature password
OP_DUPpubkey pubkey signature password
pubkeyA pubkey pubkey signature password
OP_EQUALisAlice pubkey signature password
OP_IFpubkey signature password
BobsHash pubkey signature password
OP_ELSE
pubkeyB pubkey signature password
OP_EQUALVERIFisBob pubkey signature password
OP_DROPpubkey signature password
AlicesHash pubkey signature password
OP_ENDIFHashY pubkeyX signature passwordY
OP_ROTpubkeyX signature HashY passwordY
OP_CHECKSIGVERIFYtrue HashY passwordY
OP_DROPHashY passwordY
OP_SWAPpasswordY HashY
OP_HASH160PasswordY_hash HashY
OP_EQUALSignature-Password match

I have seen OP_EVAL in some places, as well as other OPs that I don't find at https://en.bitcoin.it/wiki/Script.  What and where do I find documentation about those?

Quote
I am simultaneously to prove that I need OP_CAT and trying to find a way to do without it. I guess I can't have it both ways.
I'm not asking you to prove that OP_CAT is necessary,  I'm asking you to describe a specific, complete, protocol for which it is sufficient— something that starts with Alice and Bob and Charlie who want to accomplish a task, and a series of specific messages they send, and a series of guaranteed outcomes. Then I could try to help you reimagine a functionally equivalent protocol without it.

Starting from the fact that I don't have OP_CAT and that I don't count of having it, I focus on finding alternative ways rather than to develop protocols that requires something I don't have.  I'll give an example if (and when) I get there; what I have is still too incomplete and abstract.

Quote
As it is, this would allow either of two party to claim the output if they can provide the other's party secret, secret which hash to the hardcoded hashA or hashB, depending of who is signing.
It sounds like you're describing an atomic swap or a related transaction. Often they don't need two hashes.  If you really just want something conditionally redeemable by one person or another, I would recommend the transaction type I recommend for reality keys:

Yes, atomic transaction; for balance update or for winning-losing a dice bet.  A third party is unacceptable, which rules out the reality keys.
legendary
Activity: 2128
Merit: 1073
September 04, 2014, 05:33:50 PM
#39
Not so. We proved there were no semantic leaks from OpenSSL in the numbers on the stack via exhaustive testing some time ago and removed all use of OpenSSL from the script code (except the calls out for signature verification, of course— so only signature verification and the accompanying signature serialization are handled by it).
So this "semantic leak" is now only apparent in the block layout on the wire and on the disk? But the "abstract virtual machine" of Bitcoin script cannot discover its internal bit ordering? Do I understand you right?

Quote
1b) ostensibly allowing emulating iteration by mutual recursion of P2SH invocations
Also not so, very intentionally not.
Then can you state again what is the possible attack that the "opcode limit" is protecting against?

Thanks.
staff
Activity: 4284
Merit: 8808
September 04, 2014, 05:19:28 PM
#38
1a) implicit conversions between integers and bit strings with semantics depending on precise detail of OpenSSL implementation (word size, word order in a large integer, byte order in a word)
Not so. We proved there were no semantic leaks from OpenSSL in the numbers on the stack via exhaustive testing some time ago and removed all use of OpenSSL from the script code (except the calls out for signature verification, of course— so only signature verification and the accompanying signature serialization are handled by it).
Quote
1b) ostensibly allowing emulating iteration by mutual recursion of P2SH invocations
Also not so, very intentionally not.
full member
Activity: 179
Merit: 151
-
September 04, 2014, 05:15:25 PM
#37
But I believe we have already discussed the "non-TC" chestnut here and the consensus was that one can abuse P2SH to escape the "no-loops" restriction.

You can't use P2SH to create loops and nobody said anything about loops anyway.
legendary
Activity: 2128
Merit: 1073
September 04, 2014, 05:09:34 PM
#36
We are not talking about von Neumann architecture. We are talking about a small non-TC stack machine without mutability and a fixed opcode limit. In this case the set of allowable programs absolutely does shrink, and more importantly, the space of accepting inputs for (most) given scripts shrinks. This is easy to see --- consider the program OP_VERIFY. There would be one permissible top stack element in a typed script; in untyped script every legal stack element in (0x80|0x00)0x00* is permissible.

That said, nobody actually said that anything about the space of provable programs. What I said is that script would be easier to analyze. This is obviously true because of the tighter restrictions on stack elements, as I already illustrated. As another example, consider the sequence OP_CHECKSIG OP_CHECKSIG which always returns zero. One reason this is true today is that the output of OP_CHECKSIG always has length one while the top element of its accepting input always has length > one. To analyze script today you need to carry around these sorts of length restrictions; with typing you only need to carry around the data that CHECKSIG's output is boolean and its input is a bytestring.

I'm sorry I haven't kept with the advances in the theoretical computer science. But I believe we have already discussed the "non-TC" chestnut here and the consensus was that one can abuse P2SH to escape the "no-loops" restriction.

Let me try to dig the thread and I will edit this message later. Edit:

https://bitcointalksearch.org/topic/m.6533466

The operative words were "opcode limit" in the "Turing complete language vs non-Turing complete (Ethereum vs Bitcoin)" thread.

legendary
Activity: 2128
Merit: 1073
September 04, 2014, 05:04:26 PM
#35
I absolutely agree that additional type data makes for software which is easier to analyze. The question isn't the result of the program being provable, the question is of the implementations of the interpreter being simple enough to have even a small chance of having multiple absolutely identically behaving implementations, since we are performing this inside of a consensus system.

You continue to miss the point completely.
I apologize for writing too ambiguously the first time. I'm going to try to linearize my thoughts better now:

1) Given the current Bitcoin script language with the following problems (amongst others):

1a) implicit conversions between integers and bit strings with semantics depending on precise detail of OpenSSL implementation (word size, word order in a large integer, byte order in a word)
1b) ostensibly allowing emulating iteration by mutual recursion of P2SH invocations

2) a non-binary compatible but only morally-compatible scripting language featuring:

2a) explicit type conversion operators and type tagging of the stack storage, in particular clean conversions between integers and bit strings
2b) somehow type-safe or type-checking implementation of P2SH invocation that verifies both arguments and return values

3) will allow writing a completely new scripting interpreter

3a) in a theoretically strong programming language like a Lisp subset that is provable (Lisp because I'm most familiar with it, but there are many other candidates, I did not keep up with recent developments in the theoretical computer science)
3b) that can be mechanically/automatically verified and proven to obey certain theorems and conditions

4) said interpreter then can be translated

4a) to C/C++/Java/etc. via completely mechanical translation or manual pattern-based transliteration of a very restricted subset Lisp to be incorporated in a software-only implementation
4b) to SystemC/Verilog/VHDL/etc. to be synthesized into a logic circuit (with stack memory) for the hardware-assisted implementations and for additional verification

The 4a) output in a restricted C++ subset could then replace the current, completely improvised, implementation in Bitcoin core. Because of subset C++ use it most likely would be longer in terms of lines of code, but it would be also much simpler to analyze.

The 3b) step has an additional problem that all the existing Lisp provers use only conventional ring of integers arithmetic. Since Bitcoin depends on an elliptic curve over a finite field the proving software would have to be extended to efficiently handle that. From my school days algebra I remember that the stratification group->ring->field significantly influences the complexity of proofs. Sliding back from "ring of integers" to "abelian group of elliptic curves" could potentially greatly reduce the set of theorems that could be mechanically proven.

I realize that the points 1-4 still read like a complex sentence in a patent application. I'm not good at writing easy to read essays. But from the purely technical point of view the two-level process is the way to maximize correctness (1st language for proving/verification, 2nd language for implementation/integration).
 
full member
Activity: 179
Merit: 151
-
September 04, 2014, 07:58:38 AM
#34
This claim about "typed data" and "provability" is false. There are actual proofs of that coming from the people involved in designing/implementing Algol 68. I don't have any references handy, but in broad terms the progression "classic Von Neumann" -> "type-tagged Von Neumann" -> "static-typed Von Neumann/Harvard modification" strictly increases the set of programs that have provable results.

We are not talking about von Neumann architecture. We are talking about a small non-TC stack machine without mutability and a fixed opcode limit. In this case the set of allowable programs absolutely does shrink, and more importantly, the space of accepting inputs for (most) given scripts shrinks. This is easy to see --- consider the program OP_VERIFY. There would be one permissible top stack element in a typed script; in untyped script every legal stack element in (0x80|0x00)0x00* is permissible.

That said, nobody actually said that anything about the space of provable programs. What I said is that script would be easier to analyze. This is obviously true because of the tighter restrictions on stack elements, as I already illustrated. As another example, consider the sequence OP_CHECKSIG OP_CHECKSIG which always returns zero. One reason this is true today is that the output of OP_CHECKSIG always has length one while the top element of its accepting input always has length > one. To analyze script today you need to carry around these sorts of length restrictions; with typing you only need to carry around the data that CHECKSIG's output is boolean and its input is a bytestring.
staff
Activity: 4284
Merit: 8808
September 04, 2014, 01:39:55 AM
#33
Code:
inputs: pubkey signature secret
OP_DUP OP_EQUAL
OP_IF OP_ELSE OP_EQUALVERIF OP_ENDIF
OP_ROT OP_CHECKSIGVERIFY OP_SWAP OP_HASH160 OP_EQUAL
That script is perfectly standard as a P2SH in current code.

Though I suspect you've confused the operation of the machine somewhat.

Quote
I am simultaneously to prove that I need OP_CAT and trying to find a way to do without it. I guess I can't have it both ways.
I'm not asking you to prove that OP_CAT is necessary,  I'm asking you to describe a specific, complete, protocol for which it is sufficient— something that starts with Alice and Bob and Charlie who want to accomplish a task, and a series of specific messages they send, and a series of guaranteed outcomes. Then I could try to help you reimagine a functionally equivalent protocol without it.

Quote
As it is, this would allow either of two party to claim the output if they can provide the other's party secret, secret which hash to the hardcoded hashA or hashB, depending of who is signing.
It sounds like you're describing an atomic swap or a related transaction. Often they don't need two hashes.  If you really just want something conditionally redeemable by one person or another, I would recommend the transaction type I recommend for reality keys:

Reality keys will reveal private key A if a true/false fact is true, and private key B if it's false.

Alice and Bob want to make a contract to hedge the outcome of a fact because they each have opposing short positions relative to the fact.  Alice will be paid if the fact is true, Bob will be paid if the fact is false.

Reality keys publishes the pubkey pairs  a := gA ; b := gB

Alice has private key X and corresponding pubkey x, Bob has private key Y and corresponding pubkey y.

Alice and Bob compute new pubkeys  q:=x+a  and r:=y+b  and they send their coins to a 1 of 2 multisig of those new pubkeys, q,r.

The values q,r are zero-knoweldge indistinguishable from a and b unless you know x and/or y, so no one except alice and bob, not even reality keys can tell which transaction on the network is mediated by the release of A vs B.

Later, realitykeys releases A or B,  lets say alice wins.  She computes a new private key X+A, and uses it to redeem the multisig.  Bob cannot redeem the multisig because he knows neither X or B.

This looks like a perfectly boring transaction to everyone else. Alice and Bob collectively cannot be robbed by a third party, though they could be held up or if realitykeys conspires with Alice or Bob then there could be cheating. This risk could be reduced by using a threshold of multiple observers— which this scheme naturally extends to.
staff
Activity: 4284
Merit: 8808
September 04, 2014, 01:22:40 AM
#32
I absolutely agree that additional type data makes for software which is easier to analyze. The question isn't the result of the program being provable, the question is of the implementations of the interpreter being simple enough to have even a small chance of having multiple absolutely identically behaving implementations, since we are performing this inside of a consensus system.

You continue to miss the point completely.
legendary
Activity: 2128
Merit: 1073
September 04, 2014, 12:35:23 AM
#31
Typed data on the stack makes writing correct code much harder, I can't say that I've ever wished for that. I general prefer the stack be "bytes" and everything "converts" them to the right type. Yes, additional constraints would make things like your provably undependable code easier, but they do so by adding more corner cases that an implementation must get right.

I'm also a fan of analyizability, but that always has to be second seat to consensus safeness. Smiley
This claim about "typed data" and "provability" is false. There are actual proofs of that coming from the people involved in designing/implementing Algol 68. I don't have any references handy, but in broad terms the progression "classic Von Neumann" -> "type-tagged Von Neumann" -> "static-typed Von Neumann/Harvard modification" strictly increases the set of programs that have provable results. I also remember than in the USA IBM did pay for some academic research about "PL/I without implicit type coercion" that had similar results.

As an aside to the theoretical results: in school I had side income helping debug/fix/extend several RPN-style / Forth-style language interpreters including then-popular commercial implementations by Tektronix & HP in their IEEE-488 lab-control equipment. For that application type-tagging was (and is) a godsend both for human programming and for automated program analysis/translation.
newbie
Activity: 12
Merit: 0
September 04, 2014, 12:08:42 AM
#30
Assuming OP_CAT is still available,

Right there, I started feeling skeptical about your post.


How is that useful?  The problem is not about being able to do nice scripts and use them properly, but about avoiding the possibility of making any script that could potentially... get naughty.


Call it OP_LIMITCAT, and disallow the use of a bare OP_CAT.

How is that better than implementing OP_CAT correctly in the first place?  Wouldn't that "alias" require the nasty bare OP_CAT to be "present"?  It sounds like you are saying "Instead of doing the checks in the OP_CAT itself, let's make an improper OP_CAT that we cannot use directly, and make an alias that does the checks before calling the improper OP_CAT that doesn't do these checks"

Am I totally misunderstanding you?
newbie
Activity: 12
Merit: 0
September 03, 2014, 11:24:09 PM
#29
gmaxwell, you remind that part of me that says "not so fast..." to "of course..." statements.  You are thoughtful; thanks for your help and insight!


I'm not seeing how OP_CAT (at least by itself) facilitates any of the high level examples there. Can you give me a specific protocol and set of scripts to show me how it would work?

I am simultaneously to prove that I need OP_CAT and trying to find a way to do without it. I guess I can't have it both ways.

In very very short, it involved verifying that hash(salt+data) indeed equals [suchhash]. Providing salt and data, the script can confirm hash(salt), hash(data) and hash(salt+data) and validates the transaction based of whether the hashes match what was claimed. However, I think I found a way around that, which will involve more never-broadcasted transaction and more multsig addresses. etc.  i.e. the process is more complex and exhaustive, but I think the OPs available allows an alternative implementation.

As I fell like I'm finding my way toward "a solution without OP_CAT", the next biggest wall seems to be: Even if I can make scripts that do exactly what I want, will the network accept and broadcast them?

I am about to start experimenting on testnet, but even if it works on testnet, that doesn't tell me if it is going to work on the mainnet.

The OP_CAT would indeed simplify the process of what I am thinking of, but it seems that the main scenarios would be resolved, i.e. I wouldn't "need" OP_CAT, even though it would have made it easier.

One of the protocol is about two parties escrowing money for future instant payments, i.e. off-net renegotiation of the balances.  An extended version could allow decentralised banking for Bitcoin.  (isn't that what Bitcoin IS?)  Yes, but I am talking about instant proof/guarantee of receiving a minimum of n confirmations, after escrow/deposits are placed.

It seems that it would only require one non-standard script, which would look like this:
Code:
inputs: pubkey signature secret
OP_DUP OP_EQUAL
OP_IF OP_ELSE OP_EQUALVERIF OP_ENDIF
OP_ROT OP_CHECKSIGVERIFY OP_SWAP OP_HASH160 OP_EQUAL

As it is, this would allow either of two party to claim the output if they can provide the other's party secret, secret which hash to the hardcoded hashA or hashB, depending of who is signing.
(How is that useful is part of a bigger picture that I will talk about later in another thread.)
This script is untested and incomplete; I also needs to allow both signatures to validate the transaction.

So the question is now: should I bother testing that on testnet or is it doomed because the network wouldn't like it, e.g. too many nodes not broadcasting unknown, strange and/or non-standard transactions?
legendary
Activity: 1792
Merit: 1111
September 03, 2014, 11:08:37 PM
#28
I'm not a programmer so this may sound very stupid:
[...]
Max OP_CAT output size = 520 bytes: why risky?
I mean, is there any fundamental difference between these cases?
All the limits are risks, all complexity— practically every one of them has been implemented incorrectly by one alternative full node implementation or another (or Bitcoin core itself) at some point. They miss them completely, or count wrong for them, or respond incorrectly when they're violated.  E.g. here what happens if you OP_CAT 520 and 10 bytes? Should the verify fail? Should the result be truncated? But even that wasn't the point here.

Point here was that realizing you _needed_ a limit and where you needed it was a risk.  The reasonable and pedantically correct claim was made that OP_CAT didn't increase memory usage, that it just took two elements and replaced them with one which was just as large as the two... and yet having (unfiltered) OP_CAT in the instruction set bypasses the existing limits and allowed exponential memory usage.

None of it insurmountable, but I was answering the question as to why it's not just something super trivial.

Assuming OP_CAT is still available, we can do everything with existing OP codes:

Code:


If the size of A, size of B, and the sum of size of A and B are all less than or equal to 520, it will return

Otherwise, the script fails.

So we can create an alias for this part:

Code:
SIZE ROT SIZE ROT 2DUP <520> LESSTHANOREQUAL VERIFY <520> LESSTHANOREQUAL VERIFY ADD <520> LESSTHANOREQUAL VERIFY SWAP CAT

Call it OP_LIMITCAT, and disallow the use of a bare OP_CAT.

Unless bugs are already there in the existing OP codes, or in my script, that should be fine.

staff
Activity: 4284
Merit: 8808
September 03, 2014, 08:28:13 PM
#27
Well guys, I broke theoretical bitcoin. My lack of relevant knowledge has theoretically doomed us all.
In all seriousness (not that breaking theoretical bitcoin isn't) the whole take-down-the-network-in-one-transaction is scary as shit. I'd love to be able to use string functions, but I'd rather not advocate risking the network for some silly scriptsigs Tongue
I send you my theoretical condolences. Smiley

No worries, everyone breaks theoretical Bitcoin.
Pages:
Jump to:
© 2020, Bitcointalksearch.org