package
0.7.0
Repository: https://github.com/tokenized/pkg.git
Documentation: pkg.go.dev

# Packages

No description provided by the author

# Functions

No description provided by the author
AddHashes adds the value of the hashes together using big integer modular math.
AddressFromLockingScript returns the address associated with the specified locking script.
AddressFromUnlockingScript returns the address associated with the specified unlocking script.
Base58 return the Base58 encoding of the input.
Base58Decode returns base 58 decodes the argument and returns the result.
Base64 returns the Bas64 encoding of the input.
Base64Decode returns base 64 decodes the argument and returns the result.
BIP0276Decode decodes a value into the prefix and data into a hex string.
BIP0276Decode58 decodes a value into the prefix and data into a base58 string.
BIP0276Encode encodes a value with a specified prefix into a hex string.
BIP0276Encode58 encodes a value with a specified prefix into a base58 string.
BytePushData returns the push op to push a single byte value to the stack.
No description provided by the author
ChildKey derives a child key at a specified index.
ChildKey derives a child key at a specified index.
No description provided by the author
No description provided by the author
ConcatScript concatenates op codes and sections of script into one script.
No description provided by the author
No description provided by the author
No description provided by the author
ConvertToBits converts a big integer to the "target bits" value to be used in a Bitcoin header.
ConvertToDifficulty converts from a "target bits" value in a Bitcoin header to a big integer that represents the difficulty required in the hash of the header.
ConvertToWork converts a difficulty number into the amount of work required to meet it.
No description provided by the author
DecodeAddress decodes a base58 text bitcoin address.
DecodeNetMatches returns true if the decoded network id matches the specified network id.
DecodeRawAddress decodes a binary raw address.
No description provided by the author
No description provided by the author
Decrypt reads the IV from the beginning of the output, then uses AES with the input keysize and CBC to decrypt the payload.
Deserialize reads a hash from a reader.
Deserialize reads a hash from a reader.
DoubleSha256 performs a double Sha256 hash on the bytes.
ECDHSecret returns the secret derived using ECDH (Elliptic Curve Diffie Hellman).
Encrypt generates a random IV prepends it to the output, then uses AES with the input keysize and CBC to encrypt the payload.
EncryptIV uses AES with the input keysize and the specified IV and CBC to encrypt the payload.
ExtendedKeyFromBytes creates a key from bytes.
ExtendedKeyFromStr creates a key from a hex string.
ExtendedKeyFromStr58 creates a key from a base 58 string.
ExtendedKeysFromBytes creates a list of keys from bytes.
ExtendedKeysFromStr creates a list of keys from a hex string.
ExtendedKeysFromStr58 creates a list of keys from a base 58 string.
GenerateKey randomly generates a new key.
GenerateExtendedKey creates a key from random data.
GenerateSeedValue generates a random seed value that can be used to derive keys.
Hash160 returns the Ripemd160(SHA256(input)) of the input.
IndexedHash returns the SHA256 hash of the hash used to generate the next key in a chain.
KeyFromBytes decodes a binary bitcoin key.
KeyFromNumber creates a key from a byte representation of a big number.
KeyFromStr converts WIF (Wallet Import Format) key text to a key.
No description provided by the author
LoadMasterExtendedKey creates a key from a seed.
LockingScriptIsUnspendable returns true if the locking script is known to be unspendable.
No description provided by the author
No description provided by the author
NewAddressCompressedPublicKey creates an address from a compressed public key.
NewAddressFromRawAddress creates an Address from a RawAddress and a network.
NewAddressMultiPKH creates an address from multiple public key hashes.
NewAddressNonStandard creates an address from a script that is non-standard but possibly spendable.
NewAddressPKH creates an address from a public key hash.
NewAddressPublicKey creates an address from a public key.
NewAddressRPH creates an address from a R puzzle hash.
NewAddressSH creates an address from a script hash.
NewAndLockingScript creates a script that can be unlocked by one of two sub scripts.
No description provided by the author
NewDecryptor creates a new decryptor.
NewEncryptor creates a new encryptor.
NewEncryptorIV creates a new encryptor with a specified initialization vector.
No description provided by the author
NewHash20FromData creates a Hash20 by hashing the data with a Ripemd160(Sha256(b)).
NewHash20FromStr creates a little endian hash from a big endian string.
No description provided by the author
NewHash32FromStr creates a little endian hash from a big endian string.
No description provided by the author
No description provided by the author
NewOrLockingScript creates a script that can be unlocked by one of two sub scripts.
NewOrTemplate creates a template that can be unlocked by one of two sub templates.
No description provided by the author
NewRawAddressCompressedPublicKey creates an address from a compressed public key.
NewRawAddressFromAddress creates a RawAddress from an Address.
NewRawAddressMultiPKH creates an address from multiple public key hashes.
NewRawAddressNonStandard creates an address from a non-standard but possibly spendable script.
NewRawAddressPKH creates an address from a public key hash.
NewRawAddressPublicKey creates an address from a public key.
NewRawAddressRPH creates an address from a R puzzle hash.
NewRawAddressSH creates an address from a script hash.
No description provided by the author
NextHash returns the SHA256 hash of the hash used to generate the next key in a chain.
NextKey implements the WP42 method of deriving a private key from a private key and a hash.
NextPublicKey implements the WP42 method of deriving a public key from a public key and a hash.
No description provided by the author
ParsePushDataScript will parse a bitcoin script for the next "object".
ParsePushDataScriptSize will parse a push data script and return its size.
ParsePushNumberScript reads a number out of script and returns the value, the bytes of script it used, and an error if one occured.
ParseScript will parse the next item of a bitcoin script.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
PublicKeyFromBytes decodes a binary bitcoin public key.
PublicKeyFromLockingScript returns the serialized compressed public key from the locking script if there is one.
PublicKeyFromString converts key text to a key.
PublicKeyFromUnlockingScript returns the serialized compressed public key from the unlocking script if there is one.
PushData.
PushDataScriptSize returns the encoded push data script size op codes.
PushDataSize returns the size of the script item needed to push data of a specified size.
No description provided by the author
PushNumberScript returns a section of script that will push the specified number onto the stack.
No description provided by the author
RawAddressFromLockingScript returns the script template associated with the specified locking script.
RawAddressFromUnlockingScript returns the raw address associated with the specified unlocking script.
No description provided by the author
No description provided by the author
No description provided by the author
Ripemd160 returns the RIPEMD (RIPE Message Digest) of the input.
ScriptNumberValue returns the number value given the op code or push data returned from ParseScript.
No description provided by the author
ScriptToString converts a bitcoin script into a text representation.
Sha256 returns the SHA256 (Secure Hash Algorithm) of the input.
SignatureFromBytes decodes a binary bitcoin signature.
SignatureFromCompact converts base64 "compact" signature text to a signature.
SignatureFromStr converts signature text to a signature.
SignWithK creates a signature of the hash from the private key and specific ephemeral k value rather than generating k with the RFC6979 algorithm.
StringToScript converts a text representation of a bitcoin script to a string.
No description provided by the author
No description provided by the author
PushDataScript writes a push data bitcoin script including the encoded size preceding it.

# Constants

Multi-PKH (starts with p) - Experimental value.
Unknown, but possibly spendable locking script.
Public Key - Experimental value.
Public Key Hash (starts with 1).
RPH (starts with r) - Experimental value.
Script Hash (starts with 3).
Multi-PKH (starts with q) - Experimental value.
Unknown, but possibly spendable locking script.
Public Key - Experimental value.
Testnet Public Key Hash (starts with m or n).
RPH (starts with s) - Experimental value.
Testnet Script Hash (starts with 2).
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Hardened child index offset.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Convert the top stack item into a number value.
No description provided by the author
No description provided by the author
Concatenate the top to stack items.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Push the number of items in the stack onto the stack.
No description provided by the author
Remove the top stack item.
Duplicate top item on stack.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
These values are place holders in the template for where the public key values should be swapped in when instantiating the template.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Bitwise logical operators.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
OP_MAX_SINGLE_BYTE_PUSH_DATA represents the max length for a single byte push.
No description provided by the author
Divide a by b and put the remainder on the stack.
No description provided by the author
No description provided by the author
Remove second item deep in stack.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Convert second item on the stack into a byte sequence the length specified by the first stack item.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Copy second stack item to the top.
Copy item that is n deep in stack and push onto stack.
OP_NOP9 - Must be replaced by a public key.
No description provided by the author
OP_NOP10 - Must be replaced by a public key hash.
Psuedo op codes used as place-holders in template scripts, but not valid in final scripts.
OP_PUSH_DATA_1 represent the OP_PUSHDATA1 opcode.
OP_PUSH_DATA_1_MAX is the maximum number of bytes that can be used in the OP_PUSHDATA1 opcode.
OP_PUSH_DATA_2 represents the OP_PUSHDATA2 opcode.
OP_PUSH_DATA_2_MAX is the maximum number of bytes that can be used in the OP_PUSHDATA2 opcode.
No description provided by the author
No description provided by the author
No description provided by the author
OP_PUSH_DATA_4 represents the OP_PUSHDATA4 opcode.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Move item n deep in stack to the top.
Move the top stack item to before the third stack item.
No description provided by the author
No description provided by the author
No description provided by the author
Push the length of the top stack item onto the stack.
Split the second item at the index specified in the top item.
No description provided by the author
Reverse the order of the top two stack items.
No description provided by the author
No description provided by the author
Copy the item at the top of the stack into before the second item on the stack.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Length of standard public key, script, and R hashes RIPEMD(SHA256()).
No description provided by the author
No description provided by the author
Empty address.
Multi-PKH.
Unknown, but possibly spendable locking script.
Public Key.
Public Key Hash.
RPH.
Script Hash.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Variables

256 bits, all set.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ErrNotVerifyScript means the script doesn't end with a verify so it isn't safe to embed in some other scripts.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
MainNetParams defines the network parameters for the BSV Main Network.
Maximum value of the Bitcoin header bits field.
Max work value allowed.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
RegTestNetParams defines the network parameters for the BSV Regression Network.
StressTestNetParams defines the network parameters for the BSV Stress Test Network.
TestNetParams defines the network parameters for the BSV Test Network.

# Structs

No description provided by the author
Decryptor is an io.Reader that decrypts data with a specified key.
Encryptor is an io.WriteCloser (Writer and Closer) the encrypts data with a specified key.
No description provided by the author
Key is an elliptic curve private key using the secp256k1 elliptic curve.
PublicKey is an elliptic curve public key using the secp256k1 elliptic curve.
RawAddress represents a bitcoin address in raw format, with no check sum or encoding.
No description provided by the author
Signature is an elliptic curve signature using the secp256k1 elliptic curve.
No description provided by the author
No description provided by the author

# Type aliases

No description provided by the author
Hash20 is a 20 byte integer in little endian format.
Hash32 is a 32 byte integer in little endian format.
Hex is used in structures as a byte slice that will marshal as hex instead of base64 like is default for json.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Template represents a locking script that is incomplete.