Bitcoin Forum
November 21, 2017, 02:17:26 PM *
News: Latest stable version of Bitcoin Core: 0.15.1  [Torrent].
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Valid transaction  (Read 757 times)
jackjack
Legendary
*
Offline Offline

Activity: 1120


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.
Join ICO Now A blockchain platform for effective freelancing
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
crary
Newbie
*
Offline Offline

Activity: 15


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:  

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!