Bitcoin Forum
June 03, 2024, 02:51:00 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Valid transaction  (Read 875 times)
jackjack (OP)
Legendary
*
Offline Offline

Activity: 1176
Merit: 1255


May Bitcoin be touched by his Noodly Appendage


View Profile
May 27, 2013, 12:23:09 PM
 #1

The wiki says that "a transaction is valid if nothing in the combined script triggers failure and the top stack item is true (non-zero)"
But "x==OP_TRUE" != "x!=OP_0"
So which one is correct?

Own address: 19QkqAza7BHFTuoz9N8UQkryP4E9jHo4N3 - Pywallet support: 1AQDfx22pKGgXnUZFL1e4UKos3QqvRzNh5 - Bitcointalk++ script support: 1Pxeccscj1ygseTdSV1qUqQCanp2B2NMM2
Pywallet: instructions. Encrypted wallet support, export/import keys/addresses, backup wallets, export/import CSV data from/into wallet, merge wallets, delete/import addresses and transactions, recover altcoins sent to bitcoin addresses, sign/verify messages and files with Bitcoin addresses, recover deleted wallets, etc.
crary
Newbie
*
Offline Offline

Activity: 15
Merit: 0


View Profile
May 27, 2013, 03:23:38 PM
 #2

Actually, neither one is correct (even if you blur the distinction between a constant and the opcode that pushes it).  There are lots of representations of true, and -- since the script manipulates byte strings, not integers -- there are lots of representations of false as well.

Also, the way I read the code, OP_0 doesn't actually work, but I could be confused.  I'd like it if someone better familiar with the code than I could weigh in on that.
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!