User talk:Smtp: Difference between revisions

From Bitcoin Wiki
Jump to navigation Jump to search
Smtp (talk | contribs)
Smtp (talk | contribs)
 
(103 intermediate revisions by the same user not shown)
Line 1: Line 1:
== opcodes ==
<strong>Dear User, Please write new Topics only at the end of this page! Thank you.</strong>
= [[script]] =


=== opcode overview ===
==[[Script#opcode_overview|opcode overview]]==


For each opcode is given its nemonic, its hexadecimal bytevalue, the number of stack items poped (needed) during execution, the number of stack items pushed (after execution). Different colors indicate different semantic execution groups.
For each opcode is given: its nemonic without the leading OP_, its hexadecimal byte value, the number of stack items needed (poped) during execution, the number of stack items pushed (after execution). A * after the needed stack items indicates that further bytes from the script following the current opcode are needed. A # indicates that items on the alternative stack are poped/pushed. A @ indicates that further (global) data from transcations is needed.<br/>
Different colors indicate different semantic execution groups of opcodes.


{| style="background:none; font-size:100%; padding:0; border-collapse:collapse; text-align:center; line-height:2em;" border="0" align="center"  
{| style="background:none; font-size:100%; padding:0; border-collapse:collapse; text-align:center; line-height:2em;" border="0" align="center"  
|-
|-
| style="border:1px solid #aaaaaa; background-color:gold;" |OP_FALSE<br/> 0x00 <br/> 0 ; 1(0)
| style="border:1px solid #aaaaaa; background-color:gold;" |_FALSE<br/> 0x00 <br/> 0 ; 1(0)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x01<br/> 0 ; 1(1)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x01<br/> 0 *; 1(1)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x02<br/> 0 ; 1(2)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x02<br/> 0 *; 1(2)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x03<br/> 0 ; 1(3)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x03<br/> 0 *; 1(3)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x04<br/> 0 ; 1(4)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x04<br/> 0 *; 1(4)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x04<br/> 0 ; 1(5)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x04<br/> 0 *; 1(5)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x06<br/> 0 ; 1(6)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x06<br/> 0 *; 1(6)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x07<br/> 0 ; 1(7)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x07<br/> 0 *; 1(7)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x08<br/> 0 ; 1(8)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x08<br/> 0 *; 1(8)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x09<br/> 0 ; 1(9)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x09<br/> 0 *; 1(9)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x0a<br/> 0 ; 1(10)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x0a<br/> 0 *; 1(10)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x0b<br/> 0 ; 1(11)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x0b<br/> 0 *; 1(11)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x0c<br/> 0 ; 1(12)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x0c<br/> 0 *; 1(12)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x0d<br/> 0 ; 1(13)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x0d<br/> 0 *; 1(13)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x0e<br/> 0 ; 1(14)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x0e<br/> 0 *; 1(14)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x0f<br/> 0 ; 1(15)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x0f<br/> 0 *; 1(15)
|-
|-
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x10 <br/> 0 ; 1(16)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x10 <br/> 0 *; 1(16)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x11 <br/> 0 ; 1(17)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x11 <br/> 0 *; 1(17)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x12 <br/> 0 ; 1(18)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x12 <br/> 0 *; 1(18)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x13 <br/> 0 ; 1(19)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x13 <br/> 0 *; 1(19)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x14 <br/> 0 ; 1(20)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x14 <br/> 0 *; 1(20)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x15 <br/> 0 ; 1(21)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x15 <br/> 0 *; 1(21)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x16 <br/> 0 ; 1(22)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x16 <br/> 0 *; 1(22)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x17 <br/> 0 ; 1(23)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x17 <br/> 0 *; 1(23)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x18 <br/> 0 ; 1(24)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x18 <br/> 0 *; 1(24)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x19 <br/> 0 ; 1(25)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x19 <br/> 0 *; 1(25)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x1a <br/> 0 ; 1(26)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x1a <br/> 0 *; 1(26)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x1b <br/> 0 ; 1(27)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x1b <br/> 0 *; 1(27)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x1c <br/> 0 ; 1(28)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x1c <br/> 0 *; 1(28)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x1d <br/> 0 ; 1(29)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x1d <br/> 0 *; 1(29)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x1e <br/> 0 ; 1(30)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x1e <br/> 0 *; 1(30)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x1f <br/> 0 ; 1(31)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x1f <br/> 0 *; 1(31)
|-
|-
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x20 <br/> 0 ; 1(32)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x20 <br/> 0 *; 1(32)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x21 <br/> 0 ; 1(33)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x21 <br/> 0 *; 1(33)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x22 <br/> 0 ; 1(34)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x22 <br/> 0 *; 1(34)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x23 <br/> 0 ; 1(35)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x23 <br/> 0 *; 1(35)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x24 <br/> 0 ; 1(36)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x24 <br/> 0 *; 1(36)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x25 <br/> 0 ; 1(37)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x25 <br/> 0 *; 1(37)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x26 <br/> 0 ; 1(38)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x26 <br/> 0 *; 1(38)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x27 <br/> 0 ; 1(39)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x27 <br/> 0 *; 1(39)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x28 <br/> 0 ; 1(40)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x28 <br/> 0 *; 1(40)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x29 <br/> 0 ; 1(41)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x29 <br/> 0 *; 1(41)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x2a <br/> 0 ; 1(42)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x2a <br/> 0 *; 1(42)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x2b <br/> 0 ; 1(43)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x2b <br/> 0 *; 1(43)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x2c <br/> 0 ; 1(44)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x2c <br/> 0 *; 1(44)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x2d <br/> 0 ; 1(45)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x2d <br/> 0 *; 1(45)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x2e <br/> 0 ; 1(46)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x2e <br/> 0 *; 1(46)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x2f <br/> 0 ; 1(47)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x2f <br/> 0 *; 1(47)
|-
|-
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x30 <br/> 0 ; 1(48)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x30 <br/> 0 *; 1(48)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x31 <br/> 0 ; 1(49)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x31 <br/> 0 *; 1(49)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x32 <br/> 0 ; 1(50)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x32 <br/> 0 *; 1(50)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x33 <br/> 0 ; 1(51)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x33 <br/> 0 *; 1(51)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x34 <br/> 0 ; 1(52)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x34 <br/> 0 *; 1(52)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x35 <br/> 0 ; 1(53)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x35 <br/> 0 *; 1(53)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x36 <br/> 0 ; 1(54)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x36 <br/> 0 *; 1(54)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x37 <br/> 0 ; 1(55)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x37 <br/> 0 *; 1(55)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x38 <br/> 0 ; 1(56)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x38 <br/> 0 *; 1(56)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x39 <br/> 0 ; 1(57)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x39 <br/> 0 *; 1(57)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x3a <br/> 0 ; 1(58)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x3a <br/> 0 *; 1(58)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x3b <br/> 0 ; 1(59)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x3b <br/> 0 *; 1(59)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x3c <br/> 0 ; 1(60)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x3c <br/> 0 *; 1(60)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x3d <br/> 0 ; 1(61)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x3d <br/> 0 *; 1(61)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x3e <br/> 0 ; 1(62)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x3e <br/> 0 *; 1(62)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x3f <br/> 0 ; 1(63)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x3f <br/> 0 *; 1(63)
|-
|-
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x40 <br/> 0 ; 1(64)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x40 <br/> 0 *; 1(64)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x41 <br/> 0 ; 1(65)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x41 <br/> 0 *; 1(65)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x42 <br/> 0 ; 1(66)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x42 <br/> 0 *; 1(66)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x43 <br/> 0 ; 1(67)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x43 <br/> 0 *; 1(67)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x44 <br/> 0 ; 1(68)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x44 <br/> 0 *; 1(68)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x45 <br/> 0 ; 1(69)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x45 <br/> 0 *; 1(69)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x46 <br/> 0 ; 1(70)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x46 <br/> 0 *; 1(70)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x47 <br/> 0 ; 1(71)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x47 <br/> 0 *; 1(71)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x48 <br/> 0 ; 1(72)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x48 <br/> 0 *; 1(72)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x49 <br/> 0 ; 1(73)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x49 <br/> 0 *; 1(73)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x4a <br/> 0 ; 1(74)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x4a <br/> 0 *; 1(74)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x4b <br/> 0 ; 1(75)
| style="border:1px solid #aaaaaa; background-color:gold;" | - <br/> 0x4b <br/> 0 *; 1(75)
| style="border:1px solid #aaaaaa; background-color:#ffff00;" | OP_PUSHDATA1 <br/> 0x4c <br/> 0 ; 1(0 - 255)
| style="border:1px solid #aaaaaa; background-color:#ffff00;" | _PUSHDATA1 <br/> 0x4c <br/> 0 *; 1(0 - 255)
| style="border:1px solid #aaaaaa; background-color:#ffff00;" | OP_PUSHDATA2 <br/> 0x4d <br/> 0 ; 1(0 - 2^16-1)
| style="border:1px solid #aaaaaa; background-color:#ffff00;" | _PUSHDATA2 <br/> 0x4d <br/> 0 *; 1(0 - 2^16-1)
| style="border:1px solid #aaaaaa; background-color:#ffff00;" | OP_PUSHDATA4 <br/> 0x4e <br/> 0 ; 1(0 - 2^32-1)
| style="border:1px solid #aaaaaa; background-color:#ffff00;" | _PUSHDATA4 <br/> 0x4e <br/> 0 *; 1(0 - 2^32-1)
| style="border:1px solid #aaaaaa; background-color:#ffb000;" | OP_1NEGATE <br/> 0x4f <br/> 0 ; 1(1)
| style="border:1px solid #aaaaaa; background-color:#ffb000;" | _1NEGATE <br/> 0x4f <br/> 0 ; 1(1)
|-
| style="border:1px solid #aaaaaa; background-color:#ffffff;" | _RESERVED <br/> 0x50 <br/>
| style="border:1px solid #aaaaaa; background-color:#ffb000;" | _1 <br/> 0x51 <br/> 0 ; 1(1)
| style="border:1px solid #aaaaaa; background-color:#ffb000;" | _2 <br/> 0x52 <br/> 0 ; 1(1)
| style="border:1px solid #aaaaaa; background-color:#ffb000;" | _3 <br/> 0x53 <br/> 0 ; 1(1)
| style="border:1px solid #aaaaaa; background-color:#ffb000;" | _4 <br/> 0x54 <br/> 0 ; 1(1)
| style="border:1px solid #aaaaaa; background-color:#ffb000;" | _5 <br/> 0x55 <br/> 0 ; 1(1)
| style="border:1px solid #aaaaaa; background-color:#ffb000;" | _6 <br/> 0x56 <br/> 0 ; 1(1)
| style="border:1px solid #aaaaaa; background-color:#ffb000;" | _7 <br/> 0x57 <br/> 0 ; 1(1)
| style="border:1px solid #aaaaaa; background-color:#ffb000;" | _8 <br/> 0x58 <br/> 0 ; 1(1)
| style="border:1px solid #aaaaaa; background-color:#ffb000;" | _9 <br/> 0x59 <br/> 0 ; 1(1)
| style="border:1px solid #aaaaaa; background-color:#ffb000;" | _10 <br/> 0x5a <br/> 0 ; 1(1)
| style="border:1px solid #aaaaaa; background-color:#ffb000;" | _11 <br/> 0x5b <br/> 0 ; 1(1)
| style="border:1px solid #aaaaaa; background-color:#ffb000;" | _12 <br/> 0x5c <br/> 0 ; 1(1)
| style="border:1px solid #aaaaaa; background-color:#ffb000;" | _13 <br/> 0x5d <br/> 0 ; 1(1)
| style="border:1px solid #aaaaaa; background-color:#ffb000;" | _14 <br/> 0x5e <br/> 0 ; 1(1)
| style="border:1px solid #aaaaaa; background-color:#ffb000;" | _15 <br/> 0x5f <br/> 0 ; 1(1)
|-
| style="border:1px solid #aaaaaa; background-color:#ffb000;" | _16 <br/> 0x60 <br/> 0 ; 1(1)
| style="border:1px solid #aaaaaa; background-color:#00d000;" | _NOP <br/> 0x61 <br/> 0 ; 0
| style="border:1px solid #aaaaaa; background-color:#ffffff;" | _VER <br/> 0x62 <br/>
| style="border:1px solid #aaaaaa; background-color:#00d000;" | _IF <br/> 0x63 <br/> 1 ; 0
| style="border:1px solid #aaaaaa; background-color:#00d000;" | _NOTIF <br/> 0x64 <br/> 1 ; 0
| style="border:1px solid #aaaaaa; background-color:#ffffff;" | _VERIF <br/> 0x65 <br/>
| style="border:1px solid #aaaaaa; background-color:#ffffff;" | _VERNOTIF <br/> 0x66 <br/>
| style="border:1px solid #aaaaaa; background-color:#00d000;" | _ELSE <br/> 0x67 <br/> 0 ; 0
| style="border:1px solid #aaaaaa; background-color:#00d000;" | _ENDIF <br/> 0x68 <br/> 0 ; 0
| style="border:1px solid #aaaaaa; background-color:#00ff00;" | _VERIFY <br/> 0x69 <br/> 1 ; 0/1
| style="border:1px solid #aaaaaa; background-color:#00ff00;" | _RETURN <br/> 0x6a <br/> 0 ; 0
| style="border:1px solid #aaaaaa; background-color:#ff8080;" | _TOALTSTACK <br/> 0x6b <br/> 1 ; 0
| style="border:1px solid #aaaaaa; background-color:#ff8080;" | _FROMALTSTACK <br/> 0x6c <br/> 0 #; 1
| style="border:1px solid #aaaaaa; background-color:#ff4040;" | _2DROP <br/> 0x6d <br/> 2 ; 0
| style="border:1px solid #aaaaaa; background-color:#ff4040;" | _2DUP <br/> 0x6e <br/> 2 ; 4
| style="border:1px solid #aaaaaa; background-color:#ff4040;" | _3DUP <br/> 0x6f <br/> 3 ; 6
|-
| style="border:1px solid #aaaaaa; background-color:#ff4040;" | _2OVER <br/> 0x70 <br/> 4 ; 6
| style="border:1px solid #aaaaaa; background-color:#ff4040;" | _2ROT <br/> 0x71 <br/> 6 ; 6
| style="border:1px solid #aaaaaa; background-color:#ff4040;" | _2SWAP <br/> 0x72 <br/> 4 ; 4
| style="border:1px solid #aaaaaa; background-color:#ff4040;" | _IFDUP <br/> 0x73 <br/> 1 ; 1/2
| style="border:1px solid #aaaaaa; background-color:#ff4040;" | _DEPTH <br/> 0x74 <br/> 0 ; 1
| style="border:1px solid #aaaaaa; background-color:#ff4040;" | _DROP <br/> 0x75 <br/> 1 ; 0
| style="border:1px solid #aaaaaa; background-color:#ff4040;" | _DUP <br/> 0x76 <br/> 1 ; 2
| style="border:1px solid #aaaaaa; background-color:#ff4040;" | _NIP <br/> 0x77 <br/> 2 ; 1
| style="border:1px solid #aaaaaa; background-color:#ff4040;" | _OVER <br/> 0x78 <br/> 2 ; 3
| style="border:1px solid #aaaaaa; background-color:#ff4040;" | _PICK <br/> 0x79 <br/> 1+n+1 ; n+2
| style="border:1px solid #aaaaaa; background-color:#ff4040;" | _ROLL <br/> 0x7a <br/> 1+n+1 ; n+1
| style="border:1px solid #aaaaaa; background-color:#ff4040;" | _ROT <br/> 0x7b <br/> 3 ; 3
| style="border:1px solid #aaaaaa; background-color:#ff4040;" | _SWAP <br/> 0x7c <br/> 2 ; 2
| style="border:1px solid #aaaaaa; background-color:#ff4040;" | _TUCK <br/> 0x7d <br/> 2 ; 3
| style="border:1px solid #aaaaaa; background-color:#f000a0; color:white" | _CAT <br/> 0x7e <br/> 2 ; 1
| style="border:1px solid #aaaaaa; background-color:#f000a0; color:white" | _SUBSTR <br/> 0x7f <br/> 3 ; 1
|-
| style="border:1px solid #aaaaaa; background-color:#f000a0; color:white" | _LEFT <br/> 0x80 <br/> 2 ; 1
| style="border:1px solid #aaaaaa; background-color:#f000a0; color:white" | _RIGHT <br/> 0x81 <br/> 2 ; 1
| style="border:1px solid #aaaaaa; background-color:#f000a0;" | _SIZE <br/> 0x82 <br/> 1 ; 2
| style="border:1px solid #aaaaaa; background-color:#f000f0; color:white" | _INVERT <br/> 0x83 <br/> 1 ; 1
| style="border:1px solid #aaaaaa; background-color:#f000f0; color:white" | _AND <br/> 0x84 <br/> 2 ; 1
| style="border:1px solid #aaaaaa; background-color:#f000f0; color:white" | _OR <br/> 0x85 <br/> 2 ; 1
| style="border:1px solid #aaaaaa; background-color:#f000f0; color:white" | _XOR <br/> 0x86 <br/> 2 ; 1
| style="border:1px solid #aaaaaa; background-color:#f000f0;" | _EQUAL <br/> 0x87 <br/> 2 ; 1
| style="border:1px solid #aaaaaa; background-color:#ffa0ff;" | _EQUALVERIFY <br/> 0x88 <br/> 2 ; 0/1
| style="border:1px solid #aaaaaa; background-color:#ffffff;" | _RESERVED1 <br/> 0x89 <br/>
| style="border:1px solid #aaaaaa; background-color:#ffffff;" | _RESERVED2 <br/> 0x8a <br/>
| style="border:1px solid #aaaaaa; background-color:#f000f0;" | _1ADD <br/> 0x8b <br/> 1 ; 1
| style="border:1px solid #aaaaaa; background-color:#f000f0;" | _1SUB <br/> 0x8c <br/> 1 ; 1
| style="border:1px solid #aaaaaa; background-color:#f000f0; color:white" | _2MUL <br/> 0x8d <br/> 1 ; 1
| style="border:1px solid #aaaaaa; background-color:#f000f0; color:white" | _2DIV <br/> 0x8e <br/> 1 ; 1
| style="border:1px solid #aaaaaa; background-color:#f000f0;" | _NEGATE <br/> 0x8f <br/> 1 ; 1
|-
| style="border:1px solid #aaaaaa; background-color:#f000f0;" | _ABS <br/> 0x90 <br/> 1 ; 1
| style="border:1px solid #aaaaaa; background-color:#f000f0;" | _NOT <br/> 0x91 <br/> 1 ; 1
| style="border:1px solid #aaaaaa; background-color:#f000f0;" | _0NOTEQUAL <br/> 0x92 <br/> 1 ; 1
| style="border:1px solid #aaaaaa; background-color:#f000f0;" | _ADD <br/> 0x93 <br/> 2 ; 1
| style="border:1px solid #aaaaaa; background-color:#f000f0;" | _SUB <br/> 0x94 <br/> 2 ; 1
| style="border:1px solid #aaaaaa; background-color:#f000f0; color:white" | _MUL <br/> 0x95 <br/> 2 ; 1
| style="border:1px solid #aaaaaa; background-color:#f000f0; color:white" | _DIV <br/> 0x96 <br/> 2 ; 1
| style="border:1px solid #aaaaaa; background-color:#f000f0; color:white" | _MOD <br/> 0x97 <br/> 2 ; 1
| style="border:1px solid #aaaaaa; background-color:#f000f0; color:white" | _LSHIFT <br/> 0x98 <br/> 2 ; 1
| style="border:1px solid #aaaaaa; background-color:#f000f0; color:white" | _RSHIFT <br/> 0x99 <br/> 2 ; 1
| style="border:1px solid #aaaaaa; background-color:#f000f0;" | _BOOLAND <br/> 0x9a <br/> 2 ; 1
| style="border:1px solid #aaaaaa; background-color:#f000f0;" | _BOOLOR <br/> 0x9b <br/> 2 ; 1
| style="border:1px solid #aaaaaa; background-color:#f000f0;" | _NUMEQUAL <br/> 0x9c <br/> 2 ; 1
| style="border:1px solid #aaaaaa; background-color:#ffa0ff;" | _NUMEQUALVERIFY <br/> 0x9d <br/> 2 ; 0/1
| style="border:1px solid #aaaaaa; background-color:#f000f0;" | _NUMNOTEQUAL <br/> 0x9e <br/> 2 ; 1
| style="border:1px solid #aaaaaa; background-color:#f000f0;" | _LESSTHAN <br/> 0x9f <br/> 2 ; 1
|-
| style="border:1px solid #aaaaaa; background-color:#f000f0;" | _GREATERTHAN <br/> 0xa0 <br/> 2 ; 1
| style="border:1px solid #aaaaaa; background-color:#f000f0;" | _LESSTHANOREQUAL <br/> 0xa1 <br/> 2 ; 1
| style="border:1px solid #aaaaaa; background-color:#f000f0;" | _GREATERTHANOREQUAL <br/> 0xa2 <br/> 2 ; 1
| style="border:1px solid #aaaaaa; background-color:#f000f0;" | _MIN <br/> 0xa3 <br/> 2 ; 1
| style="border:1px solid #aaaaaa; background-color:#f000f0;" | _MAX <br/> 0xa4 <br/> 2 ; 1
| style="border:1px solid #aaaaaa; background-color:#f000f0;" | _WITHIN <br/> 0xa5 <br/> 3 ; 1
| style="border:1px solid #aaaaaa; background-color:#00c0f0;" | _RIPEMD160 <br/> 0xa6 <br/> 1 ; 1
| style="border:1px solid #aaaaaa; background-color:#00c0f0;" | _SHA1 <br/> 0xa7 <br/> 1 ; 1
| style="border:1px solid #aaaaaa; background-color:#00c0f0;" | _SHA256 <br/> 0xa8 <br/> 1 ; 1
| style="border:1px solid #aaaaaa; background-color:#00c0f0;" | _HASH160 <br/> 0xa9 <br/> 1 ; 1
| style="border:1px solid #aaaaaa; background-color:#00c0f0;" | _HASH256 <br/> 0xaa <br/> 1 ; 1
| style="border:1px solid #aaaaaa; background-color:#00c0f0;" | _CODESEPARATOR  <br/> 0xab <br/> 0 ; 0
| style="border:1px solid #aaaaaa; background-color:#00c0f0;" | _CHECKSIG <br/> 0xac <br/> 2 @; 1
| style="border:1px solid #aaaaaa; background-color:#a0d0ff;" | _CHECKSIGVERIFY <br/> 0xad <br/> 2 @; 0/1
| style="border:1px solid #aaaaaa; background-color:#00c0f0;" | _CHECKMULTISIG <br/> 0xae <br/> 2n+2 @; 1
| style="border:1px solid #aaaaaa; background-color:#a0d0ff;" | _CHECKMULTISIGVERIFY <br/> 0xaf <br/> 2n+2 @; 0/1
|-
| style="border:1px solid #aaaaaa; background-color:#00d000;" | _NOP1 <br/> 0xb0 <br/> 0 ; 0
| style="border:1px solid #aaaaaa; background-color:#00d000;" | _NOP2 <br/> 0xb1 <br/> 0 ; 0
| style="border:1px solid #aaaaaa; background-color:#00d000;" | _NOP3 <br/> 0xb2 <br/> 0 ; 0
| style="border:1px solid #aaaaaa; background-color:#00d000;" | _NOP4 <br/> 0xb3 <br/> 0 ; 0
| style="border:1px solid #aaaaaa; background-color:#00d000;" | _NOP5 <br/> 0xb4 <br/> 0 ; 0
| style="border:1px solid #aaaaaa; background-color:#00d000;" | _NOP6 <br/> 0xb5 <br/> 0 ; 0
| style="border:1px solid #aaaaaa; background-color:#00d000;" | _NOP7 <br/> 0xb6 <br/> 0 ; 0
| style="border:1px solid #aaaaaa; background-color:#00d000;" | _NOP8 <br/> 0xb7 <br/> 0 ; 0
| style="border:1px solid #aaaaaa; background-color:#00d000;" | _NOP9 <br/> 0xb8 <br/> 0 ; 0
| style="border:1px solid #aaaaaa; background-color:#00d000;" | _NOP10 <br/> 0xb9 <br/> 0 ; 0
| style="border:1px solid #aaaaaa; background-color:#ffffff;" | - <br/> 0xba <br/>
| style="border:1px solid #aaaaaa; background-color:#ffffff;" | - <br/> 0xbb <br/>
| style="border:1px solid #aaaaaa; background-color:#ffffff;" | - <br/> 0xbc <br/>
| style="border:1px solid #aaaaaa; background-color:#ffffff;" | - <br/> 0xbd <br/>
| style="border:1px solid #aaaaaa; background-color:#ffffff;" | - <br/> 0xbe <br/>
| style="border:1px solid #aaaaaa; background-color:#ffffff;" | - <br/> 0xbf <br/>
|-
| style="border:1px solid #aaaaaa; background-color:#ffffff;" | - <br/> 0xc0 <br/>
| style="border:1px solid #aaaaaa; background-color:#ffffff;" | - <br/> 0xc1 <br/>
| style="border:1px solid #aaaaaa; background-color:#ffffff;" | - <br/> 0xc2 <br/>
| style="border:1px solid #aaaaaa; background-color:#ffffff;" | - <br/> 0xc3 <br/>
| style="border:1px solid #aaaaaa; background-color:#ffffff;" | - <br/> 0xc4 <br/>
| style="border:1px solid #aaaaaa; background-color:#ffffff;" | - <br/> 0xc5 <br/>
| style="border:1px solid #aaaaaa; background-color:#ffffff;" | - <br/> 0xc6 <br/>
| style="border:1px solid #aaaaaa; background-color:#ffffff;" | - <br/> 0xc7 <br/>
| style="border:1px solid #aaaaaa; background-color:#ffffff;" | - <br/> 0xc8 <br/>
| style="border:1px solid #aaaaaa; background-color:#ffffff;" | - <br/> 0xc9 <br/>
| style="border:1px solid #aaaaaa; background-color:#ffffff;" | - <br/> 0xca <br/>
| style="border:1px solid #aaaaaa; background-color:#ffffff;" | - <br/> 0xcb <br/>
| style="border:1px solid #aaaaaa; background-color:#ffffff;" | - <br/> 0xcc <br/>
| style="border:1px solid #aaaaaa; background-color:#ffffff;" | - <br/> 0xcd <br/>
| style="border:1px solid #aaaaaa; background-color:#ffffff;" | - <br/> 0xce <br/>
| style="border:1px solid #aaaaaa; background-color:#ffffff;" | - <br/> 0xcf <br/>
|-
| style="border:1px solid #aaaaaa; background-color:#ffffff;" | - <br/> 0xd0 <br/>
| style="border:1px solid #aaaaaa; background-color:#ffffff;" | - <br/> 0xd1 <br/>
| style="border:1px solid #aaaaaa; background-color:#ffffff;" | - <br/> 0xd2 <br/>
| style="border:1px solid #aaaaaa; background-color:#ffffff;" | - <br/> 0xd3 <br/>
| style="border:1px solid #aaaaaa; background-color:#ffffff;" | - <br/> 0xd4 <br/>
| style="border:1px solid #aaaaaa; background-color:#ffffff;" | - <br/> 0xd5 <br/>
| style="border:1px solid #aaaaaa; background-color:#ffffff;" | - <br/> 0xd6 <br/>
| style="border:1px solid #aaaaaa; background-color:#ffffff;" | - <br/> 0xd7 <br/>
| style="border:1px solid #aaaaaa; background-color:#ffffff;" | - <br/> 0xd8 <br/>
| style="border:1px solid #aaaaaa; background-color:#ffffff;" | - <br/> 0xd9 <br/>
| style="border:1px solid #aaaaaa; background-color:#ffffff;" | - <br/> 0xda <br/>
| style="border:1px solid #aaaaaa; background-color:#ffffff;" | - <br/> 0xdb <br/>
| style="border:1px solid #aaaaaa; background-color:#ffffff;" | - <br/> 0xdc <br/>
| style="border:1px solid #aaaaaa; background-color:#ffffff;" | - <br/> 0xdd <br/>
| style="border:1px solid #aaaaaa; background-color:#ffffff;" | - <br/> 0xde <br/>
| style="border:1px solid #aaaaaa; background-color:#ffffff;" | - <br/> 0xdf <br/>
|-
| style="border:1px solid #aaaaaa; background-color:#ffffff;" | - <br/> 0xe0 <br/>
| style="border:1px solid #aaaaaa; background-color:#ffffff;" | - <br/> 0xe1 <br/>
| style="border:1px solid #aaaaaa; background-color:#ffffff;" | - <br/> 0xe2 <br/>
| style="border:1px solid #aaaaaa; background-color:#ffffff;" | - <br/> 0xe3 <br/>
| style="border:1px solid #aaaaaa; background-color:#ffffff;" | - <br/> 0xe4 <br/>
| style="border:1px solid #aaaaaa; background-color:#ffffff;" | - <br/> 0xe5 <br/>
| style="border:1px solid #aaaaaa; background-color:#ffffff;" | - <br/> 0xe6 <br/>
| style="border:1px solid #aaaaaa; background-color:#ffffff;" | - <br/> 0xe7 <br/>
| style="border:1px solid #aaaaaa; background-color:#ffffff;" | - <br/> 0xe8 <br/>
| style="border:1px solid #aaaaaa; background-color:#ffffff;" | - <br/> 0xe9 <br/>
| style="border:1px solid #aaaaaa; background-color:#ffffff;" | - <br/> 0xea <br/>
| style="border:1px solid #aaaaaa; background-color:#ffffff;" | - <br/> 0xeb <br/>
| style="border:1px solid #aaaaaa; background-color:#ffffff;" | - <br/> 0xec <br/>
| style="border:1px solid #aaaaaa; background-color:#ffffff;" | - <br/> 0xed <br/>
| style="border:1px solid #aaaaaa; background-color:#ffffff;" | - <br/> 0xee <br/>
| style="border:1px solid #aaaaaa; background-color:#ffffff;" | - <br/> 0xef <br/>
|-
| style="border:1px solid #aaaaaa; background-color:#ffffff;" | - <br/> 0xf0 <br/>
| style="border:1px solid #aaaaaa; background-color:#ffffff;" | - <br/> 0xf1 <br/>
| style="border:1px solid #aaaaaa; background-color:#ffffff;" | - <br/> 0xf2 <br/>
| style="border:1px solid #aaaaaa; background-color:#ffffff;" | - <br/> 0xf3 <br/>
| style="border:1px solid #aaaaaa; background-color:#ffffff;" | - <br/> 0xf4 <br/>
| style="border:1px solid #aaaaaa; background-color:#ffffff;" | - <br/> 0xf5 <br/>
| style="border:1px solid #aaaaaa; background-color:#ffffff;" | - <br/> 0xf6 <br/>
| style="border:1px solid #aaaaaa; background-color:#ffffff;" | - <br/> 0xf7 <br/>
| style="border:1px solid #aaaaaa; background-color:#ffffff;" | - <br/> 0xf8 <br/>
| style="border:1px solid #aaaaaa; background-color:#ffffff;" | - <br/> 0xf9 <br/>
| style="border:1px solid #aaaaaa; background-color:#ffffff;" | - <br/> 0xfa <br/>
| style="border:1px solid #aaaaaa; background-color:#f0f0f0;" | _SMALLINTEGER <br/> 0xfb <br/>
| style="border:1px solid #aaaaaa; background-color:#f0f0f0;" | _PUBKEYS <br/> 0xfc <br/>
| style="border:1px solid #aaaaaa; background-color:#f0f0f0;" | _PUBKEYHASH  <br/> 0xfd <br/>
| style="border:1px solid #aaaaaa; background-color:#f0f0f0;" | _PUBKEY <br/> 0xfe <br/>
| style="border:1px solid #aaaaaa; background-color:#ffffff;" | _INVALIDOPCODE <br/> 0xff <br/>
|}
The opcode value 0x00 with nemonic OP_FALSE is also named OP_0 and the opcode value 0x51 with nemonic OP_1 as also named OP_TRUE.<br>


|}
== opcode descriptions ==
It follows for each opcode less than decimal 185 (hexa 0xba) a description for its usage. The columns entiteld ''nemonic'', ''decimal'' and ''Hex'' should be evident. The column ''input'' gives the needed items of the stack (and the alternate stack) and the column ''output'' indicates the resulting items on the stack (and the alternate stack). The naming of the entries in these two columns is chosen to reflect their interpretation. ''x'',''x0'',''x1'',... means arbitrary or no interpretation, ''a'', ''b'' and ''c'' as a signed integer value, ''n'',''index'',''size'' and ''depth'' non-negative integer values, ''Boolean'' as either a true or false.<br>
Some of the more complicated opcodes are disabled out of concern that the client might have (and has) a bug in the current implementation due to the historically not as 2-complement interpretations of the byte vectors as numerical values (the most significant byte holds the sign of the byte vectors).


=== Constants ===
=== Constants ===
Line 105: Line 298:
!Description
!Description
|-
|-
|OP_FALSE
|OP_FALSE, OP_0
|0
|0
|0x00
|0x00
|Nothing.
|Nothing
|(empty value)
|Empty string
|An empty array of bytes is pushed onto the stack. (This is not a no-op: an item is added to the stack.)
|A byte vector of length 0 is pushed onto the stack. (Thus, it is not a no-op!)
|-
|-
|N/A
|(no official nemonics)
|1-75
|1 - 75
|0x01-0x4b
|0x01 - 0x4b
|(special)
|(operands)
|data
|x
|The next ''opcode'' bytes is data to be pushed onto the stack
|The next <opcode>-many bytes are to be pushed onto the stack.
|-
|-
|OP_PUSHDATA1
|OP_PUSHDATA1
|76
|76
|0x4c
|0x4c
|(special)
|(operands)
|data
|x
|The next byte contains the number of bytes to be pushed onto the stack.
|The next byte contains the number of bytes to be pushed onto the stack which follow this byte.
|-
|-
|OP_PUSHDATA2
|OP_PUSHDATA2
|77
|77
|0x4d
|0x4d
|(special)
|(operands)
|data
|x
|The next two bytes contain the number of bytes to be pushed onto the stack.
|The next two bytes contain the number of bytes to be pushed onto the stack which follow theses 2 bytes.
|-
|-
|OP_PUSHDATA4
|OP_PUSHDATA4
|78
|78
|0x4e
|0x4e
|(special)
|(operands)
|data
|x
|The next four bytes contain the number of bytes to be pushed onto the stack.
|The next four bytes contain the number of bytes to be pushed onto the stack which follow theses 4 bytes.
|-
|-
|OP_1NEGATE
|OP_1NEGATE
|79
|79
|0x4f
|0x4f
|Nothing.
|Nothing
| -1
| -1
|The number -1 is pushed onto the stack.
|The number -1 is pushed onto the stack.
Line 150: Line 343:
|81
|81
|0x51
|0x51
|Nothing.
|Nothing
|1
|1
|The number 1 is pushed onto the stack.
|The number 1 is pushed onto the stack.
|-
|-
|OP_2-OP_16
|OP_2 - OP_16
|82-96
|82 - 96
|0x52-0x60
|0x52 - 0x60
|Nothing.
|Nothing
|2-16
|2-16
|The number in the word name (2-16) is pushed onto the stack.
|The value <opcode>-80 (thus, one of 2 - 16) is pushed onto the stack.
|}
|}


Line 183: Line 376:
|99
|99
|0x63
|0x63
| colspan="2"|<expression> if [statements] [else [statements]]* endif
|Boolean
|If the top stack value is not 0, the statements are executed. The top stack value is removed.
|Nothing
|If the top stack value is not 0, the statements are executed. The top stack value is removed. Lead in a logcial ''<value> then [statements] [else [statements]] endif'' expression
|-
|-
|OP_NOTIF
|OP_NOTIF
|100
|100
|0x64
|0x64
| colspan="2"|<expression> if [statements] [else [statements]]* endif
|Boolean
|If the top stack value is 0, the statements are executed. The top stack value is removed.
|Nothing
|If the top stack value is 0, the statements are executed. The top stack value is removed. Lead in a logcial ''<value> then [statements] [else [statements]] endif'' expression
|-
|-
|OP_ELSE
|OP_ELSE
|103
|103
|0x67
|0x67
| colspan="2"|<expression> if [statements] [else [statements]]* endif
|Nothing
|Nothing
|If the preceding OP_IF or OP_NOTIF or OP_ELSE was not executed then these statements are and if the preceding OP_IF or OP_NOTIF or OP_ELSE was executed then these statements are not.  
|If the preceding OP_IF or OP_NOTIF or OP_ELSE was not executed then these statements are and if the preceding OP_IF or OP_NOTIF or OP_ELSE was executed then these statements are not.  
|-
|-
Line 201: Line 397:
|104
|104
|0x68
|0x68
| colspan="2"|<expression> if [statements] [else [statements]]* endif
|Nothing
|Ends an if/else block.
|Nothing
|Ends a logcial ''If <value> then [statements] [else [statements]] '' expression
|-
|-
|OP_VERIFY
|OP_VERIFY
|105
|105
|0x69
|0x69
|True / false
|Boolean
|Nothing / False
|Nothing / False
|'''Marks transaction as invalid''' if top stack value is not true. True is removed, but false is not.
|If top stack value is not true then marks transaction as '''invalid''' . A value true is removed, but false is not.
|-
|-
|OP_RETURN
|OP_RETURN
Line 216: Line 413:
|Nothing
|Nothing
|Nothing
|Nothing
|'''Marks transaction as invalid'''.  
|Marks transaction as '''invalid'''.  
|}
|}


Line 233: Line 430:
|107
|107
|0x6b
|0x6b
|x1
|x1 (alt)
|(alt)x1
|(alt x1)
|Puts the input onto the top of the alt stack. Removes it from the main stack.
|Puts the input onto the top of the alt stack. Removes it from the (main) stack.
|-
|-
|OP_FROMALTSTACK
|OP_FROMALTSTACK
|108
|108
|0x6c
|0x6c
|(alt)x1
|(alt x1)
|x1
|x1 (alt)
|Puts the input onto the top of the main stack. Removes it from the alt stack.
|Puts the input onto the top of the (main) stack. Removes it from the alt stack.
|-
|OP_2DROP
|109
|0x6d
|x1 x2
|Nothing
|Removes the top two stack items.
|-
|OP_2DUP
|110
|0x6e
|x1 x2
|x1 x2 x1 x2
|Duplicates the top two stack items.
|-
|OP_3DUP
|111
|0x6f
|x1 x2 x3
|x1 x2 x3 x1 x2 x3
|Duplicates the top three stack items.
|-
|OP_2OVER
|112
|0x70
|x1 x2 x3 x4
|x1 x2 x3 x4 x1 x2
|Copies the pair of items two spaces back in the stack to the front.
|-
|OP_2ROT
|113
|0x71
|x1 x2 x3 x4 x5 x6
|x3 x4 x5 x6 x1 x2
|The fifth and sixth items back are moved to the top of the stack.
|-
|OP_2SWAP
|114
|0x72
|x1 x2 x3 x4
|x3 x4 x1 x2
|Swaps the top two pairs of items.
|-
|-
|OP_IFDUP
|OP_IFDUP
Line 255: Line 494:
|0x74
|0x74
|Nothing
|Nothing
|<Stack size>
|depth
|Puts the number of stack items onto the stack.
|Puts the number of stack items onto the stack as one little-endian coded byte-vector
|-
|-
|OP_DROP
|OP_DROP
Line 320: Line 559:
|x2 x1 x2
|x2 x1 x2
|The item at the top of the stack is copied and inserted before the second-to-top item.
|The item at the top of the stack is copied and inserted before the second-to-top item.
|-
|OP_2DROP
|109
|0x6d
|x1 x2
|Nothing
|Removes the top two stack items.
|-
|OP_2DUP
|110
|0x6e
|x1 x2
|x1 x2 x1 x2
|Duplicates the top two stack items.
|-
|OP_3DUP
|111
|0x6f
|x1 x2 x3
|x1 x2 x3 x1 x2 x3
|Duplicates the top three stack items.
|-
|OP_2OVER
|112
|0x70
|x1 x2 x3 x4
|x1 x2 x3 x4 x1 x2
|Copies the pair of items two spaces back in the stack to the front.
|-
|OP_2ROT
|113
|0x71
|x1 x2 x3 x4 x5 x6
|x3 x4 x5 x6 x1 x2
|The fifth and sixth items back are moved to the top of the stack.
|-
|OP_2SWAP
|114
|0x72
|x1 x2 x3 x4
|x3 x4 x1 x2
|Swaps the top two pairs of items.
|}
|}


Line 380: Line 577:
|x1 x2
|x1 x2
|out
|out
|Concatenates two strings. ''Currently disabled.''
|Concatenates two strings resp. byte vectors. ''Currently disabled.''
|-
|-
|OP_SUBSTR
|OP_SUBSTR
|127
|127
|0x7f
|0x7f
|in begin size
|x index size
|out
|out
|Returns a section of a string. ''Currently disabled.''
|Returns the section started at position <index> and of length <size> of a string resp. byte vector. ''Currently disabled.''
|-
|-
|OP_LEFT
|OP_LEFT
|128
|128
|0x80
|0x80
|in size
|x index
|out
|out
|Keeps only characters left of the specified point in a string. ''Currently disabled.''
|Keeps only characters left of the specified point in a string. ''Currently disabled.''
Line 399: Line 596:
|129
|129
|0x81
|0x81
|in size
|x index
|out
|out
|Keeps only characters right of the specified point in a string. ''Currently disabled.''
|Keeps only characters right of the specified point in a string. ''Currently disabled.''
Line 406: Line 603:
|130
|130
|0x82
|0x82
|in
|x
|in size
|x size
|Returns the length of the input string.
|Returns the length of the input string resp. byte vector resp. stack item.
|}
|}


Line 425: Line 622:
|131
|131
|0x83
|0x83
|in
|x1
|out
|x0
|Flips all of the bits in the input. ''Currently disabled.''
|Flips all of the bits in the input. ''Currently disabled.''
|-
|-
Line 433: Line 630:
|0x84
|0x84
|x1 x2
|x1 x2
|out
|x0
|Boolean ''and'' between each bit in the inputs. ''Currently disabled.''
|Boolean ''and'' between each bit in the inputs. ''Currently disabled.''
|-
|-
Line 440: Line 637:
|0x85
|0x85
|x1 x2
|x1 x2
|out
|x0
|Boolean ''or'' between each bit in the inputs. ''Currently disabled.''
|Boolean ''or'' between each bit in the inputs. ''Currently disabled.''
|-
|-
Line 447: Line 644:
|0x86
|0x86
|x1 x2
|x1 x2
|out
|x0
|Boolean ''exclusive or'' between each bit in the inputs. ''Currently disabled.''
|Boolean ''exclusive or'' between each bit in the inputs. ''Currently disabled.''
|-
|-
Line 454: Line 651:
|0x87
|0x87
|x1 x2
|x1 x2
|True / false
|Boolean
|Returns 1 if the inputs are exactly equal, 0 otherwise.
|Returns 1 if the inputs are byte-wise equal, 0 otherwise.
|-
|-
|OP_EQUALVERIFY
|OP_EQUALVERIFY
Line 461: Line 658:
|0x88
|0x88
|x1 x2
|x1 x2
|True / false
|Nothing / false
|Same as OP_EQUAL, but runs OP_VERIFY afterward.
|Same as OP_EQUAL, but runs OP_VERIFY afterward.
|}
|}
Line 467: Line 664:
=== Arithmetic ===
=== Arithmetic ===


Arithmetic is limited to max 4 byte integers
(In very early versions, the implemented arithmetic opcodes were limited to maximal 4 byte vectors.)


{| class="wikitable"  
{| class="wikitable"  
Line 481: Line 678:
|139
|139
|0x8b
|0x8b
|in
|a
|out
|c
|1 is added to the input.
|1 is added to the input.
|-
|-
Line 488: Line 685:
|140
|140
|0x8c
|0x8c
|in
|a
|out
|c
|1 is subtracted from the input.
|1 is subtracted from the input.
|-
|-
Line 495: Line 692:
|141
|141
|0x8d
|0x8d
|in
|a
|out
|c
|The input is multiplied by 2. ''Currently disabled.''
|The input is multiplied by 2. ''Currently disabled.''
|-
|-
Line 502: Line 699:
|142
|142
|0x8e
|0x8e
|in
|a
|out
|c
|The input is divided by 2. ''Currently disabled.''
|The input is divided by 2. ''Currently disabled.''
|-
|-
Line 509: Line 706:
|143
|143
|0x8f
|0x8f
|in
|a
|out
|c
|The sign of the input is flipped.
|The sign of the input is flipped.
|-
|-
Line 516: Line 713:
|144
|144
|0x90
|0x90
|in
|a
|out
|c
|The input is made positive.
|The input is negative, its sign is flipped.
|-
|-
|OP_NOT
|OP_NOT
|145
|145
|0x91
|0x91
|in
|a
|out
|Boolean
|If the input is 0 or 1, it is flipped. Otherwise the output will be 0.
|If the input is 0 or 1, it is flipped. Otherwise the output will be 0.
|-
|-
Line 530: Line 727:
|146
|146
|0x92
|0x92
|in
|a
|out
|Boolean
|Returns 0 if the input is 0. 1 otherwise.
|Returns 0 if the input is 0. 1 otherwise.
|-
|-
Line 538: Line 735:
|0x93
|0x93
|a b
|a b
|out
|c
|a is added to b.
|a is added to b.
|-
|-
Line 545: Line 742:
|0x94
|0x94
|a b
|a b
|out
|c
|b is subtracted from a.
|b is subtracted from a.
|-
|-
Line 552: Line 749:
|0x95
|0x95
|a b
|a b
|out
|c
|a is multiplied by b. ''Currently disabled.''
|a is multiplied by b. ''Currently disabled.''
|-
|-
Line 559: Line 756:
|0x96
|0x96
|a b
|a b
|out
|c
|a is divided by b. ''Currently disabled.''
|a is divided by b (b should be not 0). ''Currently disabled.''
|-
|-
|OP_MOD
|OP_MOD
Line 566: Line 763:
|0x97
|0x97
|a b
|a b
|out
|c
|Returns the remainder after dividing a by b. ''Currently disabled.''
|Returns the remainder after dividing a by b (b should be not 0). ''Currently disabled.''
|-
|-
|OP_LSHIFT
|OP_LSHIFT
Line 573: Line 770:
|0x98
|0x98
|a b
|a b
|out
|c
|Shifts a left b bits, preserving sign. ''Currently disabled.''
|Shifts a left by b bits, preserving sign. ''Currently disabled.''
|-
|-
|OP_RSHIFT
|OP_RSHIFT
Line 580: Line 777:
|0x99
|0x99
|a b
|a b
|out
|c
|Shifts a right b bits, preserving sign. ''Currently disabled.''
|Shifts a right by b bits, preserving sign. ''Currently disabled.''
|-
|-
|OP_BOOLAND
|OP_BOOLAND
Line 587: Line 784:
|0x9a
|0x9a
|a b
|a b
|out
|Boolean
|If both a and b are not 0, the output is 1. Otherwise 0.
|If both a and b are not 0, the output is 1. Otherwise 0.
|-
|-
Line 594: Line 791:
|0x9b
|0x9b
|a b
|a b
|out
|Boolean
|If a or b is not 0, the output is 1. Otherwise 0.
|If a or b is not 0, the output is 1. Otherwise 0.
|-
|-
Line 601: Line 798:
|0x9c
|0x9c
|a b
|a b
|out
|Boolean
|Returns 1 if the numbers are equal, 0 otherwise.
|Returns 1 if the numbers are equal, 0 otherwise.
|-
|-
Line 608: Line 805:
|0x9d
|0x9d
|a b
|a b
|out
|Nothing / False
|Same as OP_NUMEQUAL, but runs OP_VERIFY afterward.
|Same as OP_NUMEQUAL, but runs OP_VERIFY afterward.
|-
|-
Line 615: Line 812:
|0x9e
|0x9e
|a b
|a b
|out
|Boolean
|Returns 1 if the numbers are not equal, 0 otherwise.
|Returns 1 if the numbers are not equal, 0 otherwise.
|-
|-
Line 622: Line 819:
|0x9f
|0x9f
|a b
|a b
|out
|Boolean
|Returns 1 if a is less than b, 0 otherwise.
|Returns 1 if a is less than b, 0 otherwise.
|-
|-
Line 629: Line 826:
|0xa0
|0xa0
|a b
|a b
|out
|Boolean
|Returns 1 if a is greater than b, 0 otherwise.
|Returns 1 if a is greater than b, 0 otherwise.
|-
|-
Line 636: Line 833:
|0xa1
|0xa1
|a b
|a b
|out
|Boolean
|Returns 1 if a is less than or equal to b, 0 otherwise.
|Returns 1 if a is less than or equal to b, 0 otherwise.
|-
|-
Line 643: Line 840:
|0xa2
|0xa2
|a b
|a b
|out
|Boolean
|Returns 1 if a is greater than or equal to b, 0 otherwise.
|Returns 1 if a is greater than or equal to b, 0 otherwise.
|-
|-
Line 650: Line 847:
|0xa3
|0xa3
|a b
|a b
|out
|a / b
|Returns the smaller of a and b.
|Returns the smaller of a and b.
|-
|-
Line 657: Line 854:
|0xa4
|0xa4
|a b
|a b
|out
| a / b
|Returns the larger of a and b.
|Returns the larger of a and b.
|-
|-
Line 664: Line 861:
|0xa5
|0xa5
|x min max
|x min max
|out
|Boolean
|Returns 1 if x is within the specified range (left-inclusive), 0 otherwise.
|Returns 1 if x is within the specified range (left-inclusive) , 0 otherwise. min may be greater than max
|}
|}


Line 682: Line 879:
|166
|166
|0xa6
|0xa6
|in
|x
|hash
|hash20
|The input is hashed using RIPEMD-160.
|The input is hashed using RIPEMD-160.
|-
|-
Line 689: Line 886:
|167
|167
|0xa7
|0xa7
|in
|x
|hash
|hash20
|The input is hashed using SHA-1.
|The input is hashed using SHA-1.
|-
|-
Line 696: Line 893:
|168
|168
|0xa8
|0xa8
|in
|x
|hash
|hash32
|The input is hashed using SHA-256.
|The input is hashed using SHA-256.
|-
|-
Line 703: Line 900:
|169
|169
|0xa9
|0xa9
|in
|x
|hash
|hash20
|The input is hashed twice: first with SHA-256 and then with RIPEMD-160.
|The input is hashed twice: first with SHA-256 and then with RIPEMD-160.
|-
|-
Line 710: Line 907:
|170
|170
|0xaa
|0xaa
|in
|x
|hash
|hash32
|The input is hashed two times with SHA-256.
|The input is hashed two times with SHA-256.
|-
|-
Line 719: Line 916:
|Nothing
|Nothing
|Nothing
|Nothing
|All of the signature checking words will only match signatures to the data after the most recently-executed OP_CODESEPARATOR.
|All of the signature checking opcodes will only match signatures to the data after the most recently-executed OP_CODESEPARATOR.
|-
|-
|[[OP_CHECKSIG]]
|[[OP_CHECKSIG]]
Line 725: Line 922:
|0xac
|0xac
|sig pubkey
|sig pubkey
|True / false
|Boolean
|The entire transaction's outputs, inputs, and script (from the most recently-executed OP_CODESEPARATOR to the end) are hashed. The signature used by OP_CHECKSIG must be a valid signature for this hash and public key. If it is, 1 is returned, 0 otherwise.
|The entire transaction's outputs, inputs, and script (from the most recently-executed OP_CODESEPARATOR to the end) are hashed. The signature used by OP_CHECKSIG must be a valid signature for a further, extern specified hash and the given public key. If it is, 1 is returned, 0 otherwise.
|-
|-
|OP_CHECKSIGVERIFY
|OP_CHECKSIGVERIFY
Line 732: Line 929:
|0xad
|0xad
|sig pubkey
|sig pubkey
|True / false
|Nothing / False
|Same as OP_CHECKSIG, but OP_VERIFY is executed afterward.
|Same as OP_CHECKSIG, but OP_VERIFY is executed afterward.
|-
|-
Line 738: Line 935:
|174
|174
|0xae
|0xae
|x sig1 sig2 ... <number of signatures> pub1 pub2 <number of public keys>
|sig1 sig2 ... <number of signatures> pub1 pub2 <number of public keys>
|True / False
|Boolean
|For each signature and public key pair, OP_CHECKSIG is executed. If more public keys than signatures are listed, some key/sig pairs can fail. All signatures need to match a public key. If all signatures are valid, 1 is returned, 0 otherwise. Due to a bug, one extra unused value is removed from the stack.
|For each signature and public key pair, OP_CHECKSIG is executed. If more public keys than signatures are listed, some key/sig pairs can fail. All signatures need to match a public key. If all signatures are valid, 1 is returned, 0 otherwise. Due to a bug, one extra unused value is removed from the stack.
|-
|-
Line 745: Line 942:
|175
|175
|0xaf
|0xaf
|x sig1 sig2 ... <number of signatures> pub1 pub2 ... <number of public keys>
|sig1 sig2 ... <number of signatures> pub1 pub2 ... <number of public keys>
|True / False
|Nothing / False
|Same as OP_CHECKMULTISIG, but OP_VERIFY is executed afterward.
|Same as OP_CHECKMULTISIG, but OP_VERIFY is executed afterward.
|}
|}


===Pseudo-words===
=== Transparent opcodes ===
These words are used internally for assisting with transaction matching. They are invalid if used in actual scripts.
{| class="wikitable"
|-
!Nemonic
!Decimal
!Hex
!Description
|-
|OP_NOP1-OP_NOP10
|176-185
|0xb0-0xb9
|The opcode has no effect.
|}
 
===Pseudo-opcodes===
These nemonics are used internally for assisting with transaction matching. They are invalid if used in actual scripts.
{| class="wikitable"  
{| class="wikitable"  
|-
|-
Line 775: Line 986:
|}
|}


=== Reserved words ===
=== Reserved opcodes ===
Any opcode not assigned is also reserved. Using an unassigned opcode makes the transaction invalid.


{| class="wikitable"  
{| class="wikitable"  
Line 783: Line 993:
!Decimal
!Decimal
!Hex
!Hex
!When used...
!Description
|-
|-
|OP_RESERVED
|OP_RESERVED
Line 814: Line 1,024:
|0x8a
|0x8a
|Transaction is invalid unless occuring in an unexecuted OP_IF branch
|Transaction is invalid unless occuring in an unexecuted OP_IF branch
|}
Each opcode not assigned (currently also every opcode value > 185) is also reserved. Using an unassigned opcode makes the transaction invalid.
== script validation conditions ==
A script is considered invalid, if any of these conditions meets:<br>
<ul>
<li>the total size of the script exceeds (currently) 10000 bytes
<li>there are more than (currently) 201 opcodes of opcode value > 0x60 in the script
<li>each instruction is (currently) limited to maximal 520 bytes. This effects only the opcodes OP_PUSHDATA2 and OP_PUSHDATA4
<li>the executed opcode of the script has insufficient input (from stack, from script or from anywhere)
<li>the opcode is not defined (for execution) - indicated by white or light gray background color in the table
<li>the opcode is disabled (currently 15 opcodes) - indicated by white fontcolor in the above table
<li>stack overflow occurs during execution of the opcode (currently the number of items on the stack and on the alternate stack is limited to 1000)
<li>the opcodes OP_VERIF and OP_NOTVERIF invalidate a script which contains this opcode (even if this opcode is not executed!)
<li>the opcodes OP_ELSE or OP_ENDIF has no matching OP_IF<br>
<li>the script execution has been finished but there is (at least) an unmatched OP_IF<br>
<li>the opcodes OP_VERIFY, OP_EQUALVERIFY, OP_NUMEQUALVERIFY, OP_CHECKSIGVERIFY and OP_CHECKMULTISIGVERIFY invalidate the script if the stack-top item is false
<li>the execution of OP_RETURN
<!--li>alt stack overflow occurs (only possible during execution of OP_TOALTSTACK)-->
<li>the numerical value of the top-stack item is negative or greater than the number of items - 2 on the stack if OP_PICK or OP_ROLL shall be executed
<li>(the 2nd argument of OP_WITHIN is numerical greater than the top-stack item)
<li>an item used as pubkey or signature for each of the opcodes OP_CHECKSIG, OP_CHECKSIGVERIFY, OP_CHECKMULTISIG or  OP_CHECKMULTISIGVERIFY can be neither a pubkey or signature (for the given hash)
<li>the number of signature items or the number of public key items on the stack is negative for OP_CHECKMULTISIG or  OP_CHECKMULTISIGVERIFY
<li>there or more signatures items than public key items on the stack for OP_CHECKMULTISIG or  OP_CHECKMULTISIGVERIFY
<li>there are (currently) more than 20 public key items on the stack for OP_CHECKMULTISIG or CHECKMULTISIGVERIFY
<li>the script execution has been finished and the stack is empty or the top-stack item is false (numerical value 0)
</ul>
else the script is considered to be valid.<ref>http://sourceforge.net/projects/bitcoin/files/Bitcoin/bitcoin-0.7.1/bitcoin-0.7.1-linux.tar.gz</ref>
==References==
<references />
http://sourceforge.net/projects/bitcoin/files/Bitcoin/bitcoin-0.7.1/ | bitcoin-clinet version 0.7.1 source-file src/src/script.cpp
= [[Blocks|block]] =
==block structure==
{| class="wikitable"
|-
! Field
! Description
! Size
|-
|-
|OP_NOP1-OP_NOP10
|Magic no
|176-185
|value always 0xD9B4BEF9
|0xb0-0xb9
|4 bytes
|The word is ignored.
|-
|Blocksize
|number of bytes following up to end of block
|4 bytes
|-
|Blockheader
|[[Block hashing algorithm| consists of 6 items]]
|80 bytes
|-
|Transaction counter
| positive integer
| 1 - 9 bytes
|-
|transactions
|the (non empty) list of transactions
|<Transaction counter>-many transactions
|}
 
=[[Transaction]]=
{| class="wikitable"
|-
! Field
! Description
! Size
|-
|Version no
|currently 1
|4 bytes
|-
|In-counter
| positive integer
| 1 - 9 bytes
|-
|list of inputs
|the first input is also called "coinbase" and its content was ignored in earlier times
|<in-counter>-many inputs
|-
|Out-counter
| positive integer
| 1 - 9 bytes
|-
|list of outputs
|the first output contains the mined bitcoins for this block and possible transactions fees
|<out-counter>-many outputs
|-
|lock_time
|currently ignored
|4 bytes
|}
==Input of a transaction - Txin==
{| class="wikitable"
|-
! Field
! Description
! Size
|-
|Previous Tx-hash
| doubled SHA256-ed hash of a (previous) to-be-used transaction
|32 bytes
|-
|Previous Txout-index
| non negative integer indexing an output of the to-be-used transaction
|4 bytes
|-
|Txin-script length
|non negative integer
|1 - 9 bytes
|-
|Txin-script / scriptSig
|[[Script]]
|<in-script length>-many bytes
|-
|sequence_no
|currently ignored
|4 bytes
|}
 
==Output of a transaction - Txout==
{| class="wikitable"
|-
! Field
! Description
! Size
|-
|value
|non negative integer giving the number of [[FAQ#What_do_I_call_the_various_denominations_of_bitcoins.3F|BTC/10^8]] to be transfered
|8 bytes
|-
|Txout-script length
|non negative integer
|1 - 9 bytes
|-
|Txout-script / scriptPubKey
|[[Script]]
|<out-script length>-many bytes
|}
 
=[[Bitcoind]]=
==History of official bitcoind releases==
{| class="wikitable"
|-
! Version
! Date
! Supported platforms
! Reference
|-
| 0.7.2
| 2012-Dec-14
| Windows32 / Linux / MacOS X
| <ref>[https://bitcointalk.org/index.php?topic=130819.msg1399721#msg1399721 Bitcoin-Qt/bitcoind version 0.7.2 released]</ref>
|-
| 0.7.1
| 2012-Oct-19
| Windows32 / Linux / MacOS X
| <ref>[https://bitcointalk.org/index.php?topic=119277.msg1283232#msg1283232 Bitcoin-Qt/bitcoind version 0.7.1 released]</ref>
|-
| 0.7.0
| 2012-Sep-17
| Windows32 / Linux / MacOS X
| <ref>[https://bitcointalk.org/index.php?topic=110243.msg1199467 Bitcoin-Qt/bitcoind version 0.7.0 released]</ref>
|-
| 0.6.3
| 2012-Jun-25
| Windows32 / Linux / MacOS X
| <ref>[https://bitcointalk.org/index.php?topic=89877.msg989356#msg989356 Bitcoin-Qt / bitcoind version 0.6.3 released]</ref>
|-
| 0.6.2
| 2012-May-08
| Windows32 / Linux / MacOS X
|<ref>[https://bitcointalk.org/index.php?topic=78829.msg888578#msg888578 Re: Version 0.6.1 release candidate 2]</ref>
|-
| 0.6.1
| 2012-May-04
| Windows32 / Linux / MacOS X
|
|-
| 0.6.0
| 2012-Mar-30
| Windows32 / Linux / MacOS X
| <ref>[http://www.bitcoinforum.com/bitcoin-discussion/bitcoin-org-bitcoin-version-0-6-0-released/ bitcoin.org: Bitcoin version 0.6.0 released]</ref>
|-
| 0.5.3.1
| 2012-Mar-17
| Windows32
| <ref>[https://bitcointalk.org/index.php?topic=69120.0 URGENT: Windows Bitcoin-Qt update]</ref>
|-
| 0.5.3
| 2012-Mar-14
| Windows32 / Linux / MacOS X
| <ref>[https://bitcointalk.org/index.php?topic=68895.0 Bitcoin-Qt, bitcoind version 0.5.3 released]</ref>
|-
| 0.5.2
| 2012-Jan-09
| Windows32 / Linux / MacOS X
| <ref>[https://bitcointalk.org/index.php?topic=60146.0 Bitcoin-Qt, bitcoind version 0.5.2 released]</ref>
|-
| 0.5.1
| 2011-Dec-15
| Windows32 / Linux / MacOS X
| <ref>[https://bitcointalk.org/index.php?topic=54717.0 Bitcoin-Qt, bitcoind version 0.5.1 released]</ref>
|-
| 0.5.0
| 2011-Nov-21
| Windows32 / Linux / MacOS X
| <ref>[https://bitcointalk.org/index.php?topic=52480.0 Bitcoin-Qt/bitcoind version 0.5.0]</ref>
|-
| 0.4.0
| 2011-Sep-23
| Windows32 / Linux / MacOS X
| <ref>[https://bitcointalk.org/index.php?topic=45410.0 Bitcoin version 0.4.0 released]</ref>
|-
| 0.3.24
| 2011-Jul-08
| Windows32 / Linux / MacOS X
| <ref>[http://forum.bitcoin.org/index.php?topic=27187.0 Bitcoin version 0.3.24 released]</ref>
|-
| 0.3.23
| 2011-Jun-13
| Windows32 / Linux / MacOS X
| <ref>[http://forum.bitcoin.org/index.php?topic=16553.0 Bitcoin version 0.3.23 released]</ref>
|-
| 0.3.22
| 2011-Jun-05
| Windows32 / Linux / MacOS X
| <ref>[http://forum.bitcoin.org/index.php?topic=12269.0 Bitcoin version 0.3.22]</ref>
|-
| 0.3.21
| 2011-Apr-27
| Windows32 / Linux / MacOS X
| <ref>[http://bitcointalk.org/?topic=6642.0 Bitcoin version 0.3.21]</ref>
|-
| 0.3.20
| 2011-Feb-21
| Windows32 / Linux / MacOS X
| <ref>[http://www.bitcoin.org/smf/index.php?topic=3704.0 Version 0.3.20]</ref>
|-
|0.3.19
|2010-12-12
|Windows32 / Linux / MacOS X
|<ref>[https://bitcointalk.org/index.php?topic=2228.msg29479#msg29479 Added some DoS limits, removed safe mode (0.3.19)]</ref>
|-
|0.3.18
|2010-12-08
|Windows32 / Linux / MacOS X
|<ref>[https://bitcointalk.org/index.php?topic=2162.0 Version 0.3.18]</ref>
|-
|0.3.17
|2010-11-25
|Windows32 / Linux / MacOS X
|<ref>[https://bitcointalk.org/index.php?topic=1946.0 Version 0.3.17]</ref>
|-
|0.3.15
|2010-11-13
|Windows32 / Linux
|<ref>[https://bitcointalk.org/index.php?topic=1780.0 Version 0.3.15]</ref>
|-
|0.3.14
|2010-10-21
|Windows32 / Linux
|<ref>[https://bitcointalk.org/index.php?topic=1528.0 Version 0.3.14]</ref>
|-
|0.3.13
|2010-10-01
|Windows32 / Linux / MacOS X
|<ref>[https://bitcointalk.org/index.php?topic=1327.0 Version 0.3.13, please upgrade]</ref>
|-
|0.3.12
|2010-09-07
|Windows32 / Linux
|<ref>[https://bitcointalk.org/index.php?topic=999.0 Version 0.3.12 is now available.]</ref>
|-
|0.3.11
|2010-08-27
|Windows32 / Linux / MacOS X
|<ref>[https://bitcointalk.org/index.php?topic=941.0 Version 0.3.11 is now available.]</ref>
|-
|0.3.10
|2010-08-15
|Windows32 / Linux32/64 / MacOS X
|<ref>[https://bitcointalk.org/index.php?topic=820.msg9452#msg9452 tcatm's 4-way SSE2 for Linux 32/64-bit is in 0.3.10]</ref>
|-
|0.3.8.1
|2010-08-09
|Linux64
|<ref>[https://bitcointalk.org/index.php?topic=765.0 Version 0.3.8.1 update for Linux 64-bit]</ref>
|-
|0.3.8
|2010-08-03
|Windows32 / Linux / MacOS X
|<ref>[https://bitcointalk.org/index.php?topic=696.0 Please upgrade to 0.3.8!]</ref>
|-
|0.3.7
|2010-08-01
|Windows32 / Linux / MacOS X
|
|-
|0.3.6
|2010-07-29
|Windows32 / Linux / MacOS X
|<ref>[https://bitcointalk.org/index.php?topic=626.0 *** ALERT *** Upgrade to 0.3.6]</ref>
|-
|0.3.3
|2010-07-25
|Windows32 / Linux / MacOS X
| <ref>[https://bitcointalk.org/index.php?topic=570.0 Bitcoin 0.3.3 released -- PLEASE UPGRADE]</ref>
|-
|0.3.2.5
|2010-07-24
|Windows32 / Linux
| <ref>[https://bitcointalk.org/index.php?topic=556.0 Version 0.3.2.5 -- please test!]</ref>
|-
|0.3.2
|2010-07-17
|Windows32 / Linux / MacOS X
| <ref>[https://bitcointalk.org/index.php?topic=437.0 Bitcoin 0.3.2 released]</ref>
|-
|0.3.1
|2010-07-15
|Windows32 / Linux
|<ref>[https://bitcointalk.org/index.php?topic=383.0 Bitcoin 0.3.1 released]</ref>
|-
|0.3.0
|2010-07-06
|Windows32 / Linux / MacOS X
|<ref>[https://bitcointalk.org/index.php?topic=238.0 Bitcoin 0.3 released!]</ref>
|-
|0.2.0
|2009-12-17
| Windows32 / Linux
|<ref>[https://bitcointalk.org/index.php?topic=16.0 Bitcoin 0.2 released!]</ref>
|-
|0.1.5
|2009-02-04
|Windows32
|
|-
|0.1.3
|2009-01-13
|Windows32
|
|-
|0.1.2
|2009-01-12
|Windows32
|
|-
|0.1.0
|2009-01-09
|Windows32
|
|}
|}
==References==
<references/>

Latest revision as of 20:04, 5 January 2013

Dear User, Please write new Topics only at the end of this page! Thank you.

script

opcode overview

For each opcode is given: its nemonic without the leading OP_, its hexadecimal byte value, the number of stack items needed (poped) during execution, the number of stack items pushed (after execution). A * after the needed stack items indicates that further bytes from the script following the current opcode are needed. A # indicates that items on the alternative stack are poped/pushed. A @ indicates that further (global) data from transcations is needed.
Different colors indicate different semantic execution groups of opcodes.

_FALSE
0x00
0 ; 1(0)
-
0x01
0 *; 1(1)
-
0x02
0 *; 1(2)
-
0x03
0 *; 1(3)
-
0x04
0 *; 1(4)
-
0x04
0 *; 1(5)
-
0x06
0 *; 1(6)
-
0x07
0 *; 1(7)
-
0x08
0 *; 1(8)
-
0x09
0 *; 1(9)
-
0x0a
0 *; 1(10)
-
0x0b
0 *; 1(11)
-
0x0c
0 *; 1(12)
-
0x0d
0 *; 1(13)
-
0x0e
0 *; 1(14)
-
0x0f
0 *; 1(15)
-
0x10
0 *; 1(16)
-
0x11
0 *; 1(17)
-
0x12
0 *; 1(18)
-
0x13
0 *; 1(19)
-
0x14
0 *; 1(20)
-
0x15
0 *; 1(21)
-
0x16
0 *; 1(22)
-
0x17
0 *; 1(23)
-
0x18
0 *; 1(24)
-
0x19
0 *; 1(25)
-
0x1a
0 *; 1(26)
-
0x1b
0 *; 1(27)
-
0x1c
0 *; 1(28)
-
0x1d
0 *; 1(29)
-
0x1e
0 *; 1(30)
-
0x1f
0 *; 1(31)
-
0x20
0 *; 1(32)
-
0x21
0 *; 1(33)
-
0x22
0 *; 1(34)
-
0x23
0 *; 1(35)
-
0x24
0 *; 1(36)
-
0x25
0 *; 1(37)
-
0x26
0 *; 1(38)
-
0x27
0 *; 1(39)
-
0x28
0 *; 1(40)
-
0x29
0 *; 1(41)
-
0x2a
0 *; 1(42)
-
0x2b
0 *; 1(43)
-
0x2c
0 *; 1(44)
-
0x2d
0 *; 1(45)
-
0x2e
0 *; 1(46)
-
0x2f
0 *; 1(47)
-
0x30
0 *; 1(48)
-
0x31
0 *; 1(49)
-
0x32
0 *; 1(50)
-
0x33
0 *; 1(51)
-
0x34
0 *; 1(52)
-
0x35
0 *; 1(53)
-
0x36
0 *; 1(54)
-
0x37
0 *; 1(55)
-
0x38
0 *; 1(56)
-
0x39
0 *; 1(57)
-
0x3a
0 *; 1(58)
-
0x3b
0 *; 1(59)
-
0x3c
0 *; 1(60)
-
0x3d
0 *; 1(61)
-
0x3e
0 *; 1(62)
-
0x3f
0 *; 1(63)
-
0x40
0 *; 1(64)
-
0x41
0 *; 1(65)
-
0x42
0 *; 1(66)
-
0x43
0 *; 1(67)
-
0x44
0 *; 1(68)
-
0x45
0 *; 1(69)
-
0x46
0 *; 1(70)
-
0x47
0 *; 1(71)
-
0x48
0 *; 1(72)
-
0x49
0 *; 1(73)
-
0x4a
0 *; 1(74)
-
0x4b
0 *; 1(75)
_PUSHDATA1
0x4c
0 *; 1(0 - 255)
_PUSHDATA2
0x4d
0 *; 1(0 - 2^16-1)
_PUSHDATA4
0x4e
0 *; 1(0 - 2^32-1)
_1NEGATE
0x4f
0 ; 1(1)
_RESERVED
0x50
_1
0x51
0 ; 1(1)
_2
0x52
0 ; 1(1)
_3
0x53
0 ; 1(1)
_4
0x54
0 ; 1(1)
_5
0x55
0 ; 1(1)
_6
0x56
0 ; 1(1)
_7
0x57
0 ; 1(1)
_8
0x58
0 ; 1(1)
_9
0x59
0 ; 1(1)
_10
0x5a
0 ; 1(1)
_11
0x5b
0 ; 1(1)
_12
0x5c
0 ; 1(1)
_13
0x5d
0 ; 1(1)
_14
0x5e
0 ; 1(1)
_15
0x5f
0 ; 1(1)
_16
0x60
0 ; 1(1)
_NOP
0x61
0 ; 0
_VER
0x62
_IF
0x63
1 ; 0
_NOTIF
0x64
1 ; 0
_VERIF
0x65
_VERNOTIF
0x66
_ELSE
0x67
0 ; 0
_ENDIF
0x68
0 ; 0
_VERIFY
0x69
1 ; 0/1
_RETURN
0x6a
0 ; 0
_TOALTSTACK
0x6b
1 ; 0
_FROMALTSTACK
0x6c
0 #; 1
_2DROP
0x6d
2 ; 0
_2DUP
0x6e
2 ; 4
_3DUP
0x6f
3 ; 6
_2OVER
0x70
4 ; 6
_2ROT
0x71
6 ; 6
_2SWAP
0x72
4 ; 4
_IFDUP
0x73
1 ; 1/2
_DEPTH
0x74
0 ; 1
_DROP
0x75
1 ; 0
_DUP
0x76
1 ; 2
_NIP
0x77
2 ; 1
_OVER
0x78
2 ; 3
_PICK
0x79
1+n+1 ; n+2
_ROLL
0x7a
1+n+1 ; n+1
_ROT
0x7b
3 ; 3
_SWAP
0x7c
2 ; 2
_TUCK
0x7d
2 ; 3
_CAT
0x7e
2 ; 1
_SUBSTR
0x7f
3 ; 1
_LEFT
0x80
2 ; 1
_RIGHT
0x81
2 ; 1
_SIZE
0x82
1 ; 2
_INVERT
0x83
1 ; 1
_AND
0x84
2 ; 1
_OR
0x85
2 ; 1
_XOR
0x86
2 ; 1
_EQUAL
0x87
2 ; 1
_EQUALVERIFY
0x88
2 ; 0/1
_RESERVED1
0x89
_RESERVED2
0x8a
_1ADD
0x8b
1 ; 1
_1SUB
0x8c
1 ; 1
_2MUL
0x8d
1 ; 1
_2DIV
0x8e
1 ; 1
_NEGATE
0x8f
1 ; 1
_ABS
0x90
1 ; 1
_NOT
0x91
1 ; 1
_0NOTEQUAL
0x92
1 ; 1
_ADD
0x93
2 ; 1
_SUB
0x94
2 ; 1
_MUL
0x95
2 ; 1
_DIV
0x96
2 ; 1
_MOD
0x97
2 ; 1
_LSHIFT
0x98
2 ; 1
_RSHIFT
0x99
2 ; 1
_BOOLAND
0x9a
2 ; 1
_BOOLOR
0x9b
2 ; 1
_NUMEQUAL
0x9c
2 ; 1
_NUMEQUALVERIFY
0x9d
2 ; 0/1
_NUMNOTEQUAL
0x9e
2 ; 1
_LESSTHAN
0x9f
2 ; 1
_GREATERTHAN
0xa0
2 ; 1
_LESSTHANOREQUAL
0xa1
2 ; 1
_GREATERTHANOREQUAL
0xa2
2 ; 1
_MIN
0xa3
2 ; 1
_MAX
0xa4
2 ; 1
_WITHIN
0xa5
3 ; 1
_RIPEMD160
0xa6
1 ; 1
_SHA1
0xa7
1 ; 1
_SHA256
0xa8
1 ; 1
_HASH160
0xa9
1 ; 1
_HASH256
0xaa
1 ; 1
_CODESEPARATOR
0xab
0 ; 0
_CHECKSIG
0xac
2 @; 1
_CHECKSIGVERIFY
0xad
2 @; 0/1
_CHECKMULTISIG
0xae
2n+2 @; 1
_CHECKMULTISIGVERIFY
0xaf
2n+2 @; 0/1
_NOP1
0xb0
0 ; 0
_NOP2
0xb1
0 ; 0
_NOP3
0xb2
0 ; 0
_NOP4
0xb3
0 ; 0
_NOP5
0xb4
0 ; 0
_NOP6
0xb5
0 ; 0
_NOP7
0xb6
0 ; 0
_NOP8
0xb7
0 ; 0
_NOP9
0xb8
0 ; 0
_NOP10
0xb9
0 ; 0
-
0xba
-
0xbb
-
0xbc
-
0xbd
-
0xbe
-
0xbf
-
0xc0
-
0xc1
-
0xc2
-
0xc3
-
0xc4
-
0xc5
-
0xc6
-
0xc7
-
0xc8
-
0xc9
-
0xca
-
0xcb
-
0xcc
-
0xcd
-
0xce
-
0xcf
-
0xd0
-
0xd1
-
0xd2
-
0xd3
-
0xd4
-
0xd5
-
0xd6
-
0xd7
-
0xd8
-
0xd9
-
0xda
-
0xdb
-
0xdc
-
0xdd
-
0xde
-
0xdf
-
0xe0
-
0xe1
-
0xe2
-
0xe3
-
0xe4
-
0xe5
-
0xe6
-
0xe7
-
0xe8
-
0xe9
-
0xea
-
0xeb
-
0xec
-
0xed
-
0xee
-
0xef
-
0xf0
-
0xf1
-
0xf2
-
0xf3
-
0xf4
-
0xf5
-
0xf6
-
0xf7
-
0xf8
-
0xf9
-
0xfa
_SMALLINTEGER
0xfb
_PUBKEYS
0xfc
_PUBKEYHASH
0xfd
_PUBKEY
0xfe
_INVALIDOPCODE
0xff

The opcode value 0x00 with nemonic OP_FALSE is also named OP_0 and the opcode value 0x51 with nemonic OP_1 as also named OP_TRUE.

opcode descriptions

It follows for each opcode less than decimal 185 (hexa 0xba) a description for its usage. The columns entiteld nemonic, decimal and Hex should be evident. The column input gives the needed items of the stack (and the alternate stack) and the column output indicates the resulting items on the stack (and the alternate stack). The naming of the entries in these two columns is chosen to reflect their interpretation. x,x0,x1,... means arbitrary or no interpretation, a, b and c as a signed integer value, n,index,size and depth non-negative integer values, Boolean as either a true or false.
Some of the more complicated opcodes are disabled out of concern that the client might have (and has) a bug in the current implementation due to the historically not as 2-complement interpretations of the byte vectors as numerical values (the most significant byte holds the sign of the byte vectors).

Constants

Nemonic Decimal Hex Input Output Description
OP_FALSE, OP_0 0 0x00 Nothing Empty string A byte vector of length 0 is pushed onto the stack. (Thus, it is not a no-op!)
(no official nemonics) 1 - 75 0x01 - 0x4b (operands) x The next <opcode>-many bytes are to be pushed onto the stack.
OP_PUSHDATA1 76 0x4c (operands) x The next byte contains the number of bytes to be pushed onto the stack which follow this byte.
OP_PUSHDATA2 77 0x4d (operands) x The next two bytes contain the number of bytes to be pushed onto the stack which follow theses 2 bytes.
OP_PUSHDATA4 78 0x4e (operands) x The next four bytes contain the number of bytes to be pushed onto the stack which follow theses 4 bytes.
OP_1NEGATE 79 0x4f Nothing -1 The number -1 is pushed onto the stack.
OP_1, OP_TRUE 81 0x51 Nothing 1 The number 1 is pushed onto the stack.
OP_2 - OP_16 82 - 96 0x52 - 0x60 Nothing 2-16 The value <opcode>-80 (thus, one of 2 - 16) is pushed onto the stack.

Flow control

Nemonic Decimal Hex Input Output Description
OP_NOP 97 0x61 Nothing Nothing Does nothing.
OP_IF 99 0x63 Boolean Nothing If the top stack value is not 0, the statements are executed. The top stack value is removed. Lead in a logcial <value> then [statements] [else [statements]] endif expression
OP_NOTIF 100 0x64 Boolean Nothing If the top stack value is 0, the statements are executed. The top stack value is removed. Lead in a logcial <value> then [statements] [else [statements]] endif expression
OP_ELSE 103 0x67 Nothing Nothing If the preceding OP_IF or OP_NOTIF or OP_ELSE was not executed then these statements are and if the preceding OP_IF or OP_NOTIF or OP_ELSE was executed then these statements are not.
OP_ENDIF 104 0x68 Nothing Nothing Ends a logcial If <value> then [statements] [else [statements]] expression
OP_VERIFY 105 0x69 Boolean Nothing / False If top stack value is not true then marks transaction as invalid . A value true is removed, but false is not.
OP_RETURN 106 0x6a Nothing Nothing Marks transaction as invalid.

Stack

Nemonic Decimal Hex Input Output Description
OP_TOALTSTACK 107 0x6b x1 (alt) (alt x1) Puts the input onto the top of the alt stack. Removes it from the (main) stack.
OP_FROMALTSTACK 108 0x6c (alt x1) x1 (alt) Puts the input onto the top of the (main) stack. Removes it from the alt stack.
OP_2DROP 109 0x6d x1 x2 Nothing Removes the top two stack items.
OP_2DUP 110 0x6e x1 x2 x1 x2 x1 x2 Duplicates the top two stack items.
OP_3DUP 111 0x6f x1 x2 x3 x1 x2 x3 x1 x2 x3 Duplicates the top three stack items.
OP_2OVER 112 0x70 x1 x2 x3 x4 x1 x2 x3 x4 x1 x2 Copies the pair of items two spaces back in the stack to the front.
OP_2ROT 113 0x71 x1 x2 x3 x4 x5 x6 x3 x4 x5 x6 x1 x2 The fifth and sixth items back are moved to the top of the stack.
OP_2SWAP 114 0x72 x1 x2 x3 x4 x3 x4 x1 x2 Swaps the top two pairs of items.
OP_IFDUP 115 0x73 x x / x x If the top stack value is not 0, duplicate it.
OP_DEPTH 116 0x74 Nothing depth Puts the number of stack items onto the stack as one little-endian coded byte-vector
OP_DROP 117 0x75 x Nothing Removes the top stack item.
OP_DUP 118 0x76 x x x Duplicates the top stack item.
OP_NIP 119 0x77 x1 x2 x2 Removes the second-to-top stack item.
OP_OVER 120 0x78 x1 x2 x1 x2 x1 Copies the second-to-top stack item to the top.
OP_PICK 121 0x79 xn ... x2 x1 x0 <n> xn ... x2 x1 x0 xn The item n back in the stack is copied to the top.
OP_ROLL 122 0x7a xn ... x2 x1 x0 <n> ... x2 x1 x0 xn The item n back in the stack is moved to the top.
OP_ROT 123 0x7b x1 x2 x3 x2 x3 x1 The top three items on the stack are rotated to the left.
OP_SWAP 124 0x7c x1 x2 x2 x1 The top two items on the stack are swapped.
OP_TUCK 125 0x7d x1 x2 x2 x1 x2 The item at the top of the stack is copied and inserted before the second-to-top item.

Splice

Nemonic Decimal Hex Input Output Description
OP_CAT 126 0x7e x1 x2 out Concatenates two strings resp. byte vectors. Currently disabled.
OP_SUBSTR 127 0x7f x index size out Returns the section started at position <index> and of length <size> of a string resp. byte vector. Currently disabled.
OP_LEFT 128 0x80 x index out Keeps only characters left of the specified point in a string. Currently disabled.
OP_RIGHT 129 0x81 x index out Keeps only characters right of the specified point in a string. Currently disabled.
OP_SIZE 130 0x82 x x size Returns the length of the input string resp. byte vector resp. stack item.

Bitwise logic

Nemonic Decimal Hex Input Output Description
OP_INVERT 131 0x83 x1 x0 Flips all of the bits in the input. Currently disabled.
OP_AND 132 0x84 x1 x2 x0 Boolean and between each bit in the inputs. Currently disabled.
OP_OR 133 0x85 x1 x2 x0 Boolean or between each bit in the inputs. Currently disabled.
OP_XOR 134 0x86 x1 x2 x0 Boolean exclusive or between each bit in the inputs. Currently disabled.
OP_EQUAL 135 0x87 x1 x2 Boolean Returns 1 if the inputs are byte-wise equal, 0 otherwise.
OP_EQUALVERIFY 136 0x88 x1 x2 Nothing / false Same as OP_EQUAL, but runs OP_VERIFY afterward.

Arithmetic

(In very early versions, the implemented arithmetic opcodes were limited to maximal 4 byte vectors.)

Nemonic Decimal Hex Input Output Description
OP_1ADD 139 0x8b a c 1 is added to the input.
OP_1SUB 140 0x8c a c 1 is subtracted from the input.
OP_2MUL 141 0x8d a c The input is multiplied by 2. Currently disabled.
OP_2DIV 142 0x8e a c The input is divided by 2. Currently disabled.
OP_NEGATE 143 0x8f a c The sign of the input is flipped.
OP_ABS 144 0x90 a c The input is negative, its sign is flipped.
OP_NOT 145 0x91 a Boolean If the input is 0 or 1, it is flipped. Otherwise the output will be 0.
OP_0NOTEQUAL 146 0x92 a Boolean Returns 0 if the input is 0. 1 otherwise.
OP_ADD 147 0x93 a b c a is added to b.
OP_SUB 148 0x94 a b c b is subtracted from a.
OP_MUL 149 0x95 a b c a is multiplied by b. Currently disabled.
OP_DIV 150 0x96 a b c a is divided by b (b should be not 0). Currently disabled.
OP_MOD 151 0x97 a b c Returns the remainder after dividing a by b (b should be not 0). Currently disabled.
OP_LSHIFT 152 0x98 a b c Shifts a left by b bits, preserving sign. Currently disabled.
OP_RSHIFT 153 0x99 a b c Shifts a right by b bits, preserving sign. Currently disabled.
OP_BOOLAND 154 0x9a a b Boolean If both a and b are not 0, the output is 1. Otherwise 0.
OP_BOOLOR 155 0x9b a b Boolean If a or b is not 0, the output is 1. Otherwise 0.
OP_NUMEQUAL 156 0x9c a b Boolean Returns 1 if the numbers are equal, 0 otherwise.
OP_NUMEQUALVERIFY 157 0x9d a b Nothing / False Same as OP_NUMEQUAL, but runs OP_VERIFY afterward.
OP_NUMNOTEQUAL 158 0x9e a b Boolean Returns 1 if the numbers are not equal, 0 otherwise.
OP_LESSTHAN 159 0x9f a b Boolean Returns 1 if a is less than b, 0 otherwise.
OP_GREATERTHAN 160 0xa0 a b Boolean Returns 1 if a is greater than b, 0 otherwise.
OP_LESSTHANOREQUAL 161 0xa1 a b Boolean Returns 1 if a is less than or equal to b, 0 otherwise.
OP_GREATERTHANOREQUAL 162 0xa2 a b Boolean Returns 1 if a is greater than or equal to b, 0 otherwise.
OP_MIN 163 0xa3 a b a / b Returns the smaller of a and b.
OP_MAX 164 0xa4 a b a / b Returns the larger of a and b.
OP_WITHIN 165 0xa5 x min max Boolean Returns 1 if x is within the specified range (left-inclusive) , 0 otherwise. min may be greater than max

Crypto

Nemonic Decimal Hex Input Output Description
OP_RIPEMD160 166 0xa6 x hash20 The input is hashed using RIPEMD-160.
OP_SHA1 167 0xa7 x hash20 The input is hashed using SHA-1.
OP_SHA256 168 0xa8 x hash32 The input is hashed using SHA-256.
OP_HASH160 169 0xa9 x hash20 The input is hashed twice: first with SHA-256 and then with RIPEMD-160.
OP_HASH256 170 0xaa x hash32 The input is hashed two times with SHA-256.
OP_CODESEPARATOR 171 0xab Nothing Nothing All of the signature checking opcodes will only match signatures to the data after the most recently-executed OP_CODESEPARATOR.
OP_CHECKSIG 172 0xac sig pubkey Boolean The entire transaction's outputs, inputs, and script (from the most recently-executed OP_CODESEPARATOR to the end) are hashed. The signature used by OP_CHECKSIG must be a valid signature for a further, extern specified hash and the given public key. If it is, 1 is returned, 0 otherwise.
OP_CHECKSIGVERIFY 173 0xad sig pubkey Nothing / False Same as OP_CHECKSIG, but OP_VERIFY is executed afterward.
OP_CHECKMULTISIG 174 0xae sig1 sig2 ... <number of signatures> pub1 pub2 <number of public keys> Boolean For each signature and public key pair, OP_CHECKSIG is executed. If more public keys than signatures are listed, some key/sig pairs can fail. All signatures need to match a public key. If all signatures are valid, 1 is returned, 0 otherwise. Due to a bug, one extra unused value is removed from the stack.
OP_CHECKMULTISIGVERIFY 175 0xaf sig1 sig2 ... <number of signatures> pub1 pub2 ... <number of public keys> Nothing / False Same as OP_CHECKMULTISIG, but OP_VERIFY is executed afterward.

Transparent opcodes

Nemonic Decimal Hex Description
OP_NOP1-OP_NOP10 176-185 0xb0-0xb9 The opcode has no effect.

Pseudo-opcodes

These nemonics are used internally for assisting with transaction matching. They are invalid if used in actual scripts.

Nemonic Decimal Hex Description
OP_PUBKEYHASH 253 0xfd Represents a public key hashed with OP_HASH160.
OP_PUBKEY 254 0xfe Represents a public key compatible with OP_CHECKSIG.
OP_INVALIDOPCODE 255 0xff Matches any opcode that is not yet assigned.

Reserved opcodes

Nemonic Decimal Hex Description
OP_RESERVED 80 0x50 Transaction is invalid unless occuring in an unexecuted OP_IF branch
OP_VER 98 0x62 Transaction is invalid unless occuring in an unexecuted OP_IF branch
OP_VERIF 101 0x65 Transaction is invalid even when occuring in an unexecuted OP_IF branch
OP_VERNOTIF 102 0x66 Transaction is invalid even when occuring in an unexecuted OP_IF branch
OP_RESERVED1 137 0x89 Transaction is invalid unless occuring in an unexecuted OP_IF branch
OP_RESERVED2 138 0x8a Transaction is invalid unless occuring in an unexecuted OP_IF branch

Each opcode not assigned (currently also every opcode value > 185) is also reserved. Using an unassigned opcode makes the transaction invalid.

script validation conditions

A script is considered invalid, if any of these conditions meets:

  • the total size of the script exceeds (currently) 10000 bytes
  • there are more than (currently) 201 opcodes of opcode value > 0x60 in the script
  • each instruction is (currently) limited to maximal 520 bytes. This effects only the opcodes OP_PUSHDATA2 and OP_PUSHDATA4
  • the executed opcode of the script has insufficient input (from stack, from script or from anywhere)
  • the opcode is not defined (for execution) - indicated by white or light gray background color in the table
  • the opcode is disabled (currently 15 opcodes) - indicated by white fontcolor in the above table
  • stack overflow occurs during execution of the opcode (currently the number of items on the stack and on the alternate stack is limited to 1000)
  • the opcodes OP_VERIF and OP_NOTVERIF invalidate a script which contains this opcode (even if this opcode is not executed!)
  • the opcodes OP_ELSE or OP_ENDIF has no matching OP_IF
  • the script execution has been finished but there is (at least) an unmatched OP_IF
  • the opcodes OP_VERIFY, OP_EQUALVERIFY, OP_NUMEQUALVERIFY, OP_CHECKSIGVERIFY and OP_CHECKMULTISIGVERIFY invalidate the script if the stack-top item is false
  • the execution of OP_RETURN
  • the numerical value of the top-stack item is negative or greater than the number of items - 2 on the stack if OP_PICK or OP_ROLL shall be executed
  • (the 2nd argument of OP_WITHIN is numerical greater than the top-stack item)
  • an item used as pubkey or signature for each of the opcodes OP_CHECKSIG, OP_CHECKSIGVERIFY, OP_CHECKMULTISIG or OP_CHECKMULTISIGVERIFY can be neither a pubkey or signature (for the given hash)
  • the number of signature items or the number of public key items on the stack is negative for OP_CHECKMULTISIG or OP_CHECKMULTISIGVERIFY
  • there or more signatures items than public key items on the stack for OP_CHECKMULTISIG or OP_CHECKMULTISIGVERIFY
  • there are (currently) more than 20 public key items on the stack for OP_CHECKMULTISIG or CHECKMULTISIGVERIFY
  • the script execution has been finished and the stack is empty or the top-stack item is false (numerical value 0)

else the script is considered to be valid.[1]

References

http://sourceforge.net/projects/bitcoin/files/Bitcoin/bitcoin-0.7.1/ | bitcoin-clinet version 0.7.1 source-file src/src/script.cpp

block

block structure

Field Description Size
Magic no value always 0xD9B4BEF9 4 bytes
Blocksize number of bytes following up to end of block 4 bytes
Blockheader consists of 6 items 80 bytes
Transaction counter positive integer 1 - 9 bytes
transactions the (non empty) list of transactions <Transaction counter>-many transactions

Transaction

Field Description Size
Version no currently 1 4 bytes
In-counter positive integer 1 - 9 bytes
list of inputs the first input is also called "coinbase" and its content was ignored in earlier times <in-counter>-many inputs
Out-counter positive integer 1 - 9 bytes
list of outputs the first output contains the mined bitcoins for this block and possible transactions fees <out-counter>-many outputs
lock_time currently ignored 4 bytes

Input of a transaction - Txin

Field Description Size
Previous Tx-hash doubled SHA256-ed hash of a (previous) to-be-used transaction 32 bytes
Previous Txout-index non negative integer indexing an output of the to-be-used transaction 4 bytes
Txin-script length non negative integer 1 - 9 bytes
Txin-script / scriptSig Script <in-script length>-many bytes
sequence_no currently ignored 4 bytes

Output of a transaction - Txout

Field Description Size
value non negative integer giving the number of BTC/10^8 to be transfered 8 bytes
Txout-script length non negative integer 1 - 9 bytes
Txout-script / scriptPubKey Script <out-script length>-many bytes

Bitcoind

History of official bitcoind releases

Version Date Supported platforms Reference
0.7.2 2012-Dec-14 Windows32 / Linux / MacOS X [1]
0.7.1 2012-Oct-19 Windows32 / Linux / MacOS X [2]
0.7.0 2012-Sep-17 Windows32 / Linux / MacOS X [3]
0.6.3 2012-Jun-25 Windows32 / Linux / MacOS X [4]
0.6.2 2012-May-08 Windows32 / Linux / MacOS X [5]
0.6.1 2012-May-04 Windows32 / Linux / MacOS X
0.6.0 2012-Mar-30 Windows32 / Linux / MacOS X [6]
0.5.3.1 2012-Mar-17 Windows32 [7]
0.5.3 2012-Mar-14 Windows32 / Linux / MacOS X [8]
0.5.2 2012-Jan-09 Windows32 / Linux / MacOS X [9]
0.5.1 2011-Dec-15 Windows32 / Linux / MacOS X [10]
0.5.0 2011-Nov-21 Windows32 / Linux / MacOS X [11]
0.4.0 2011-Sep-23 Windows32 / Linux / MacOS X [12]
0.3.24 2011-Jul-08 Windows32 / Linux / MacOS X [13]
0.3.23 2011-Jun-13 Windows32 / Linux / MacOS X [14]
0.3.22 2011-Jun-05 Windows32 / Linux / MacOS X [15]
0.3.21 2011-Apr-27 Windows32 / Linux / MacOS X [16]
0.3.20 2011-Feb-21 Windows32 / Linux / MacOS X [17]
0.3.19 2010-12-12 Windows32 / Linux / MacOS X [18]
0.3.18 2010-12-08 Windows32 / Linux / MacOS X [19]
0.3.17 2010-11-25 Windows32 / Linux / MacOS X [20]
0.3.15 2010-11-13 Windows32 / Linux [21]
0.3.14 2010-10-21 Windows32 / Linux [22]
0.3.13 2010-10-01 Windows32 / Linux / MacOS X [23]
0.3.12 2010-09-07 Windows32 / Linux [24]
0.3.11 2010-08-27 Windows32 / Linux / MacOS X [25]
0.3.10 2010-08-15 Windows32 / Linux32/64 / MacOS X [26]
0.3.8.1 2010-08-09 Linux64 [27]
0.3.8 2010-08-03 Windows32 / Linux / MacOS X [28]
0.3.7 2010-08-01 Windows32 / Linux / MacOS X
0.3.6 2010-07-29 Windows32 / Linux / MacOS X [29]
0.3.3 2010-07-25 Windows32 / Linux / MacOS X [30]
0.3.2.5 2010-07-24 Windows32 / Linux [31]
0.3.2 2010-07-17 Windows32 / Linux / MacOS X [32]
0.3.1 2010-07-15 Windows32 / Linux [33]
0.3.0 2010-07-06 Windows32 / Linux / MacOS X [34]
0.2.0 2009-12-17 Windows32 / Linux [35]
0.1.5 2009-02-04 Windows32
0.1.3 2009-01-13 Windows32
0.1.2 2009-01-12 Windows32
0.1.0 2009-01-09 Windows32

References