-
Notifications
You must be signed in to change notification settings - Fork 3
/
script.mli
159 lines (148 loc) · 2.65 KB
/
script.mli
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
open Util
module Opcode : sig
type t =
| Op_pushdata of int
| Op_pushdata1
| Op_pushdata2
| Op_pushdata4
| Op_1negate
| Op_1
| Op_2
| Op_3
| Op_4
| Op_5
| Op_6
| Op_7
| Op_8
| Op_9
| Op_10
| Op_11
| Op_12
| Op_13
| Op_14
| Op_15
| Op_16
| Op_nop
| Op_if
| Op_notif
| Op_else
| Op_endif
| Op_verify
| Op_return
| Op_toaltstack
| Op_fromaltstack
| Op_ifdup
| Op_depth
| Op_drop
| Op_dup
| Op_nip
| Op_over
| Op_pick
| Op_roll
| Op_rot
| Op_swap
| Op_tuck
| Op_2drop
| Op_2dup
| Op_3dup
| Op_2over
| Op_2rot
| Op_2swap
| Op_cat
| Op_substr
| Op_left
| Op_right
| Op_size
| Op_invert
| Op_and
| Op_or
| Op_xor
| Op_equal
| Op_equalverify
| Op_1add
| Op_1sub
| Op_2mul
| Op_2div
| Op_negate
| Op_abs
| Op_not
| Op_0notequal
| Op_add
| Op_sub
| Op_mul
| Op_div
| Op_mod
| Op_lshift
| Op_rshift
| Op_booland
| Op_boolor
| Op_numequal
| Op_numequalverify
| Op_numnotequal
| Op_lessthan
| Op_greaterthan
| Op_lessthanorequal
| Op_greaterthanorequal
| Op_min
| Op_max
| Op_within
| Op_ripemd160
| Op_sha1
| Op_sha256
| Op_hash160
| Op_hash256
| Op_codeseparator
| Op_checksig
| Op_checksigverify
| Op_checkmultisig
| Op_checkmultisigverify
| Op_checklocktimeverify
| Op_checksequenceverify
| Op_pubkeyhash
| Op_pubkey
| Op_invalidopcode
| Op_reserved
| Op_ver
| Op_verif
| Op_vernotif
| Op_reserved1
| Op_reserved2
| Op_nop1
| Op_nop4
| Op_nop5
| Op_nop6
| Op_nop7
| Op_nop8
| Op_nop9
| Op_nop10
val of_int : int -> t
val to_int : t -> int
end
module Element : sig
type t =
| O of Opcode.t
| D of Cstruct.t
val op_size_prefix : Cstruct.t -> t list
val op_data : Cstruct.t -> t list
end
type t = Element.t list [@@deriving sexp]
val pp : Format.formatter -> t -> unit
val size : t -> int
val of_cstruct : ?pos:int -> ?len:int -> Cstruct.t -> t * Cstruct.t
val to_cstruct : Cstruct.t -> Element.t list -> Cstruct.t
val serialize : t -> Cstruct.t
val hash160 : t -> Util.Hash160.t
module Std : sig
module P2PKH : sig
open Libsecp256k1.External
val scriptRedeem : BitcoinAddr.t -> t
(** [scriptSig] is [[signature ; pkh]] *)
val scriptSig : Context.t -> Cstruct.t -> Key.public Key.t -> t
end
module P2SH : sig
val scriptRedeem : t -> t
end
end
module Run : sig
val eval_exn : t -> bool * Cstruct.t list * t
end