Pages:
Author

Topic: Refereed Transactions (Read 5195 times)

legendary
Activity: 1526
Merit: 1134
May 03, 2011, 04:45:37 AM
#26
I don't know. It sounds OK if there is also a maturation time. I'll ask Satoshi next time I send him a bunch of questions.
sr. member
Activity: 416
Merit: 277
May 02, 2011, 08:22:46 PM
#25
If a script can access outside state then look at Theymos' example. You can make a script that is valid, included into the chain and then suddenly becomes invalid.

As Theymos indicates above, OP_BLOCKNUMBER pushes on the stack the block number which the transaction occupies (or is likely to occupy) in the block chain.

Miners know what the block number is going to be when they are trying to mine blocks and hence they check that the OP_BLOCKNUMBER transaction is valid for that block.

Given a block chain containing OP_BLOCKNUMBER transactions, if the OP_BLOCKNUMBER transaction was ever valid then it will remain valid as (apart from reorgs) transactions don't change block numbers.

Please post whether you think a problem remains with OP_BLOCKNUMBER now that this point has been clarified.

ByteCoin
administrator
Activity: 5222
Merit: 13032
May 02, 2011, 10:09:39 AM
#24
It's safe if the scripts can't import anything which changes (like the time or the current block number). For instance nothing stops somebody from signing the current block index, and then having that index and the signature put into a script as constants.

If OP_BLOCKNUMBER expanded into "the block this transaction is in" rather than "the current block" (when the transaction is in a block), and these transactions had a maturation time, wouldn't that be OK? The block number of the transaction can't be changed without a reorg, and we assume reorgs won't be longer than ~100 blocks.
legendary
Activity: 1526
Merit: 1134
May 02, 2011, 04:25:13 AM
#23
Quote
I presume that the forking mechanism relies on the clients disagreeing among themselves about the state and the transaction being structured so that this disagreement changes who gets the coins. If everyone is forever in agreement about what the outside state was when the transaction was included in the block chain then I don't see the problem. Please explain if a problem remains.

It's safe if the scripts can't import anything which changes (like the time or the current block number). For instance nothing stops somebody from signing the current block index, and then having that index and the signature put into a script as constants.

If a script can access outside state then look at Theymos' example. You can make a script that is valid, included into the chain and then suddenly becomes invalid. Everyone would begin building a new chain starting at that point - but as the attacker you knew that would happen, so you already made a longer chain yourself. You can now reverse transactions at will, defeating the point of BitCoins security.

sr. member
Activity: 416
Merit: 277
May 01, 2011, 06:16:53 PM
#22
Clients currently need to verify all transactions before they are relayed.

Because clients don't know what block a OP_BLOCKNUMBER transaction will get into, they can't easily verify the transaction.

Workaround: Verify the transaction with the current blocknumber. When a new block arrives, kick the verified transaction back into the just received queue. Forbid OP_BLOCKNUMBER transactions from being spent with zero confirmations. To speed up reverification, the results of checking signatures could be cached.

Obviously miners know what the block number is when they try to incorporate the transaction into a block.

Any script opcodes that import state from outside can be used to fork the block chain.

It's not obvious to me that this is true. I presume that the forking mechanism relies on the clients disagreeing among themselves about the state and the transaction being structured so that this disagreement changes who gets the coins. If everyone is forever in agreement about what the outside state was when the transaction was included in the block chain then I don't see the problem. Please explain if a problem remains.

Also scripting isn't really disabled. You just have to get your new script into the whitelist and then convince some miners to upgrade. All clients will understand that new script type afterwards.

The point of scripting is to allow primitive operations to be combined in various ways to produce a predictable overall behaviour which possibly has never been seen before. Alternatively, transaction types could be hard coded to conform to specific behaviour which is well known and understood. The current behaviour is much more like the latter than the former so I think it's true to say that scripting is disabled.

ByteCoin
gim
member
Activity: 90
Merit: 10
May 01, 2011, 04:56:17 PM
#21
The block in which the script is meant to be included into can't be known by people verifying the transaction.

You mean miners? They know the number of the block they (try to) generate or the number of the block they verify, as far as I know?
administrator
Activity: 5222
Merit: 13032
May 01, 2011, 04:35:16 PM
#20
The block in which the script is meant to be included into can't be known by people verifying the transaction.
gim
member
Activity: 90
Merit: 10
May 01, 2011, 04:22:17 PM
#19
Dunno about OP_BLOCKNUMBER, but if this instruction returns the number of the block in which the script (or even the scriptSig) is meant to be included into, i can't see the problem... except for chain reorganisation.
Of course, it should not return the current block number as in "today's last blocknumber" in the case it is verified later.

I'd like to know if I'm missing something.
administrator
Activity: 5222
Merit: 13032
May 01, 2011, 03:04:51 PM
#18
Any script opcodes that import state from outside can be used to fork the block chain. It's not sufficient to have OP_BLOCKNUMBER only be spendable after N blocks as somebody can write a script that is valid up until a certain time and then becomes invalid, allowing arbitrary forking of the chain even in the absence of naturally occurring re-orgs.

You're right -- it is impossible to do safely. The attacker could do something like:
Code:
OP_BLOCKNUMBER [120000] OP_LESSTHAN
gim
member
Activity: 90
Merit: 10
May 01, 2011, 10:36:32 AM
#17
He is supposed to do that before the deadline, and bitcoins are frozen until then. What fork could that induce?

I mean.. the only real issue i see is the timestamping vs chain reorg problem.
gim
member
Activity: 90
Merit: 10
May 01, 2011, 10:25:56 AM
#16
Any script opcodes that import state from outside can be used to fork the block chain.

I'm not really sure your argument is valid or possibly I don't understand.
Bob would put the data in the chain when he provide the scriptSig (he forged using the certificated) to redeem his due.
He is supposed to do that before the deadline, and bitcoins are frozen until then. What fork could that induce?
legendary
Activity: 1526
Merit: 1134
May 01, 2011, 09:35:41 AM
#15
Any script opcodes that import state from outside can be used to fork the block chain. It's not sufficient to have OP_BLOCKNUMBER only be spendable after N blocks as somebody can write a script that is valid up until a certain time and then becomes invalid, allowing arbitrary forking of the chain even in the absence of naturally occurring re-orgs.

Transactions that "mature" after a certain time are possible with nLockTime, although without replacement it's not that useful. Also scripting isn't really disabled. You just have to get your new script into the whitelist and then convince some miners to upgrade. All clients will understand that new script type afterwards.
gim
member
Activity: 90
Merit: 10
May 01, 2011, 08:35:02 AM
#14
You can do it really simply with a script like this:
Code:
[2] [3] OP_CHECKMULTISIG
The escrow and one party, or both parties, must cooperate to send the coin. The escrow needs to enforce the deadline, though. I don't think there's any way to have a secure deadline within transactions.

Interesting! Strange that this ownership is symmetric in sender/recipient/escrow.

I was thinking that the referee should be left apart from the actual bitcoin transaction and would only sign a " gave his account prior to " certificate. But maybe it's a good way to deal with the deadline problem? (Referee would be trusted to handle the deadline correctly.)
administrator
Activity: 5222
Merit: 13032
April 30, 2011, 08:35:38 PM
#13
I wouldn't oppose OP_BLOCKNUMBER if transactions using it matured like that.
sr. member
Activity: 416
Merit: 277
April 30, 2011, 08:27:28 PM
#12
Do you mean push the current block count onto the stack? That would be handy.
What are the problems with doing that? I don't see that its been discussed.

In the event of a block chain reorganization, in the absence of a double spending attack, all the transactions on the shorter branch can expect to be incorporated into the longer chain. The only "money" that's lost is the rewards for finding blocks on the shorter branch - the coinbase transactions. There's a reason why coinbase takes such a long time to mature, it's because it's subject to being disappeared in the event of a reorg. We assume that reorgs can't take place at a depth of 120 blocks so coinbase matures after that time.
The problem comes with OP_BLOCKNUMBER transactions which are involved in a reorg where they get incorporated into a block which changes the functionality of the script because of the different block number. Any transactions spending coins depending on OP_BLOCKNUMBER transactions may also get invalidated and that's bad. So to be safe there would have to be some scheme that provides as much assurance as is provided with coinbase maturing for 120 blocks. I guess that coinbase matures at a rate of 5BTC every 12 blocks so perhaps OP_BLOCKNUMBER transactions shouldn't mature until max(120,ceil(value_in_bitcoins/5*12)) blocks have passed to provide similar assurances.

It's not a great solution as OP_BLOCKNUMBER transactions are treated differently to any others.

ByteCoin  
full member
Activity: 125
Merit: 100
April 30, 2011, 08:02:08 PM
#11
Do you mean push the current block count onto the stack? That would be handy.
What are the problems with doing that? I don't see that its been discussed.
sr. member
Activity: 416
Merit: 277
April 30, 2011, 07:43:11 PM
#10
I don't think there's any way to have a secure deadline within transactions.
This is the bit where I tout the usefulness of OP_BLOCKNUMBER in spite of the modest complications a safe implementation would entail.  Wink most recently discussed here https://bitcointalksearch.org/topic/optimestamp-in-script-6439

Much as I think that the scripting is the best bit of Satoshi's work, I'm doubtful it will ever be revived.
The fact that a bitcoin is increasingly valuable with scripting disabled means that scripting is not essential. Enabling scripting, although I'm a big fan, would break the rule that a successful product should do one thing well.

ByteCoin
administrator
Activity: 5222
Merit: 13032
April 30, 2011, 07:24:32 PM
#9
You can do it really simply with a script like this:
Code:
[2] [3] OP_CHECKMULTISIG
The escrow and one party, or both parties, must cooperate to send the coin. The escrow needs to enforce the deadline, though. I don't think there's any way to have a secure deadline within transactions.
gim
member
Activity: 90
Merit: 10
April 30, 2011, 06:30:50 PM
#8
It's possible, though I think you need some out-of-band system to get the escrow agent to sign your transaction.

Do you have a script example? How do you deal with the deadline?
Which OP_s have to be activated in the client?

Sorry, lots of questions Smiley
gim
member
Activity: 90
Merit: 10
April 30, 2011, 06:28:24 PM
#7
He said he was working on it for two-party escrows, but now that he's gone it might be something for the current developers to consider prioritizing.

Right, it would be great if all those features could be added quickly. As satoshi said, when new implementations of the bitcoin client will be around, things will quickly be set in stone. If things are not moving right now, I fear that the script system will never be used, and will remain an embryo.
That's why I'd like to see some movement.

Look at smtp, it has so much defaults and it seems nothing can be done... nobody has switched to [better]mail.
If bitcoin ever begin to go mainline (is it?), who will dare to switch to [better]coin ? Won't it be too late?
Pages:
Jump to: