1// Copyright (c) 2013-2017 The btcsuite developers
2// Use of this source code is governed by an ISC
3// license that can be found in the LICENSE file.
4
5/*
6Package txscript implements the bitcoin transaction script language.
7
8A complete description of the script language used by bitcoin can be found at
9https://en.bitcoin.it/wiki/Script.  The following only serves as a quick
10overview to provide information on how to use the package.
11
12This package provides data structures and functions to parse and execute
13bitcoin transaction scripts.
14
15Script Overview
16
17Bitcoin transaction scripts are written in a stack-base, FORTH-like language.
18
19The bitcoin script language consists of a number of opcodes which fall into
20several categories such pushing and popping data to and from the stack,
21performing basic and bitwise arithmetic, conditional branching, comparing
22hashes, and checking cryptographic signatures.  Scripts are processed from left
23to right and intentionally do not provide loops.
24
25The vast majority of Bitcoin scripts at the time of this writing are of several
26standard forms which consist of a spender providing a public key and a signature
27which proves the spender owns the associated private key.  This information
28is used to prove the the spender is authorized to perform the transaction.
29
30One benefit of using a scripting language is added flexibility in specifying
31what conditions must be met in order to spend bitcoins.
32
33Errors
34
35Errors returned by this package are of type txscript.Error.  This allows the
36caller to programmatically determine the specific error by examining the
37ErrorCode field of the type asserted txscript.Error while still providing rich
38error messages with contextual information.  A convenience function named
39IsErrorCode is also provided to allow callers to easily check for a specific
40error code.  See ErrorCode in the package documentation for a full list.
41*/
42package txscript
43