github.com/BlockABC/godash@v0.0.0-20191112120524-f4aa3a32c566/txscript/doc.go (about) 1 // Copyright (c) 2013-2015 The btcsuite developers 2 // Copyright (c) 2016 The Dash developers 3 // Use of this source code is governed by an ISC 4 // license that can be found in the LICENSE file. 5 6 /* 7 Package txscript implements the bitcoin transaction script language. 8 9 A complete description of the script language used by bitcoin can be found at 10 https://en.bitcoin.it/wiki/Script. The following only serves as a quick 11 overview to provide information on how to use the package. 12 13 This package provides data structures and functions to parse and execute 14 bitcoin transaction scripts. 15 16 Script Overview 17 18 Bitcoin transaction scripts are written in a stack-base, FORTH-like language. 19 20 The bitcoin script language consists of a number of opcodes which fall into 21 several categories such pushing and popping data to and from the stack, 22 performing basic and bitwise arithmetic, conditional branching, comparing 23 hashes, and checking cryptographic signatures. Scripts are processed from left 24 to right and intentionally do not provide loops. 25 26 The vast majority of Bitcoin scripts at the time of this writing are of several 27 standard forms which consist of a spender providing a public key and a signature 28 which proves the spender owns the associated private key. This information 29 is used to prove the the spender is authorized to perform the transaction. 30 31 One benefit of using a scripting language is added flexibility in specifying 32 what conditions must be met in order to spend bitcoins. 33 34 Errors 35 36 Errors returned by this package are of the form txscript.ErrStackX where X 37 indicates the specific error. See Variables in the package documentation for a 38 full list. 39 */ 40 package txscript