# Packages
Package interpreter implements the bitcoin transaction script language.
# Functions
Base58EncodeMissingChecksum appends a checksum to a byte sequence then encodes into base58 encoding.
DecodeBIP276 is used to decode BIP276 formatted data into specific (non-standard) scripts.
DecodeParts takes bytes and decodes the opcodes in it returning an array of opcode parts (which could be opcodes or data pushed to the stack).
DecodeStringParts takes a hex string and decodes the opcodes in it returning an array of opcode parts (which could be opcodes or data pushed to the stack).
EncodeBIP276 is used to encode specific (non-standard) scripts in BIP276 format.
EncodeParts takes an array of byte slices and returns a single byte slice with the appropriate OP_PUSH commands embedded.
MinPushSize returns the minimum size of a push operation of the given data.
NewAddressFromPublicKey takes a bec public key and returns an Address struct pointer.
NewAddressFromPublicKeyHash takes a public key hash in bytes and returns an Address struct pointer.
NewAddressFromPublicKeyString takes a public key string and returns an Address struct pointer.
NewAddressFromString takes a string address (P2PKH) and returns a pointer to an Address which contains the address string as well as the public key hash string.
NewFromASM creates a new script from a BitCoin ASM formatted string.
NewFromBytes wraps a byte slice with the Script type.
NewFromHexString creates a new script from a hex encoded string.
NewP2PKHFromAddress takes an address and creates a P2PKH script from it.
NewP2PKHFromBip32ExtKey takes a *bip32.ExtendedKey and creates a P2PKH script from it, using an internally random generated seed, returning the script and derivation path used.
NewP2PKHFromPubKeyBytes takes public key bytes (in compressed format) and creates a P2PKH script from it.
NewP2PKHFromPubKeyEC takes a public key hex string (in compressed format) and creates a P2PKH script from it.
NewP2PKHFromPubKeyHash takes a public key hex string (in compressed format) and creates a P2PKH script from it.
NewP2PKHFromPubKeyHashStr takes a public key hex string (in compressed format) and creates a P2PKH script from it.
NewP2PKHFromPubKeyStr takes a public key hex string (in compressed format) and creates a P2PKH script from it.
NewP2PKHUnlockingScript creates a new unlocking script which spends a P2PKH locking script from a public key, a signature, and a SIGHASH flag.
PushDataPrefix takes a single byte slice of data and returns its OP_PUSHDATA BitCoin encoding prefix based on its length.
ValidateAddress checks if an address string is a valid BitCoin address (ex.
# Constants
CurrentVersion provides the ability to update the structure of the data that follows it.
NetworkMainnet specifies that the data is only valid for use on the main network.
NetworkTestnet specifies that the data is only valid for use on the test network.
0.
146.
81.
90.
91.
92.
93.
94.
95.
96.
139.
79.
140.
82.
142.
109.
110.
141.
112.
113.
114.
83.
111.
84.
85.
86.
87.
88.
89.
144.
147.
132.
80.
129.
154.
155.
126.
177.
174.
175.
178.
172.
173.
171.
1.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
2.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
3.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
4.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
5.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
6.
60.
61.
62.
63.
64.
65.
66.
67.
68.
69.
7.
70.
71.
72.
73.
74.
75.
8.
9.
116.
150.
117.
118.
103.
104.
135.
136.
0.
108.
160.
162.
169.
170.
99.
115.
255 - bitcoin core.
131.
159.
161.
152.
164.
163.
151.
149.
143.
119.
97.
176.
185.
177.
178.
179.
180.
181.
182.
183.
184.
145.
100.
128.
156.
157.
158.
81.
133.
120.
121.
254 - bitcoin core internal.
253 - bitcoin core internal.
251 - bitcoin core internal.
76.
77.
78.
80.
137.
138.
106.
166.
122.
123.
153.
167.
168.
130.
250 - bitcoin core internal.
127.
148.
124.
107.
81.
125.
186.
187.
188.
189.
190.
191.
192.
193.
194.
195.
196.
197.
198.
199.
200.
201.
202.
203.
204.
205.
206.
207.
208.
209.
210.
211.
212.
213.
214.
215.
216.
217.
218.
219.
220.
221.
222.
223.
224.
225.
226.
227.
228.
229.
230.
231.
232.
233.
234.
235.
236.
237.
238.
239.
240.
241.
242.
243.
244.
245.
246.
247.
248.
249.
252.
98.
101.
105.
102.
165.
134.
0.
PrefixScript is the prefix in the BIP276 standard which specifies if it is a script or template.
PrefixTemplate is the prefix in the BIP276 standard which specifies if it is a script or template.
ScriptKey types.
ScriptKey types.
ScriptKey types.
ScriptKey types.
ScriptKey types.
ScriptKey types.
ScriptKey types.
# Variables
Sentinel errors raised by data ops.
Sentinel errors raised by data ops.
Sentinel errors raised by the package.
Sentinel errors raised through encoding.
Sentinel errors raised through encoding.
Sentinel errors raised through encoding.
Sentinel errors raised through encoding.
Sentinel errors raised through encoding.
Sentinel errors raised by addresses.
Sentinel errors raised by the package.
Sentinel errors raised by the package.
Sentinel errors raised by the package.
Sentinel errors raised by the package.
Sentinel errors raised by data ops.
Sentinel errors raised through encoding.
Sentinel errors raised by addresses.
# Type aliases
Script type.