forked from Foundation-Devices/passport-firmware
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopcodes.py
126 lines (125 loc) · 2.97 KB
/
opcodes.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# SPDX-FileCopyrightText: 2020 Foundation Devices, Inc. <[email protected]>
# SPDX-License-Identifier: GPL-3.0-or-later
#
# SPDX-FileCopyrightText: 2018 Coinkite, Inc. <coldcardwallet.com>
# SPDX-License-Identifier: GPL-3.0-only
#
# A very limited subset of the opcodes we might need
#
OP_0 = const(0)
OP_PUSHDATA1 = const(76)
OP_PUSHDATA2 = const(77)
OP_PUSHDATA4 = const(78)
OP_1NEGATE = const(79)
#OP_RESERVED = const(80)
OP_1 = const(81)
#OP_2 = const(82)
#OP_3 = const(83)
#OP_4 = const(84)
#OP_5 = const(85)
#OP_6 = const(86)
#OP_7 = const(87)
#OP_8 = const(88)
#OP_9 = const(89)
#OP_10 = const(90)
#OP_11 = const(91)
#OP_12 = const(92)
#OP_13 = const(93)
#OP_14 = const(94)
#OP_15 = const(95)
OP_16 = const(96)
#OP_NOP = const(97)
#OP_VER = const(98)
#OP_IF = const(99)
#OP_NOTIF = const(100)
#OP_VERIF = const(101)
#OP_VERNOTIF = const(102)
#OP_ELSE = const(103)
#OP_ENDIF = const(104)
#OP_VERIFY = const(105)
#OP_RETURN = const(106)
#OP_TOALTSTACK = const(107)
#OP_FROMALTSTACK = const(108)
#OP_2DROP = const(109)
#OP_2DUP = const(110)
#OP_3DUP = const(111)
#OP_2OVER = const(112)
#OP_2ROT = const(113)
#OP_2SWAP = const(114)
#OP_IFDUP = const(115)
#OP_DEPTH = const(116)
#OP_DROP = const(117)
#OP_DUP = const(118)
#OP_NIP = const(119)
#OP_OVER = const(120)
#OP_PICK = const(121)
#OP_ROLL = const(122)
#OP_ROT = const(123)
#OP_SWAP = const(124)
#OP_TUCK = const(125)
#OP_CAT = const(126)
#OP_SUBSTR = const(127)
#OP_LEFT = const(128)
#OP_RIGHT = const(129)
#OP_SIZE = const(130)
#OP_INVERT = const(131)
#OP_AND = const(132)
#OP_OR = const(133)
#OP_XOR = const(134)
#OP_EQUAL = const(135)
#OP_EQUALVERIFY = const(136)
#OP_RESERVED1 = const(137)
#OP_RESERVED2 = const(138)
#OP_1ADD = const(139)
#OP_1SUB = const(140)
#OP_2MUL = const(141)
#OP_2DIV = const(142)
#OP_NEGATE = const(143)
#OP_ABS = const(144)
#OP_NOT = const(145)
#OP_0NOTEQUAL = const(146)
#OP_ADD = const(147)
#OP_SUB = const(148)
#OP_MUL = const(149)
#OP_DIV = const(150)
#OP_MOD = const(151)
#OP_LSHIFT = const(152)
#OP_RSHIFT = const(153)
#OP_BOOLAND = const(154)
#OP_BOOLOR = const(155)
#OP_NUMEQUAL = const(156)
#OP_NUMEQUALVERIFY = const(157)
#OP_NUMNOTEQUAL = const(158)
#OP_LESSTHAN = const(159)
#OP_GREATERTHAN = const(160)
#OP_LESSTHANOREQUAL = const(161)
#OP_GREATERTHANOREQUAL = const(162)
#OP_MIN = const(163)
#OP_MAX = const(164)
#OP_WITHIN = const(165)
#OP_RIPEMD160 = const(166)
#OP_SHA1 = const(167)
#OP_SHA256 = const(168)
#OP_HASH160 = const(169)
#OP_HASH256 = const(170)
OP_CODESEPARATOR = const(171)
OP_CHECKSIG = const(172)
OP_CHECKSIGVERIFY = const(173)
OP_CHECKMULTISIG = const(174) # 0xAE
OP_CHECKMULTISIGVERIFY = const(175)
#OP_NOP1 = const(176)
#OP_NOP2 = const(177)
#OP_CHECKLOCKTIMEVERIFY = const(177)
#OP_NOP3 = const(178)
#OP_CHECKSEQUENCEVERIFY = const(178)
#OP_NOP4 = const(179)
#OP_NOP5 = const(180)
#OP_NOP6 = const(181)
#OP_NOP7 = const(182)
#OP_NOP8 = const(183)
#OP_NOP9 = const(184)
#OP_NOP10 = const(185)
#OP_NULLDATA = const(252)
#OP_PUBKEYHASH = const(253)
#OP_PUBKEY = const(254)
#OP_INVALIDOPCODE = const(255)