Bitcoin Forum
December 10, 2016, 09:00:21 AM *
News: To be able to use the next phase of the beta forum software, please ensure that your email address is correct/functional.
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Guide to non-standard transactions needed  (Read 3759 times)
Ian Maxwell
Full Member
***
Offline Offline

Activity: 140



View Profile WWW
May 19, 2011, 01:12:34 PM
 #1

I'll pay 1 BTC to the first person who either writes a thorough explanation of non-standard transactions for the intelligent novice, or links to one that already exists. I have a vague idea of what they are from context, but I haven't found any solid sources to confirm or expand on what I think I know, which is too bad because it sounds like they could play a huge role in Bitcoin's future value.

I'm looking for a guide that a computer-savvy reader could pick up having never heard the term "non-standard transaction" before, and have a good understanding once he put it down. At the least, it should answer these questions:
  • Just what is non-standard about non-standard transactions?
  • What's the difference between non-standard and invalid?
  • Can arbitrary data be stuffed into a transaction? If not, what are the limitations?
  • Need these be "transactions" at all in the sense of involving transfers between bitcoin addresses?
  • How do I go about creating a non-standard transaction?
  • What are some (actual or potential) use cases?

It's okay if the guide assumes some underatanding of what a standard transaction is and how the block chain works, though at least a link might be nice for that. Ideally there should be concrete examples to look at.

Ian Maxwell
PGP key | WoT rating
1481360421
Hero Member
*
Offline Offline

Posts: 1481360421

View Profile Personal Message (Offline)

Ignore
1481360421
Reply with quote  #2

1481360421
Report to moderator
1481360421
Hero Member
*
Offline Offline

Posts: 1481360421

View Profile Personal Message (Offline)

Ignore
1481360421
Reply with quote  #2

1481360421
Report to moderator
1481360421
Hero Member
*
Offline Offline

Posts: 1481360421

View Profile Personal Message (Offline)

Ignore
1481360421
Reply with quote  #2

1481360421
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1481360421
Hero Member
*
Offline Offline

Posts: 1481360421

View Profile Personal Message (Offline)

Ignore
1481360421
Reply with quote  #2

1481360421
Report to moderator
1481360421
Hero Member
*
Offline Offline

Posts: 1481360421

View Profile Personal Message (Offline)

Ignore
1481360421
Reply with quote  #2

1481360421
Report to moderator
arturh
Member
**
Offline Offline

Activity: 60



View Profile
May 19, 2011, 01:25:36 PM
 #2

Just what is non-standard about non-standard transactions?
They're not produced by the official BitCoin client.
There are three standard transactions:
 coinbase, ip transactions (to a public key), and transaction to hash of public key

What's the difference between non-standard and invalid?
Invalid transactions are not accepted into a block, nonstandard are.

Can arbitrary data be stuffed into a transaction? If not, what are the limitations?

you can put whateve in the coinbase field of coinbase transactions. You can put whatever script in scriptSig, but you may not be able to reclaim its value.

Need these be "transactions" at all in the sense of involving transfers between bitcoin addresses?
No, you can create a transaction that can be claimed by whoever first reclaims it. Or a transaction that cannot be redeemed.


How do I go about creating a non-standard transaction?
Create one and send it to your client (via JSON-RPC).

What are some (actual or potential) use cases?
Multiple pubkeys needed to redeem value, that I can think of.


My address: 14ZP1aPwxATwzt9BeQCXxVY2FU8G4RQ6Zj
theymos
Administrator
Legendary
*
expert
Offline Offline

Activity: 2506


View Profile
May 19, 2011, 03:13:14 PM
 #3

What's the difference between non-standard and invalid?

Invalid transactions double-spend coins, try to redeem an output in such a way that the script returns false, or are formatted incorrectly. Invalid transactions are always rejected. One invalid transaction in a block chain makes all blocks after and including it invalid.

Non-standard transactions do something that the official client would never do. Usually they have scripts that are different from the two scripts that Bitcoin produces. Non-standard transactions will be accepted if they are seen in a block, though miners using the official code will not put them in blocks they mine or relay them to other miners.

Luke-jr's pool accepts all non-standard transactions if they pay a fee, so non-standard transactions are possible.

Quote
Can arbitrary data be stuffed into a transaction? If not, what are the limitations?

Yes. The transaction can (optionally) still be redeemable after doing this, too. Each script can be 10,000 bytes max, but each transaction can have an unlimited number of scripts. The max size of a block is 1MB, though, so a transaction larger than that cannot possibly be included in a block.

Quote
Need these be "transactions" at all in the sense of involving transfers between bitcoin addresses?

No. An output script sets the conditions under which the BTC contained in that output can be redeemed. A transfer to a Bitcoin address creates a script saying, "If you can sign data for this public key hash (address), you can redeem this output." But there are many different conditions you could set.

Quote
How do I go about creating a non-standard transaction?

You must modify Bitcoin. Stock Bitcoin will never create non-standard transactions.

Quote
What are some (actual or potential) use cases?

You could make a transaction redeemable for a password instead of a public key, or require multiple signatures (useful for escrow transactions).

See:
https://en.bitcoin.it/wiki/Script

1NXYoJ5xU91Jp83XfVMHwwTUyZFK64BoAD
Mike Hearn
Legendary
*
expert
Offline Offline

Activity: 1526


View Profile
May 19, 2011, 04:02:19 PM
 #4

I posted a description of how to use non-standard transactions to form contracts yesterday. Here it is:

   http://forum.bitcoin.org/index.php?topic=8821.0

It has some examples of how to use these sorts of transactions to achieve a couple of different use cases. I don't know if that's what you were looking for, as it's intended for a technical audience who understands Bitcoin, but if it's what you had in mind you can send a coin to 13DeWV8PLQQ3pSNwh8gG259KfZuqLAaZQW
Luke-Jr
Legendary
*
expert
Offline Offline

Activity: 2100



View Profile
May 19, 2011, 04:35:15 PM
 #5

Just what is non-standard about non-standard transactions?
bitcoind and the wx client will boycott them, and refuse to include them in blocks or even relay them.
What's the difference between non-standard and invalid?
Invalid breaks the network rules in some way. "Non-standard" are just not liked by the developer team of the client with the biggest marketshare.
Can arbitrary data be stuffed into a transaction? If not, what are the limitations?
Yes, both standard and non-standard. But don't do that, please.
Need these be "transactions" at all in the sense of involving transfers between bitcoin addresses?
They have to be transactions, but don't have to involve addresses.
How do I go about creating a non-standard transaction?
Hack away at one of the clients (even an extremely light partial-client is probably enough). Make sure you include enough of a fee to get it into a block.
What are some (actual or potential) use cases?
  • Require KeyA and KeyB (eg, escrow agent) to spend the coin
  • Require KeyA or KeyB (eg, State garnishment super-key mandated by law on citizens) to spend the coin
  • Allow anyone to spend the coin without any key
  • Require a password in addition to a key

Ian Maxwell
Full Member
***
Offline Offline

Activity: 140



View Profile WWW
May 19, 2011, 07:42:54 PM
 #6

Hmm... some of these replies are very helpful, and now I don't know what to pick. The closest thing to a "guide" is the thread Mike linked to, which is pretty cool---I didn't realize how flexible the Bitcoin protocol was! I thought a non-standard transaction was just a "transaction" with possibly no bitcoins or addresses involved, and with some other data in it that wasn't part of the standard transaction format (a bit like XML, where readers are supposed to just ignore tags they don't understand). It seems they're far more interesting than that.

I was really looking for a general guide, not just an answer to these specific questions. So unless someone does a write-up and posts it online somewhere before I get home in... oh, an hour or so, I'll be sending Mike a bitcoin. Thanks! I'll probably ask more questions in that thread.

Ian Maxwell
PGP key | WoT rating
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!