Bitcoin Core
31.1.0
P2P Digital Currency
Toggle main menu visibility
Loading...
Searching...
No Matches
src
script
script.cpp
Go to the documentation of this file.
1
// Copyright (c) 2009-2010 Satoshi Nakamoto
2
// Copyright (c) 2009-present The Bitcoin Core developers
3
// Distributed under the MIT software license, see the accompanying
4
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
5
6
#include <
script/script.h
>
7
8
#include <
crypto/common.h
>
9
#include <
crypto/hex_base.h
>
10
#include <hash.h>
11
#include <
uint256.h
>
12
#include <
util/hash_type.h
>
13
14
#include <string>
15
16
CScriptID::CScriptID
(
const
CScript
& in) :
BaseHash
(
Hash160
(in)) {}
17
18
std::string
GetOpName
(
opcodetype
opcode)
19
{
20
switch
(opcode)
21
{
22
// push value
23
case
OP_0
:
return
"0"
;
24
case
OP_PUSHDATA1
:
return
"OP_PUSHDATA1"
;
25
case
OP_PUSHDATA2
:
return
"OP_PUSHDATA2"
;
26
case
OP_PUSHDATA4
:
return
"OP_PUSHDATA4"
;
27
case
OP_1NEGATE
:
return
"-1"
;
28
case
OP_RESERVED
:
return
"OP_RESERVED"
;
29
case
OP_1
:
return
"1"
;
30
case
OP_2
:
return
"2"
;
31
case
OP_3
:
return
"3"
;
32
case
OP_4
:
return
"4"
;
33
case
OP_5
:
return
"5"
;
34
case
OP_6
:
return
"6"
;
35
case
OP_7
:
return
"7"
;
36
case
OP_8
:
return
"8"
;
37
case
OP_9
:
return
"9"
;
38
case
OP_10
:
return
"10"
;
39
case
OP_11
:
return
"11"
;
40
case
OP_12
:
return
"12"
;
41
case
OP_13
:
return
"13"
;
42
case
OP_14
:
return
"14"
;
43
case
OP_15
:
return
"15"
;
44
case
OP_16
:
return
"16"
;
45
46
// control
47
case
OP_NOP
:
return
"OP_NOP"
;
48
case
OP_VER
:
return
"OP_VER"
;
49
case
OP_IF
:
return
"OP_IF"
;
50
case
OP_NOTIF
:
return
"OP_NOTIF"
;
51
case
OP_VERIF
:
return
"OP_VERIF"
;
52
case
OP_VERNOTIF
:
return
"OP_VERNOTIF"
;
53
case
OP_ELSE
:
return
"OP_ELSE"
;
54
case
OP_ENDIF
:
return
"OP_ENDIF"
;
55
case
OP_VERIFY
:
return
"OP_VERIFY"
;
56
case
OP_RETURN
:
return
"OP_RETURN"
;
57
58
// stack ops
59
case
OP_TOALTSTACK
:
return
"OP_TOALTSTACK"
;
60
case
OP_FROMALTSTACK
:
return
"OP_FROMALTSTACK"
;
61
case
OP_2DROP
:
return
"OP_2DROP"
;
62
case
OP_2DUP
:
return
"OP_2DUP"
;
63
case
OP_3DUP
:
return
"OP_3DUP"
;
64
case
OP_2OVER
:
return
"OP_2OVER"
;
65
case
OP_2ROT
:
return
"OP_2ROT"
;
66
case
OP_2SWAP
:
return
"OP_2SWAP"
;
67
case
OP_IFDUP
:
return
"OP_IFDUP"
;
68
case
OP_DEPTH
:
return
"OP_DEPTH"
;
69
case
OP_DROP
:
return
"OP_DROP"
;
70
case
OP_DUP
:
return
"OP_DUP"
;
71
case
OP_NIP
:
return
"OP_NIP"
;
72
case
OP_OVER
:
return
"OP_OVER"
;
73
case
OP_PICK
:
return
"OP_PICK"
;
74
case
OP_ROLL
:
return
"OP_ROLL"
;
75
case
OP_ROT
:
return
"OP_ROT"
;
76
case
OP_SWAP
:
return
"OP_SWAP"
;
77
case
OP_TUCK
:
return
"OP_TUCK"
;
78
79
// splice ops
80
case
OP_CAT
:
return
"OP_CAT"
;
81
case
OP_SUBSTR
:
return
"OP_SUBSTR"
;
82
case
OP_LEFT
:
return
"OP_LEFT"
;
83
case
OP_RIGHT
:
return
"OP_RIGHT"
;
84
case
OP_SIZE
:
return
"OP_SIZE"
;
85
86
// bit logic
87
case
OP_INVERT
:
return
"OP_INVERT"
;
88
case
OP_AND
:
return
"OP_AND"
;
89
case
OP_OR
:
return
"OP_OR"
;
90
case
OP_XOR
:
return
"OP_XOR"
;
91
case
OP_EQUAL
:
return
"OP_EQUAL"
;
92
case
OP_EQUALVERIFY
:
return
"OP_EQUALVERIFY"
;
93
case
OP_RESERVED1
:
return
"OP_RESERVED1"
;
94
case
OP_RESERVED2
:
return
"OP_RESERVED2"
;
95
96
// numeric
97
case
OP_1ADD
:
return
"OP_1ADD"
;
98
case
OP_1SUB
:
return
"OP_1SUB"
;
99
case
OP_2MUL
:
return
"OP_2MUL"
;
100
case
OP_2DIV
:
return
"OP_2DIV"
;
101
case
OP_NEGATE
:
return
"OP_NEGATE"
;
102
case
OP_ABS
:
return
"OP_ABS"
;
103
case
OP_NOT
:
return
"OP_NOT"
;
104
case
OP_0NOTEQUAL
:
return
"OP_0NOTEQUAL"
;
105
case
OP_ADD
:
return
"OP_ADD"
;
106
case
OP_SUB
:
return
"OP_SUB"
;
107
case
OP_MUL
:
return
"OP_MUL"
;
108
case
OP_DIV
:
return
"OP_DIV"
;
109
case
OP_MOD
:
return
"OP_MOD"
;
110
case
OP_LSHIFT
:
return
"OP_LSHIFT"
;
111
case
OP_RSHIFT
:
return
"OP_RSHIFT"
;
112
case
OP_BOOLAND
:
return
"OP_BOOLAND"
;
113
case
OP_BOOLOR
:
return
"OP_BOOLOR"
;
114
case
OP_NUMEQUAL
:
return
"OP_NUMEQUAL"
;
115
case
OP_NUMEQUALVERIFY
:
return
"OP_NUMEQUALVERIFY"
;
116
case
OP_NUMNOTEQUAL
:
return
"OP_NUMNOTEQUAL"
;
117
case
OP_LESSTHAN
:
return
"OP_LESSTHAN"
;
118
case
OP_GREATERTHAN
:
return
"OP_GREATERTHAN"
;
119
case
OP_LESSTHANOREQUAL
:
return
"OP_LESSTHANOREQUAL"
;
120
case
OP_GREATERTHANOREQUAL
:
return
"OP_GREATERTHANOREQUAL"
;
121
case
OP_MIN
:
return
"OP_MIN"
;
122
case
OP_MAX
:
return
"OP_MAX"
;
123
case
OP_WITHIN
:
return
"OP_WITHIN"
;
124
125
// crypto
126
case
OP_RIPEMD160
:
return
"OP_RIPEMD160"
;
127
case
OP_SHA1
:
return
"OP_SHA1"
;
128
case
OP_SHA256
:
return
"OP_SHA256"
;
129
case
OP_HASH160
:
return
"OP_HASH160"
;
130
case
OP_HASH256
:
return
"OP_HASH256"
;
131
case
OP_CODESEPARATOR
:
return
"OP_CODESEPARATOR"
;
132
case
OP_CHECKSIG
:
return
"OP_CHECKSIG"
;
133
case
OP_CHECKSIGVERIFY
:
return
"OP_CHECKSIGVERIFY"
;
134
case
OP_CHECKMULTISIG
:
return
"OP_CHECKMULTISIG"
;
135
case
OP_CHECKMULTISIGVERIFY
:
return
"OP_CHECKMULTISIGVERIFY"
;
136
137
// expansion
138
case
OP_NOP1
:
return
"OP_NOP1"
;
139
case
OP_CHECKLOCKTIMEVERIFY
:
return
"OP_CHECKLOCKTIMEVERIFY"
;
140
case
OP_CHECKSEQUENCEVERIFY
:
return
"OP_CHECKSEQUENCEVERIFY"
;
141
case
OP_NOP4
:
return
"OP_NOP4"
;
142
case
OP_NOP5
:
return
"OP_NOP5"
;
143
case
OP_NOP6
:
return
"OP_NOP6"
;
144
case
OP_NOP7
:
return
"OP_NOP7"
;
145
case
OP_NOP8
:
return
"OP_NOP8"
;
146
case
OP_NOP9
:
return
"OP_NOP9"
;
147
case
OP_NOP10
:
return
"OP_NOP10"
;
148
149
// Opcode added by BIP 342 (Tapscript)
150
case
OP_CHECKSIGADD
:
return
"OP_CHECKSIGADD"
;
151
152
case
OP_INVALIDOPCODE
:
return
"OP_INVALIDOPCODE"
;
153
154
default
:
155
return
"OP_UNKNOWN"
;
156
}
157
}
158
159
unsigned
int
CScript::GetSigOpCount
(
bool
fAccurate)
const
160
{
161
unsigned
int
n = 0;
162
const_iterator pc =
begin
();
163
opcodetype
lastOpcode =
OP_INVALIDOPCODE
;
164
while
(pc <
end
())
165
{
166
opcodetype
opcode;
167
if
(!
GetOp
(pc, opcode))
168
break
;
169
if
(opcode ==
OP_CHECKSIG
|| opcode ==
OP_CHECKSIGVERIFY
)
170
n++;
171
else
if
(opcode ==
OP_CHECKMULTISIG
|| opcode ==
OP_CHECKMULTISIGVERIFY
)
172
{
173
if
(fAccurate && lastOpcode >=
OP_1
&& lastOpcode <=
OP_16
)
174
n +=
DecodeOP_N
(lastOpcode);
175
else
176
n +=
MAX_PUBKEYS_PER_MULTISIG
;
177
}
178
lastOpcode = opcode;
179
}
180
return
n;
181
}
182
183
unsigned
int
CScript::GetSigOpCount
(
const
CScript
& scriptSig)
const
184
{
185
if
(!
IsPayToScriptHash
())
186
return
GetSigOpCount
(
true
);
187
188
// This is a pay-to-script-hash scriptPubKey;
189
// get the last item that the scriptSig
190
// pushes onto the stack:
191
const_iterator pc = scriptSig.
begin
();
192
std::vector<unsigned char> vData;
193
while
(pc < scriptSig.
end
())
194
{
195
opcodetype
opcode;
196
if
(!scriptSig.
GetOp
(pc, opcode, vData))
197
return
0;
198
if
(opcode >
OP_16
)
199
return
0;
200
}
201
203
CScript
subscript(vData.begin(), vData.end());
204
return
subscript.
GetSigOpCount
(
true
);
205
}
206
207
bool
CScript::IsPayToAnchor
()
const
208
{
209
return
(this->
size
() == 4 &&
210
(*
this
)[0] ==
OP_1
&&
211
(*
this
)[1] == 0x02 &&
212
(*
this
)[2] == 0x4e &&
213
(*
this
)[3] == 0x73);
214
}
215
216
bool
CScript::IsPayToAnchor
(
int
version,
const
std::vector<unsigned char>& program)
217
{
218
return
version == 1 &&
219
program.size() == 2 &&
220
program[0] == 0x4e &&
221
program[1] == 0x73;
222
}
223
224
bool
CScript::IsPayToScriptHash
()
const
225
{
226
// Extra-fast test for pay-to-script-hash CScripts:
227
return
(this->
size
() == 23 &&
228
(*
this
)[0] ==
OP_HASH160
&&
229
(*
this
)[1] == 0x14 &&
230
(*
this
)[22] ==
OP_EQUAL
);
231
}
232
233
bool
CScript::IsPayToWitnessScriptHash
()
const
234
{
235
// Extra-fast test for pay-to-witness-script-hash CScripts:
236
return
(this->
size
() == 34 &&
237
(*
this
)[0] ==
OP_0
&&
238
(*
this
)[1] == 0x20);
239
}
240
241
bool
CScript::IsPayToTaproot
()
const
242
{
243
return
(this->
size
() == 34 &&
244
(*
this
)[0] ==
OP_1
&&
245
(*
this
)[1] == 0x20);
246
}
247
248
// A witness program is any valid CScript that consists of a 1-byte push opcode
249
// followed by a data push between 2 and 40 bytes.
250
bool
CScript::IsWitnessProgram
(
int
& version, std::vector<unsigned char>& program)
const
251
{
252
if
(this->
size
() < 4 || this->
size
() > 42) {
253
return
false
;
254
}
255
if
((*
this
)[0] !=
OP_0
&& ((*
this
)[0] <
OP_1
|| (*
this
)[0] >
OP_16
)) {
256
return
false
;
257
}
258
if
((
size_t
)((*
this
)[1] + 2) == this->
size
()) {
259
version =
DecodeOP_N
((
opcodetype
)(*
this
)[0]);
260
program = std::vector<unsigned char>(this->
begin
() + 2, this->
end
());
261
return
true
;
262
}
263
return
false
;
264
}
265
266
bool
CScript::IsPushOnly
(const_iterator pc)
const
267
{
268
while
(pc <
end
())
269
{
270
opcodetype
opcode;
271
if
(!
GetOp
(pc, opcode))
272
return
false
;
273
// Note that IsPushOnly() *does* consider OP_RESERVED to be a
274
// push-type opcode, however execution of OP_RESERVED fails, so
275
// it's not relevant to P2SH/BIP62 as the scriptSig would fail prior to
276
// the P2SH special validation code being executed.
277
if
(opcode >
OP_16
)
278
return
false
;
279
}
280
return
true
;
281
}
282
283
bool
CScript::IsPushOnly
()
const
284
{
285
return
this->
IsPushOnly
(
begin
());
286
}
287
288
std::string
CScriptWitness::ToString
()
const
289
{
290
std::string
ret
=
"CScriptWitness("
;
291
for
(
unsigned
int
i = 0; i <
stack
.size(); i++) {
292
if
(i) {
293
ret
+=
", "
;
294
}
295
ret
+=
HexStr
(
stack
[i]);
296
}
297
return
ret
+
")"
;
298
}
299
300
bool
CScript::HasValidOps
()
const
301
{
302
CScript::const_iterator it =
begin
();
303
while
(it <
end
()) {
304
opcodetype
opcode;
305
std::vector<unsigned char> item;
306
if
(!
GetOp
(it, opcode, item) || opcode >
MAX_OPCODE
|| item.size() >
MAX_SCRIPT_ELEMENT_SIZE
) {
307
return
false
;
308
}
309
}
310
return
true
;
311
}
312
313
bool
GetScriptOp
(CScriptBase::const_iterator& pc, CScriptBase::const_iterator end,
opcodetype
& opcodeRet, std::vector<unsigned char>* pvchRet)
314
{
315
opcodeRet =
OP_INVALIDOPCODE
;
316
if
(pvchRet)
317
pvchRet->clear();
318
if
(pc >= end)
319
return
false
;
320
321
// Read instruction
322
if
(end - pc < 1)
323
return
false
;
324
unsigned
int
opcode = *pc++;
325
326
// Immediate operand
327
if
(opcode <=
OP_PUSHDATA4
)
328
{
329
unsigned
int
nSize = 0;
330
if
(opcode <
OP_PUSHDATA1
)
331
{
332
nSize = opcode;
333
}
334
else
if
(opcode ==
OP_PUSHDATA1
)
335
{
336
if
(end - pc < 1)
337
return
false
;
338
nSize = *pc++;
339
}
340
else
if
(opcode ==
OP_PUSHDATA2
)
341
{
342
if
(end - pc < 2)
343
return
false
;
344
nSize =
ReadLE16
(&pc[0]);
345
pc += 2;
346
}
347
else
if
(opcode ==
OP_PUSHDATA4
)
348
{
349
if
(end - pc < 4)
350
return
false
;
351
nSize =
ReadLE32
(&pc[0]);
352
pc += 4;
353
}
354
if
(end - pc < 0 || (
unsigned
int
)(end - pc) < nSize)
355
return
false
;
356
if
(pvchRet)
357
pvchRet->assign(pc, pc + nSize);
358
pc += nSize;
359
}
360
361
opcodeRet =
static_cast<
opcodetype
>
(opcode);
362
return
true
;
363
}
364
365
bool
IsOpSuccess
(
const
opcodetype
& opcode)
366
{
367
return
opcode == 80 || opcode == 98 || (opcode >= 126 && opcode <= 129) ||
368
(opcode >= 131 && opcode <= 134) || (opcode >= 137 && opcode <= 138) ||
369
(opcode >= 141 && opcode <= 142) || (opcode >= 149 && opcode <= 153) ||
370
(opcode >= 187 && opcode <= 254);
371
}
372
373
bool
CheckMinimalPush
(
const
std::vector<unsigned char>& data,
opcodetype
opcode) {
374
// Excludes OP_1NEGATE, OP_1-16 since they are by definition minimal
375
assert
(0 <= opcode && opcode <=
OP_PUSHDATA4
);
376
if
(data.size() == 0) {
377
// Should have used OP_0.
378
return
opcode ==
OP_0
;
379
}
else
if
(data.size() == 1 && data[0] >= 1 && data[0] <= 16) {
380
// Should have used OP_1 .. OP_16.
381
return
false
;
382
}
else
if
(data.size() == 1 && data[0] == 0x81) {
383
// Should have used OP_1NEGATE.
384
return
false
;
385
}
else
if
(data.size() <= 75) {
386
// Must have used a direct push (opcode indicating number of bytes pushed + those bytes).
387
return
opcode == data.size();
388
}
else
if
(data.size() <= 255) {
389
// Must have used OP_PUSHDATA.
390
return
opcode ==
OP_PUSHDATA1
;
391
}
else
if
(data.size() <= 65535) {
392
// Must have used OP_PUSHDATA2.
393
return
opcode ==
OP_PUSHDATA2
;
394
}
395
return
true
;
396
}
ret
int ret
Definition
bitcoin-cli.cpp:1350
BaseHash< uint160 >::BaseHash
BaseHash()
Definition
hash_type.h:15
CScript
Serialized script, used inside transaction inputs and outputs.
Definition
script.h:405
CScript::IsPayToScriptHash
bool IsPayToScriptHash() const
Definition
script.cpp:224
CScript::CScript
CScript()=default
CScript::DecodeOP_N
static int DecodeOP_N(opcodetype opcode)
Encode/decode small integers:
Definition
script.h:507
CScript::IsPushOnly
bool IsPushOnly() const
Definition
script.cpp:283
CScript::IsPayToWitnessScriptHash
bool IsPayToWitnessScriptHash() const
Definition
script.cpp:233
CScript::GetSigOpCount
unsigned int GetSigOpCount(bool fAccurate) const
Pre-version-0.6, Bitcoin always counted CHECKMULTISIGs as 20 sigops.
Definition
script.cpp:159
CScript::HasValidOps
bool HasValidOps() const
Check if the script contains valid OP_CODES.
Definition
script.cpp:300
CScript::IsPayToTaproot
bool IsPayToTaproot() const
Definition
script.cpp:241
CScript::IsPayToAnchor
bool IsPayToAnchor() const
Definition
script.cpp:207
CScript::GetOp
bool GetOp(const_iterator &pc, opcodetype &opcodeRet, std::vector< unsigned char > &vchRet) const
Definition
script.h:496
CScript::IsWitnessProgram
bool IsWitnessProgram(int &version, std::vector< unsigned char > &program) const
Definition
script.cpp:250
CScriptID::CScriptID
CScriptID()
Definition
script.h:596
prevector< 36, uint8_t >::size
size_type size() const
Definition
prevector.h:247
prevector< 36, uint8_t >::begin
iterator begin()
Definition
prevector.h:255
prevector< 36, uint8_t >::end
iterator end()
Definition
prevector.h:257
common.h
ReadLE16
uint16_t ReadLE16(const B *ptr)
Definition
common.h:19
ReadLE32
uint32_t ReadLE32(const B *ptr)
Definition
common.h:27
Hash160
uint160 Hash160(const T1 &in1)
Compute the 160-bit hash an object.
Definition
hash.h:92
hash_type.h
HexStr
std::string HexStr(const std::span< const uint8_t > s)
Convert a span of bytes to a lower-case hexadecimal string.
Definition
hex_base.cpp:30
hex_base.h
GetOpName
std::string GetOpName(opcodetype opcode)
Definition
script.cpp:18
CheckMinimalPush
bool CheckMinimalPush(const std::vector< unsigned char > &data, opcodetype opcode)
Definition
script.cpp:373
GetScriptOp
bool GetScriptOp(CScriptBase::const_iterator &pc, CScriptBase::const_iterator end, opcodetype &opcodeRet, std::vector< unsigned char > *pvchRet)
Definition
script.cpp:313
IsOpSuccess
bool IsOpSuccess(const opcodetype &opcode)
Test for OP_SUCCESSx opcodes as defined by BIP342.
Definition
script.cpp:365
script.h
MAX_OPCODE
static const unsigned int MAX_OPCODE
Definition
script.h:216
MAX_SCRIPT_ELEMENT_SIZE
static const unsigned int MAX_SCRIPT_ELEMENT_SIZE
Definition
script.h:28
opcodetype
opcodetype
Script opcodes.
Definition
script.h:74
OP_NUMNOTEQUAL
@ OP_NUMNOTEQUAL
Definition
script.h:173
OP_RESERVED1
@ OP_RESERVED1
Definition
script.h:148
OP_2
@ OP_2
Definition
script.h:85
OP_SHA256
@ OP_SHA256
Definition
script.h:186
OP_PUSHDATA4
@ OP_PUSHDATA4
Definition
script.h:80
OP_NOP5
@ OP_NOP5
Definition
script.h:202
OP_RIGHT
@ OP_RIGHT
Definition
script.h:138
OP_BOOLAND
@ OP_BOOLAND
Definition
script.h:169
OP_CHECKMULTISIG
@ OP_CHECKMULTISIG
Definition
script.h:192
OP_NEGATE
@ OP_NEGATE
Definition
script.h:156
OP_IF
@ OP_IF
Definition
script.h:104
OP_13
@ OP_13
Definition
script.h:96
OP_ROT
@ OP_ROT
Definition
script.h:130
OP_SWAP
@ OP_SWAP
Definition
script.h:131
OP_1NEGATE
@ OP_1NEGATE
Definition
script.h:81
OP_VERNOTIF
@ OP_VERNOTIF
Definition
script.h:107
OP_CHECKSIG
@ OP_CHECKSIG
Definition
script.h:190
OP_CHECKLOCKTIMEVERIFY
@ OP_CHECKLOCKTIMEVERIFY
Definition
script.h:197
OP_LESSTHAN
@ OP_LESSTHAN
Definition
script.h:174
OP_16
@ OP_16
Definition
script.h:99
OP_LEFT
@ OP_LEFT
Definition
script.h:137
OP_14
@ OP_14
Definition
script.h:97
OP_NOP10
@ OP_NOP10
Definition
script.h:207
OP_2DIV
@ OP_2DIV
Definition
script.h:155
OP_INVALIDOPCODE
@ OP_INVALIDOPCODE
Definition
script.h:212
OP_NOT
@ OP_NOT
Definition
script.h:158
OP_EQUAL
@ OP_EQUAL
Definition
script.h:146
OP_NUMEQUAL
@ OP_NUMEQUAL
Definition
script.h:171
OP_MOD
@ OP_MOD
Definition
script.h:165
OP_NOTIF
@ OP_NOTIF
Definition
script.h:105
OP_4
@ OP_4
Definition
script.h:87
OP_10
@ OP_10
Definition
script.h:93
OP_SIZE
@ OP_SIZE
Definition
script.h:139
OP_3DUP
@ OP_3DUP
Definition
script.h:118
OP_ENDIF
@ OP_ENDIF
Definition
script.h:109
OP_NOP1
@ OP_NOP1
Definition
script.h:196
OP_DUP
@ OP_DUP
Definition
script.h:125
OP_GREATERTHAN
@ OP_GREATERTHAN
Definition
script.h:175
OP_NOP
@ OP_NOP
Definition
script.h:102
OP_VERIF
@ OP_VERIF
Definition
script.h:106
OP_TOALTSTACK
@ OP_TOALTSTACK
Definition
script.h:114
OP_CODESEPARATOR
@ OP_CODESEPARATOR
Definition
script.h:189
OP_RIPEMD160
@ OP_RIPEMD160
Definition
script.h:184
OP_MIN
@ OP_MIN
Definition
script.h:178
OP_HASH256
@ OP_HASH256
Definition
script.h:188
OP_MAX
@ OP_MAX
Definition
script.h:179
OP_1SUB
@ OP_1SUB
Definition
script.h:153
OP_FROMALTSTACK
@ OP_FROMALTSTACK
Definition
script.h:115
OP_SUB
@ OP_SUB
Definition
script.h:162
OP_NUMEQUALVERIFY
@ OP_NUMEQUALVERIFY
Definition
script.h:172
OP_OVER
@ OP_OVER
Definition
script.h:127
OP_NOP8
@ OP_NOP8
Definition
script.h:205
OP_DIV
@ OP_DIV
Definition
script.h:164
OP_HASH160
@ OP_HASH160
Definition
script.h:187
OP_2DUP
@ OP_2DUP
Definition
script.h:117
OP_NIP
@ OP_NIP
Definition
script.h:126
OP_2MUL
@ OP_2MUL
Definition
script.h:154
OP_NOP4
@ OP_NOP4
Definition
script.h:201
OP_1
@ OP_1
Definition
script.h:83
OP_LESSTHANOREQUAL
@ OP_LESSTHANOREQUAL
Definition
script.h:176
OP_2DROP
@ OP_2DROP
Definition
script.h:116
OP_DEPTH
@ OP_DEPTH
Definition
script.h:123
OP_NOP9
@ OP_NOP9
Definition
script.h:206
OP_VER
@ OP_VER
Definition
script.h:103
OP_VERIFY
@ OP_VERIFY
Definition
script.h:110
OP_RESERVED2
@ OP_RESERVED2
Definition
script.h:149
OP_12
@ OP_12
Definition
script.h:95
OP_ADD
@ OP_ADD
Definition
script.h:161
OP_CHECKMULTISIGVERIFY
@ OP_CHECKMULTISIGVERIFY
Definition
script.h:193
OP_NOP7
@ OP_NOP7
Definition
script.h:204
OP_8
@ OP_8
Definition
script.h:91
OP_BOOLOR
@ OP_BOOLOR
Definition
script.h:170
OP_XOR
@ OP_XOR
Definition
script.h:145
OP_DROP
@ OP_DROP
Definition
script.h:124
OP_MUL
@ OP_MUL
Definition
script.h:163
OP_WITHIN
@ OP_WITHIN
Definition
script.h:181
OP_CHECKSIGADD
@ OP_CHECKSIGADD
Definition
script.h:210
OP_ELSE
@ OP_ELSE
Definition
script.h:108
OP_15
@ OP_15
Definition
script.h:98
OP_CHECKSIGVERIFY
@ OP_CHECKSIGVERIFY
Definition
script.h:191
OP_PUSHDATA1
@ OP_PUSHDATA1
Definition
script.h:78
OP_TUCK
@ OP_TUCK
Definition
script.h:132
OP_2OVER
@ OP_2OVER
Definition
script.h:119
OP_0NOTEQUAL
@ OP_0NOTEQUAL
Definition
script.h:159
OP_9
@ OP_9
Definition
script.h:92
OP_3
@ OP_3
Definition
script.h:86
OP_11
@ OP_11
Definition
script.h:94
OP_SHA1
@ OP_SHA1
Definition
script.h:185
OP_SUBSTR
@ OP_SUBSTR
Definition
script.h:136
OP_GREATERTHANOREQUAL
@ OP_GREATERTHANOREQUAL
Definition
script.h:177
OP_RSHIFT
@ OP_RSHIFT
Definition
script.h:167
OP_2SWAP
@ OP_2SWAP
Definition
script.h:121
OP_PUSHDATA2
@ OP_PUSHDATA2
Definition
script.h:79
OP_2ROT
@ OP_2ROT
Definition
script.h:120
OP_6
@ OP_6
Definition
script.h:89
OP_INVERT
@ OP_INVERT
Definition
script.h:142
OP_0
@ OP_0
Definition
script.h:76
OP_ABS
@ OP_ABS
Definition
script.h:157
OP_LSHIFT
@ OP_LSHIFT
Definition
script.h:166
OP_RETURN
@ OP_RETURN
Definition
script.h:111
OP_IFDUP
@ OP_IFDUP
Definition
script.h:122
OP_PICK
@ OP_PICK
Definition
script.h:128
OP_AND
@ OP_AND
Definition
script.h:143
OP_EQUALVERIFY
@ OP_EQUALVERIFY
Definition
script.h:147
OP_CAT
@ OP_CAT
Definition
script.h:135
OP_RESERVED
@ OP_RESERVED
Definition
script.h:82
OP_1ADD
@ OP_1ADD
Definition
script.h:152
OP_7
@ OP_7
Definition
script.h:90
OP_OR
@ OP_OR
Definition
script.h:144
OP_ROLL
@ OP_ROLL
Definition
script.h:129
OP_NOP6
@ OP_NOP6
Definition
script.h:203
OP_5
@ OP_5
Definition
script.h:88
OP_CHECKSEQUENCEVERIFY
@ OP_CHECKSEQUENCEVERIFY
Definition
script.h:199
MAX_PUBKEYS_PER_MULTISIG
static const int MAX_PUBKEYS_PER_MULTISIG
Definition
script.h:34
CScriptWitness::ToString
std::string ToString() const
Definition
script.cpp:288
CScriptWitness::stack
std::vector< std::vector< unsigned char > > stack
Definition
script.h:580
uint256.h
assert
assert(!tx.IsCoinBase())
Generated on
for Bitcoin Core by
1.17.0