Bitcoin Forum
May 14, 2024, 06:06:15 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Script System  (Read 604 times)
Shirik (OP)
Newbie
*
Offline Offline

Activity: 32
Merit: 0


View Profile
July 04, 2012, 03:32:15 PM
 #1

I'm a software engineer by profession, so when I started looking at bitcoin, the transaction system immediately grabbed my attention. I think I understand it, but the wiki isn't entirely clear, so I was hoping someone could double-check my understanding.

I checked out https://en.bitcoin.it/wiki/Transactions and https://en.bitcoin.it/wiki/Script and get that each input has half of a script, and each output has half of a script. What has been hanging me up is how the two are combined, but I think I finally figured it out. I think that those two halves don't get paired together. Instead, the input script is paired with the previous transaction's output script, so the input script is basically proving that you're allowed to spend the coins from that transaction. Is that correct?

So if I wanted to, I could create an output that could be used by two different addresses by creating a script that basically said "if sig matches this or this, true" right? (Or I could just say it could be spent by anyone by saying "true" always.)

That being said, do most miners actually accept transactions like this? Or do they just reject any transaction that does not follow the typical pattern? (I read about the mtgox loss, but it seemed like a lot of miners were rejecting that transaction.)
theymos
Administrator
Legendary
*
Offline Offline

Activity: 5194
Merit: 12985


View Profile
July 04, 2012, 06:16:47 PM
 #2

Right. An output's script provides an algorithm for determining whether that output can be spent, and any input trying to spend the output provides the arguments for that algorithm.

Quote
That being said, do most miners actually accept transactions like this? Or do they just reject any transaction that does not follow the typical pattern? (I read about the mtgox loss, but it seemed like a lot of miners were rejecting that transaction.)

Everyone accepts non-standard transactions if they appear in a block. The default client doesn't mine or relay non-standard transactions. A few big miners like Eligius do accept them, though.

1NXYoJ5xU91Jp83XfVMHwwTUyZFK64BoAD
Shirik (OP)
Newbie
*
Offline Offline

Activity: 32
Merit: 0


View Profile
July 04, 2012, 07:37:19 PM
 #3

Yeah, what I meant to say is miners refusing to include those transactions in their generated blocks. Naturally you have to accept non-standard transactions in blocks (assuming they're valid) or you wouldn't be able to build on the block chain.

Thanks,
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!