libbtc
bitcoinclibrary
|
Go to the source code of this file.
Data Structures | |
struct | btc_script_op_ |
Typedefs | |
typedef struct btc_script_op_ | btc_script_op |
Functions | |
btc_bool | btc_script_copy_without_op_codeseperator (const cstring *scriptin, cstring *scriptout) |
LIBBTC_API btc_script_op * | btc_script_op_new () |
LIBBTC_API void | btc_script_op_free (btc_script_op *script_op) |
void | btc_script_op_free_cb (void *data) |
btc_bool | btc_script_get_ops (const cstring *script_in, vector *ops_out) |
enum btc_tx_out_type | btc_script_classify (vector *ops) |
LIBBTC_API btc_bool | btc_script_build_multisig (cstring *script_in, unsigned int required_signatures, vector *pubkeys_chars) |
LIBBTC_API btc_bool | btc_script_build_p2pkh (cstring *script, const uint8_t *hash160) |
LIBBTC_API btc_bool | btc_script_build_p2sh (cstring *script_in, const uint8_t *hash160) |
typedef struct btc_script_op_ btc_script_op |
anonymous enum |
Signature hash types/flags
Enumerator | |
---|---|
SIGHASH_ALL | |
SIGHASH_NONE | |
SIGHASH_SINGLE | |
SIGHASH_ANYONECANPAY |
enum btc_tx_out_type |
Enumerator | |
---|---|
BTC_TX_NONSTANDARD | |
BTC_TX_PUBKEY | |
BTC_TX_PUBKEYHASH | |
BTC_TX_SCRIPTHASH | |
BTC_TX_MULTISIG |
Definition at line 193 of file script.h.
enum opcodetype |
Script opcodes
Definition at line 49 of file script.h.
LIBBTC_API btc_bool btc_script_build_multisig | ( | cstring * | script_in, |
unsigned int | required_signatures, | ||
vector * | pubkeys_chars | ||
) |
Definition at line 298 of file script.c.
References BTC_ECKEY_COMPRESSED_LENGTH, BTC_ECKEY_UNCOMPRESSED_LENGTH, btc_encode_op_n(), btc_script_append_pushdata(), btc_pubkey_::compressed, cstr_append_buf(), cstr_resize(), vector::data, vector::len, OP_CHECKMULTISIG, and btc_pubkey_::pubkey.
LIBBTC_API btc_bool btc_script_build_p2pkh | ( | cstring * | script, |
const uint8_t * | hash160 | ||
) |
Definition at line 323 of file script.c.
References btc_script_append_op(), btc_script_append_pushdata(), cstr_resize(), OP_CHECKSIG, OP_DUP, OP_EQUALVERIFY, and OP_HASH160.
Referenced by btc_tx_add_p2pkh_hash160_out().
LIBBTC_API btc_bool btc_script_build_p2sh | ( | cstring * | script_in, |
const uint8_t * | hash160 | ||
) |
Definition at line 338 of file script.c.
References btc_script_append_op(), btc_script_append_pushdata(), cstr_resize(), OP_EQUAL, and OP_HASH160.
Referenced by btc_tx_add_p2sh_hash160_out().
enum btc_tx_out_type btc_script_classify | ( | vector * | ops | ) |
Definition at line 243 of file script.c.
References btc_script_is_multisig(), btc_script_is_pubkey(), btc_script_is_pubkeyhash(), btc_script_is_scripthash(), BTC_TX_MULTISIG, BTC_TX_NONSTANDARD, BTC_TX_PUBKEY, BTC_TX_PUBKEYHASH, and BTC_TX_SCRIPTHASH.
Definition at line 36 of file script.c.
References cstr_append_buf(), deser_bytes(), deser_skip(), deser_u16(), deser_u32(), const_buffer::len, cstring::len, OP_CODESEPARATOR, OP_PUSHDATA1, OP_PUSHDATA2, OP_PUSHDATA4, const_buffer::p, and cstring::str.
Referenced by btc_tx_sighash().
Definition at line 108 of file script.c.
References btc_script_op_free(), btc_script_op_new(), btc_script_op_::data, btc_script_op_::datalen, deser_bytes(), deser_skip(), deser_u16(), deser_u32(), const_buffer::len, cstring::len, btc_script_op_::op, OP_PUSHDATA1, OP_PUSHDATA2, OP_PUSHDATA4, const_buffer::p, cstring::str, and vector_add().
LIBBTC_API void btc_script_op_free | ( | btc_script_op * | script_op | ) |
Definition at line 90 of file script.c.
References btc_script_op_::data, btc_script_op_::datalen, btc_script_op_::op, and OP_0.
Referenced by btc_script_get_ops(), and btc_script_op_free_cb().
void btc_script_op_free_cb | ( | void * | data | ) |
LIBBTC_API btc_script_op* btc_script_op_new | ( | ) |
Definition at line 81 of file script.c.
Referenced by btc_script_get_ops().