Bitcoin Core  27.99.0
P2P Digital Currency
Classes | Macros | Typedefs | Enumerations | Functions
bitcoinconsensus.h File Reference
#include <stdint.h>
Include dependency graph for bitcoinconsensus.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  UTXO
 

Macros

#define EXPORT_SYMBOL
 
#define BITCOINCONSENSUS_API_VER   2
 

Typedefs

typedef enum bitcoinconsensus_error_t bitcoinconsensus_error
 

Enumerations

enum  bitcoinconsensus_error_t {
  bitcoinconsensus_ERR_OK = 0 , bitcoinconsensus_ERR_TX_INDEX , bitcoinconsensus_ERR_TX_SIZE_MISMATCH , bitcoinconsensus_ERR_TX_DESERIALIZE ,
  bitcoinconsensus_ERR_AMOUNT_REQUIRED , bitcoinconsensus_ERR_INVALID_FLAGS , bitcoinconsensus_ERR_SPENT_OUTPUTS_REQUIRED , bitcoinconsensus_ERR_SPENT_OUTPUTS_MISMATCH
}
 
enum  {
  bitcoinconsensus_SCRIPT_FLAGS_VERIFY_NONE = 0 , bitcoinconsensus_SCRIPT_FLAGS_VERIFY_P2SH = (1U << 0) , bitcoinconsensus_SCRIPT_FLAGS_VERIFY_DERSIG = (1U << 2) , bitcoinconsensus_SCRIPT_FLAGS_VERIFY_NULLDUMMY = (1U << 4) ,
  bitcoinconsensus_SCRIPT_FLAGS_VERIFY_CHECKLOCKTIMEVERIFY = (1U << 9) , bitcoinconsensus_SCRIPT_FLAGS_VERIFY_CHECKSEQUENCEVERIFY = (1U << 10) , bitcoinconsensus_SCRIPT_FLAGS_VERIFY_WITNESS = (1U << 11) , bitcoinconsensus_SCRIPT_FLAGS_VERIFY_TAPROOT = (1U << 17) ,
  bitcoinconsensus_SCRIPT_FLAGS_VERIFY_ALL
}
 Script verification flags. More...
 

Functions

EXPORT_SYMBOL int bitcoinconsensus_verify_script (const unsigned char *scriptPubKey, unsigned int scriptPubKeyLen, const unsigned char *txTo, unsigned int txToLen, unsigned int nIn, unsigned int flags, bitcoinconsensus_error *err)
 Returns 1 if the input nIn of the serialized transaction pointed to by txTo correctly spends the scriptPubKey pointed to by scriptPubKey under the additional constraints specified by flags. More...
 
EXPORT_SYMBOL int bitcoinconsensus_verify_script_with_amount (const unsigned char *scriptPubKey, unsigned int scriptPubKeyLen, int64_t amount, const unsigned char *txTo, unsigned int txToLen, unsigned int nIn, unsigned int flags, bitcoinconsensus_error *err)
 
EXPORT_SYMBOL int bitcoinconsensus_verify_script_with_spent_outputs (const unsigned char *scriptPubKey, unsigned int scriptPubKeyLen, int64_t amount, const unsigned char *txTo, unsigned int txToLen, const UTXO *spentOutputs, unsigned int spentOutputsLen, unsigned int nIn, unsigned int flags, bitcoinconsensus_error *err)
 
EXPORT_SYMBOL unsigned int bitcoinconsensus_version ()
 

Macro Definition Documentation

◆ BITCOINCONSENSUS_API_VER

#define BITCOINCONSENSUS_API_VER   2

Definition at line 34 of file bitcoinconsensus.h.

◆ EXPORT_SYMBOL

#define EXPORT_SYMBOL

Definition at line 27 of file bitcoinconsensus.h.

Typedef Documentation

◆ bitcoinconsensus_error

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

Script verification flags.

Enumerator
bitcoinconsensus_SCRIPT_FLAGS_VERIFY_NONE 
bitcoinconsensus_SCRIPT_FLAGS_VERIFY_P2SH 
bitcoinconsensus_SCRIPT_FLAGS_VERIFY_DERSIG 
bitcoinconsensus_SCRIPT_FLAGS_VERIFY_NULLDUMMY 
bitcoinconsensus_SCRIPT_FLAGS_VERIFY_CHECKLOCKTIMEVERIFY 
bitcoinconsensus_SCRIPT_FLAGS_VERIFY_CHECKSEQUENCEVERIFY 
bitcoinconsensus_SCRIPT_FLAGS_VERIFY_WITNESS 
bitcoinconsensus_SCRIPT_FLAGS_VERIFY_TAPROOT 
bitcoinconsensus_SCRIPT_FLAGS_VERIFY_ALL 

Definition at line 49 of file bitcoinconsensus.h.

◆ bitcoinconsensus_error_t

Enumerator
bitcoinconsensus_ERR_OK 
bitcoinconsensus_ERR_TX_INDEX 
bitcoinconsensus_ERR_TX_SIZE_MISMATCH 
bitcoinconsensus_ERR_TX_DESERIALIZE 
bitcoinconsensus_ERR_AMOUNT_REQUIRED 
bitcoinconsensus_ERR_INVALID_FLAGS 
bitcoinconsensus_ERR_SPENT_OUTPUTS_REQUIRED 
bitcoinconsensus_ERR_SPENT_OUTPUTS_MISMATCH 

Definition at line 36 of file bitcoinconsensus.h.

Function Documentation

◆ bitcoinconsensus_verify_script()

EXPORT_SYMBOL int bitcoinconsensus_verify_script ( const unsigned char *  scriptPubKey,
unsigned int  scriptPubKeyLen,
const unsigned char *  txTo,
unsigned int  txToLen,
unsigned int  nIn,
unsigned int  flags,
bitcoinconsensus_error err 
)

Returns 1 if the input nIn of the serialized transaction pointed to by txTo correctly spends the scriptPubKey pointed to by scriptPubKey under the additional constraints specified by flags.

If not nullptr, err will contain an error/success code for the operation

Definition at line 139 of file bitcoinconsensus.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bitcoinconsensus_verify_script_with_amount()

EXPORT_SYMBOL int bitcoinconsensus_verify_script_with_amount ( const unsigned char *  scriptPubKey,
unsigned int  scriptPubKeyLen,
int64_t  amount,
const unsigned char *  txTo,
unsigned int  txToLen,
unsigned int  nIn,
unsigned int  flags,
bitcoinconsensus_error err 
)

Definition at line 128 of file bitcoinconsensus.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bitcoinconsensus_verify_script_with_spent_outputs()

EXPORT_SYMBOL int bitcoinconsensus_verify_script_with_spent_outputs ( const unsigned char *  scriptPubKey,
unsigned int  scriptPubKeyLen,
int64_t  amount,
const unsigned char *  txTo,
unsigned int  txToLen,
const UTXO spentOutputs,
unsigned int  spentOutputsLen,
unsigned int  nIn,
unsigned int  flags,
bitcoinconsensus_error err 
)

Definition at line 119 of file bitcoinconsensus.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bitcoinconsensus_version()

EXPORT_SYMBOL unsigned int bitcoinconsensus_version ( )

Definition at line 153 of file bitcoinconsensus.cpp.

Here is the caller graph for this function: