The bp Reference Manual

Next: , Previous: , Up: (dir)   [Contents][Index]

The bp Reference Manual

This is the bp Reference Manual, version 0.0.3, generated automatically by Declt version 4.0 beta 2 "William Riker" on Thu Sep 15 03:23:32 2022 GMT+0.

Table of Contents


1 Introduction

BP - Bitcoin Protocol

Quicklisp Build Status

This is a Common Lisp implementation of the various components of the Bitcoin Protocol. The serialization and deserialization utils may be used for reading the block data both from peers and from local database on disk. EC-based cryptographic operations are implemented as FFI bindings to the secp256k1 using cffi, while hash-functions are taken from ironclad. Low-level networking is implemented using usocket, HTTP client code uses aserve and JSON handling is done with jsown.

THIS BITCOIN CONSENSUS RULES IMPLEMENTATION IS NOT, AND WILL PROBABLY NEVER BE FULLY COMPLIANT WITH BITCOIN CORE IMPLEMENTATION. DO NOT RELY ON IT FOR VALIDATING YOUR MAINNET TRANSACTIONS, AS IT MAY EASILY PUT YOU OUT OF SYNC WITH THE NETWORK IN A LOT OF CORNER CASES.

Table of Contents

Installation

Elliptic curve cryptography utilities (transaction signing and verification) use a secp256k1 library, so it must be installed before building the bp system (either manually, or using the system package manager if available):

# Ubuntu
$ apt install libsecp256k1 libsecp256k1-dev

# Arch Linux
$ pacman -Syu libsecp256k1

# macOS
$ brew tap cuber/homebrew-libsecp256k1
$ brew install libsecp256k1

Once secp256k1 is ready, bp can be installed via quicklisp tool:

CL-USER> (ql:quickload "bp")

Alternatively, bp system can be loaded from sources, assuming the following Common Lisp packages are available locally:

In order to load bp from sources, evaluate the following form (this assumes that ASDF is able to find the system definition; more on that here):

CL-USER> (asdf:load-system "bp")

Core

Currently this library only provides utilities for stateless interaction with Bitcoin from REPL. Storage, wallet and full node capabilities are somewhere in a distant future.

Note that at this point only the symbols exported from the package bp/core/all (nicknamed bp) can be considered an API - changes to these functions and classes will be kept to a minimum. Everything else will likely be changing a lot.

Chain interface

Functions bp:get-block-hash, bp:get-block and bp:get-transaction allow to pull chain data from any external supplier specified with the bp:with-chain-supplier macro:

CL-USER> (bp:with-chain-supplier (bprpc:node-rpc-connection
                                  :url "http://localhost:8332"
                                  :username "btcuser"
                                  :password "btcpassword")
           (bp:get-transaction "0e3e2357e806b6cdb1f70b54c3a3a17b6714ee1f0e68bebb44a74b1efd512098"))
#<BP/CORE/TRANSACTION:TX 0e3e2357e806b6cdb1f70b54c3a3a17b6714ee1f0e68bebb44a74b1efd512098>

Non-nil keyword argument :encoded can be used with bp:get-block and bp:get-transaction to return serialized transaction hex-encoded in a string:

CL-USER> (bp:get-transaction "14...c3" :encoded t)
"010000000...ae00000000"

Under the hood, these operations call corresponding generic functions bp:chain-get-{block-hash,block,transaction} which take the supplier object as an explicit first argument.

Model

Bitcoin data entities are represented by the following structures:

Functions named bp:block-* (both for bp:block-header and bp:cblock), bp:tx-*, bp:txin-* and bp:txout-* provide access to the components of the corresponding entities.

Serialization

Functions bp:parse and bp:serialize can be used to read and write any Bitcoin entity from and to any octet stream respectively:

CL-USER> (ironclad:with-octet-input-stream (stream #(1 0 ... 0 0))
           (bp:parse 'bp:tx in-stream))
#<BP/CORE/TRANSACTION:TX 17e590f116d3deeb9b121bbb1c37b7916e6b7859461a3af7edf74e2348a9b347>
CL-USER> (ironclad:with-octet-output-stream (stream)
           (bp:parse 'tx out-stream))
#(1 0 ... 0 0)

Note that while bp:serialize function take an entity as its first argument, bp:parse takes the symbol naming the class of the entity, behaving as class method.

Functions bp:decode and bp:encode wrap above functions to decode and encode Bitcoin entities from and to hex-encoded strings:

CL-USER> (bp:decode 'bp:tx "0100000002f8615378...e097a988ac00000000")
#<BP/CORE/TRANSACTION:TX 17e590f116d3deeb9b121bbb1c37b7916e6b7859461a3af7edf74e2348a9b347>
CL-USER> (bp:encode *)
"0100000002f8615378...e097a988ac00000000"

Validation

Functions bp:validate and bp:validp take an entity as well as the optional context parameters, and validate it according to an approximation of Bitcoin consensus rules.

Both functions return t if the entity is valid, but the bp:validate function signals an error otherwise, while the bp:validp function simply returns nil.

Both functions assume the chain supplier context (i.e. they are called within the body of bp:with-chain-supplier).

Dynamic variable bp:*trace-script-execution* can be used to enable printing the steps of script execution (chain supplier macro omitted):

CL-USER> (setf bp:*trace-script-execution* t)
T
CL-USER> (bp:validate
          (bp:get-transaction "17e590f116d3deeb9b121bbb1c37b7916e6b7859461a3af7edf74e2348a9b347"))
op:       OP_PUSH22
payload:  #(0 14 a4 b4 ca 48 de b 3f ff c1 54 4 a1 ac dc 8d ba ae 22 69 55)
commands: <>
stack:    ()

op:       OP_HASH160
payload:  -
commands: <OP_PUSH20 OP_EQUAL>
stack:    (#(0 14 a4 b4 ca 48 de b 3f ff c1 54 4 a1 ac dc 8d ba ae 22 69 55))

op:       OP_PUSH20
payload:  #(29 28 f4 3a f1 8d 2d 60 e8 a8 43 54 d 80 86 b3 5 34 13 39)
commands: <OP_EQUAL>
stack:    (#(29 28 f4 3a f1 8d 2d 60 e8 a8 43 54 d 80 86 b3 5 34 13 39))

op:       OP_EQUAL
payload:  -
commands: <>
stack:    (#(29 28 f4 3a f1 8d 2d 60 e8 a8 43 54 d 80 86 b3 5 34 13 39)
           #(29 28 f4 3a f1 8d 2d 60 e8 a8 43 54 d 80 86 b3 5 34 13 39))

op:       OP_FALSE
payload:  -
commands: <OP_PUSH20>
stack:    ()

op:       OP_PUSH20
payload:  #(a4 b4 ca 48 de b 3f ff c1 54 4 a1 ac dc 8d ba ae 22 69 55)
commands: <>
stack:    (#())

T

Validating certain entities requires additional information (block height, transactions index, block/transaction itself, etc), which can be packed into an instance of bp:validation-context class. For example, validating a coinbase transaction will fail, because the only transaction input it contains will have its previous-tx-id set to 0, which is invalid for regular transactions. For example, to be considered valid, a coinbase transaction must be the first transaction of its block, while the block itself is required for amount verification (to calculate the collected fees) and block height may be needed to perform the BIP-0034 check, so such a transaction can be validated using the following form:

CL-USER> (let* ((block
                  (bp:get-block "00000000000000d0dfd4c9d588d325dce4f32c1b31b7c0064cba7025a9b9adcc"))
                (context
                  (make-instance 'bp:validation-context :tx-index 0 :height 227836 :block block))
           (bp:validate
            (bp:get-transaction "0f3601a5da2f516fa9d3f80c9bf6e530f1afb0c90da73e8f8ad0630c5483afe5")
            :context context)))
T

Network

BP provides simple utilities for interacting with Bitcoin network - a subset of network messages and functions for establishing connections with other network nodes as well as requesting blocks and transactions.

In order to demontrate interaction with Bitcoin network, we can start a regtest Bitcoin node:

# Start Bitcoin daemon:
$ bitcoind --daemon --regtest --datadir=$HOME/.bitcoin

# Generate a few blocks:
$ bitcoin-cli --regtest generatetoaddress 5 $(bitcoin-cli --regtest getnewaddress)

# Enable net logging:
$ bitcoin-cli --regtest logging "[\"net\"]"

# Tail log file to see the incoming messages:
$ tail -f ~/.bitcoin/regtest/debug.log

Executing the following forms from Lisp REPL will perform a handshake with Bitcoin node:

CL-USER> (defvar *node* (make-instance 'bpnet:simple-node :network :regtest))
...
CL-USER> (bpnet:connect-peer *node* :host "127.0.0.1" :port 18444)
...

bpnet:simple-node is a very simple network node implementation that maintains a single peer connection and provides bpnet:send-message and bpnet:receive-message functions for sending and receiving messages, respectively.

Alternatively, bpnet:simple-node can be asked to discover a peer using a hardcoded DNS seed, but this is currently only supported on mainnet. The following form will select a random peer and shake hands with it:

CL-USER> (setf *node* (make-instance 'bpnet:simple-node :peer :discover))
...

Objects of bpnet:simple-node partially implement chain supplier interface - bp:chain-get-block-hash is currently not supported, bp:chain-get-transaction only returns transactions that are currently in the mempool or in relay set (this is an intentional limitation of the Bitcoin gossip protocol to prevent clients from assuming all nodes keep full transaction indexes). bp:chain-get-block works as expected. In the example below <block-hash> must be a hash of one of the blocks generated by the generatetoaddress command above:

CL-USER> (bp:chain-get-block *node* <block-hash>)
...

RPC

bprpc package provides that bprpc:node-rpc-connection class which is is an RPC client to the bitcoind RPC server. It was mentioned above as one of the implementations of the chain supplier interface, but it also supports the following RPC operations that correspond to the bitcoind RPC methods (and bitcoin-cli commands) with the same name:

Note that results of RPC operations are jsown JSON structures, so specific parts of these structures have to be extracted manually:

cl-user> (let* ((node-connection (make-instance 'bprpc:node-rpc-connection :url <url>))
                (chain-stats (bprpc:getchaintxstats node-connection))
                (chain-blocks (jsown:val chain-stats "window_final_block_height"))
                (chain-txs (jsown:val chain-stats "txcount")))
           (format t "Blocks: ~a, transactions: ~a~%" chain-blocks chain-txs))

Examples

API changes

See CHANGELOG.md.

License

Copyright (c) 2019-2021 Seibart Nedor <rodentrabies@protonmail.com>

Licensed under MIT License. See LICENSE.


2 Systems

The main system appears first, followed by any subsystem dependency.


Next: , Previous: , Up: Systems   [Contents][Index]

2.1 bp

Bitcoin Protocol components in Common Lisp

Author

Seibart Nedor <rodentrabies@protonmail.com>

License

MIT

Version

0.0.3

Dependencies
Source

bp.asd.


Next: , Previous: , Up: Systems   [Contents][Index]

2.2 bp/core/all

Author

Seibart Nedor <rodentrabies@protonmail.com>

License

MIT

Dependencies
Source

bp.asd.


Next: , Previous: , Up: Systems   [Contents][Index]

2.3 bp/core/encoding

Author

Seibart Nedor <rodentrabies@protonmail.com>

License

MIT

Dependencies
Source

bp.asd.


2.4 bp/crypto/hash

Author

Seibart Nedor <rodentrabies@protonmail.com>

License

MIT

Dependency

ironclad (system).

Source

bp.asd.


Next: , Previous: , Up: Systems   [Contents][Index]

2.5 bp/core/transaction

Author

Seibart Nedor <rodentrabies@protonmail.com>

License

MIT

Dependencies
Source

bp.asd.


2.6 bp/core/script

Author

Seibart Nedor <rodentrabies@protonmail.com>

License

MIT

Dependencies
Source

bp.asd.


2.7 bp/core/parameters

Author

Seibart Nedor <rodentrabies@protonmail.com>

License

MIT

Source

bp.asd.


2.8 bp/crypto/secp256k1

Author

Seibart Nedor <rodentrabies@protonmail.com>

License

MIT

Dependencies
Source

bp.asd.


2.9 bp/crypto/random

Author

Seibart Nedor <rodentrabies@protonmail.com>

License

MIT

Source

bp.asd.


Next: , Previous: , Up: Systems   [Contents][Index]

2.10 bp/core/block

Author

Seibart Nedor <rodentrabies@protonmail.com>

License

MIT

Dependencies
Source

bp.asd.


Next: , Previous: , Up: Systems   [Contents][Index]

2.11 bp/core/chain

Author

Seibart Nedor <rodentrabies@protonmail.com>

License

MIT

Dependencies
Source

bp.asd.


Next: , Previous: , Up: Systems   [Contents][Index]

2.12 bp/core/merkletree

Author

Seibart Nedor <rodentrabies@protonmail.com>

License

MIT

Dependencies
Source

bp.asd.


Next: , Previous: , Up: Systems   [Contents][Index]

2.13 bp/core/consensus

Author

Seibart Nedor <rodentrabies@protonmail.com>

License

MIT

Dependencies
Source

bp.asd.


Next: , Previous: , Up: Systems   [Contents][Index]

2.14 bp/crypto/all

Author

Seibart Nedor <rodentrabies@protonmail.com>

License

MIT

Dependencies
Source

bp.asd.


Next: , Previous: , Up: Systems   [Contents][Index]

2.15 bp/net/all

Author

Seibart Nedor <rodentrabies@protonmail.com>

License

MIT

Dependencies
Source

bp.asd.


Next: , Previous: , Up: Systems   [Contents][Index]

2.16 bp/net/parameters

Author

Seibart Nedor <rodentrabies@protonmail.com>

License

MIT

Dependency

bp/core/all (system).

Source

bp.asd.


Next: , Previous: , Up: Systems   [Contents][Index]

2.17 bp/net/address

Author

Seibart Nedor <rodentrabies@protonmail.com>

License

MIT

Dependencies
Source

bp.asd.


Next: , Previous: , Up: Systems   [Contents][Index]

2.18 bp/net/message

Author

Seibart Nedor <rodentrabies@protonmail.com>

License

MIT

Dependencies
Source

bp.asd.


Next: , Previous: , Up: Systems   [Contents][Index]

2.19 bp/net/node

Author

Seibart Nedor <rodentrabies@protonmail.com>

License

MIT

Dependencies
Source

bp.asd.


Previous: , Up: Systems   [Contents][Index]

2.20 bp/rpc/all

Author

Seibart Nedor <rodentrabies@protonmail.com>

License

MIT

Dependencies
  • aserve (system).
  • jsown (system).
  • bp/core/all (system).
Source

bp.asd.


Next: , Previous: , Up: The bp Reference Manual   [Contents][Index]

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Previous: , Up: Files   [Contents][Index]

3.1 Lisp


3.1.2 bp/core/all/file-type.lisp

Source

bp.asd.

Parent Component

bp/core/all (system).

Packages

bp/core/all.


3.1.3 bp/core/encoding/file-type.lisp

Source

bp.asd.

Parent Component

bp/core/encoding (system).

Packages

bp/core/encoding.

Public Interface
Internals

3.1.4 bp/crypto/hash/file-type.lisp

Source

bp.asd.

Parent Component

bp/crypto/hash (system).

Packages

bp/crypto/hash.

Public Interface

3.1.5 bp/core/transaction/file-type.lisp

Source

bp.asd.

Parent Component

bp/core/transaction (system).

Packages

bp/core/transaction.

Public Interface
Internals

3.1.6 bp/core/script/file-type.lisp

Source

bp.asd.

Parent Component

bp/core/script (system).

Packages

bp/core/script.

Public Interface
Internals

3.1.7 bp/core/parameters/file-type.lisp

Source

bp.asd.

Parent Component

bp/core/parameters (system).

Packages

bp/core/parameters.

Public Interface

3.1.8 bp/crypto/secp256k1/file-type.lisp

Source

bp.asd.

Parent Component

bp/crypto/secp256k1 (system).

Packages

bp/crypto/secp256k1.

Public Interface
Internals

3.1.9 bp/crypto/random/file-type.lisp

Source

bp.asd.

Parent Component

bp/crypto/random (system).

Packages

bp/crypto/random.

Public Interface

random-bytes (function).


3.1.10 bp/core/block/file-type.lisp

Source

bp.asd.

Parent Component

bp/core/block (system).

Packages

bp/core/block.

Public Interface
Internals

3.1.11 bp/core/chain/file-type.lisp

Source

bp.asd.

Parent Component

bp/core/chain (system).

Packages

bp/core/chain.

Public Interface
Internals

3.1.12 bp/core/merkletree/file-type.lisp

Source

bp.asd.

Parent Component

bp/core/merkletree (system).

Packages

bp/core/merkletree.

Public Interface
Internals

3.1.13 bp/core/consensus/file-type.lisp

Source

bp.asd.

Parent Component

bp/core/consensus (system).

Packages

bp/core/consensus.

Public Interface
Internals

3.1.14 bp/crypto/all/file-type.lisp

Source

bp.asd.

Parent Component

bp/crypto/all (system).

Packages

bp/crypto/all.


3.1.15 bp/net/all/file-type.lisp

Source

bp.asd.

Parent Component

bp/net/all (system).

Packages

bp/net/all.


3.1.16 bp/net/parameters/file-type.lisp

Source

bp.asd.

Parent Component

bp/net/parameters (system).

Packages

bp/net/parameters.

Public Interface

3.1.17 bp/net/address/file-type.lisp

Source

bp.asd.

Parent Component

bp/net/address (system).

Packages

bp/net/address.

Public Interface
Internals

*dns-seed* (special variable).


3.1.18 bp/net/message/file-type.lisp

Source

bp.asd.

Parent Component

bp/net/message (system).

Packages

bp/net/message.

Public Interface
Internals

3.1.19 bp/net/node/file-type.lisp

Source

bp.asd.

Parent Component

bp/net/node (system).

Packages

bp/net/node.

Public Interface
Internals

3.1.20 bp/rpc/all/file-type.lisp

Source

bp.asd.

Parent Component

bp/rpc/all (system).

Packages

bp/rpc/all.

Public Interface
Internals

4 Packages

Packages are listed by definition order.


Next: , Previous: , Up: Packages   [Contents][Index]

4.1 bp/rpc/all

Source

file-type.lisp.

Nickname

bprpc

Use List
Public Interface
Internals

Next: , Previous: , Up: Packages   [Contents][Index]

4.2 bp/core/parameters

Source

file-type.lisp.

Use List

common-lisp.

Used By List
Public Interface

Next: , Previous: , Up: Packages   [Contents][Index]

4.3 bp/core/chain

Source

file-type.lisp.

Use List
Used By List
Public Interface
Internals

Next: , Previous: , Up: Packages   [Contents][Index]

4.5 bp/net/address

Source

file-type.lisp.

Use List
Used By List
Public Interface
Internals

*dns-seed* (special variable).


Next: , Previous: , Up: Packages   [Contents][Index]

4.6 bp/net/parameters

Source

file-type.lisp.

Use List
Used By List
Public Interface

4.7 bp/crypto/random

Source

file-type.lisp.

Use List

common-lisp.

Used By List
Public Interface

random-bytes (function).


4.8 bp/core/script

Source

file-type.lisp.

Use List
Used By List
Public Interface
Internals

Next: , Previous: , Up: Packages   [Contents][Index]

4.9 bp/core/transaction

Source

file-type.lisp.

Use List
Used By List
Public Interface
Internals

4.10 bp/crypto/hash

Source

file-type.lisp.

Use List
  • common-lisp.
  • ironclad.
Used By List
Public Interface

Next: , Previous: , Up: Packages   [Contents][Index]

4.11 bp/net/message

Source

file-type.lisp.

Use List
Used By List
Public Interface
Internals

Next: , Previous: , Up: Packages   [Contents][Index]

4.12 bp/core/encoding

Source

file-type.lisp.

Use List
Used By List
Public Interface
Internals

Next: , Previous: , Up: Packages   [Contents][Index]

4.13 bp/net/node

Source

file-type.lisp.

Use List
Used By List

bp/net/all.

Public Interface
Internals

Next: , Previous: , Up: Packages   [Contents][Index]

4.14 bp/crypto/all

Source

file-type.lisp.

Nickname

bpcrypto

Use List
Used By List

bp/net/node.


4.15 bp/core/block

Source

file-type.lisp.

Use List
Used By List
Public Interface
Internals

Next: , Previous: , Up: Packages   [Contents][Index]

4.16 bp/core/merkletree

Source

file-type.lisp.

Use List
Used By List
Public Interface
Internals

4.17 bp/net/all

Source

file-type.lisp.

Nickname

bpnet

Use List

Next: , Previous: , Up: Packages   [Contents][Index]

4.18 bp/crypto/secp256k1

Source

file-type.lisp.

Nickname

secp256k1

Use List
Used By List
Public Interface
Internals

4.19 bp/core/consensus

Source

file-type.lisp.

Use List
Used By List

bp/core/all.

Public Interface
Internals

Next: , Previous: , Up: The bp Reference Manual   [Contents][Index]

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

5.1 Public Interface


5.1.1 Constants

Constant: +bp-network-port+
Package

bp/net/parameters.

Source

file-type.lisp.

Constant: +bp-regtest-network-port+
Package

bp/net/parameters.

Source

file-type.lisp.

Constant: +bp-testnet-network-port+
Package

bp/net/parameters.

Source

file-type.lisp.

Constant: +halving-period+

Number of blocks in between halving events - each 210000 blocks, the block reward is reduced by half, eventually getting to 0 and providing the limited supply property of Bitcoin.

Package

bp/core/parameters.

Source

file-type.lisp.

Constant: +initial-block-reward+

Initial reward included in newly mined blocks.

Package

bp/core/parameters.

Source

file-type.lisp.

Constant: +iv-error+

Any data of with this number may be ignored.

Package

bp/net/message.

Source

file-type.lisp.

Constant: +iv-msg-block+

Hash is related to a data block.

Package

bp/net/message.

Source

file-type.lisp.

Constant: +iv-msg-cmpct-block+

Hash of a block header; identical to MSG_BLOCK. Only to be used in getdata message. Indicates the reply should be a cmpctblock message. See BIP-0152 for more info.

Package

bp/net/message.

Source

file-type.lisp.

Constant: +iv-msg-filtered-block+

Hash of a block header; identical to MSG_BLOCK. Only to be used in getdata message. Indicates the reply should be a merkleblock message rather than a block message; this only works if a bloom filter has been set.

Package

bp/net/message.

Source

file-type.lisp.

Constant: +iv-msg-tx+

Hash is related to a transaction.

Package

bp/net/message.

Source

file-type.lisp.

Constant: +mainnet-bip-0016-switch-time+

Block timestamp at which BIP-0016 was adopted by the mainnet.

Package

bp/core/parameters.

Source

file-type.lisp.

Constant: +network-magic+
Package

bp/net/parameters.

Source

file-type.lisp.

Constant: +network-port+
Package

bp/net/parameters.

Source

file-type.lisp.

Constant: +node-bloom+

See BIP-0111.

Package

bp/net/parameters.

Source

file-type.lisp.

Constant: +node-getutxo+

See BIP-0064.

Package

bp/net/parameters.

Source

file-type.lisp.

Constant: +node-network+

This service flag means that given node can serve full blocks instead of just headers.

Package

bp/net/parameters.

Source

file-type.lisp.

Constant: +node-network-limited+

See BIP-0159.

Package

bp/net/parameters.

Source

file-type.lisp.

Constant: +node-witness+

See BIP-0111.

Package

bp/net/parameters.

Source

file-type.lisp.

Constant: +regtest-network-magic+
Package

bp/net/parameters.

Source

file-type.lisp.

Constant: +regtest-network-port+
Package

bp/net/parameters.

Source

file-type.lisp.

Constant: +testnet-bip-0016-switch-time+

Block timestamp at which BIP-0016 was adopted by the testnet.

Package

bp/core/parameters.

Source

file-type.lisp.

Constant: +testnet-network-magic+
Package

bp/net/parameters.

Source

file-type.lisp.

Constant: +testnet-network-port+
Package

bp/net/parameters.

Source

file-type.lisp.


Next: , Previous: , Up: Public Interface   [Contents][Index]

5.1.2 Special variables

Special Variable: *bip-0016-active-p*

Pay to Script Hash https://github.com/bitcoin/bips/blob/master/bip-0016.mediawiki.

Package

bp/core/parameters.

Source

file-type.lisp.

Special Variable: *bip-0141-active-p*

Segregated Witness (Consensus layer) https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki.

Package

bp/core/parameters.

Source

file-type.lisp.

Special Variable: *bp-version*

Version of the BP package.

Package

bp/core/parameters.

Source

file-type.lisp.

Special Variable: *chain-supplier*

Global chain supplier bound by the WITH-CHAIN-SUPPLIER context manager.

Package

bp/core/chain.

Source

file-type.lisp.

Special Variable: *protocol-version*
Package

bp/net/parameters.

Source

file-type.lisp.

Special Variable: *trace-script-execution*

Dynamic variable to control printing the steps of script execution. If its value is not NIL, it will be used as a first argument to the FORMAT function for logging script steps (i.e. setting it to T will print the trace to *STANDARD-OUTPUT*, while setting it to a stream value will write the trace to that stream).

Package

bp/core/script.

Source

file-type.lisp.

Special Variable: *user-agent*
Package

bp/net/parameters.

Source

file-type.lisp.


5.1.3 Macros

Macro: with-chain-supplier ((type &rest args &key &allow-other-keys) &body body)
Package

bp/core/chain.

Source

file-type.lisp.

Macro: with-chain-supplier-normalization ((id-var encoded-var errorp-var &key entity-type id-type body-type error-type) &body body)

Helper macro for generating the normalization if the entity identifier (block height, block hash and transaction id) and post-processing (encoding, decoding and error signalling) for the chain supplier API implementations.

ID-VAR is an entity identifier variable, which will be normalized to a hex-string, byte array or left unchanged if the value of ID-TYPE is :ENCODED, :DECODED or :AS-IS respectively.

ENCODED-VAR corresponds to ENCODED chain supplier parameter - it will be used in combination with BODY-TYPE argument to determine if the result of the BODY should be encoded, decoded (as an ENTITY-TYPE entity in the latter case) or left as-is.

ERROPR-VAR corresponds to the ERRORP chain supplier parameter - it will be used to either return NIL or signal a corresponding error if the body returns NIL. If ERROR-TYPE is non-NIL, it will be used instead of the default error type.

Package

bp/core/chain.

Source

file-type.lisp.


5.1.4 Ordinary functions

Function: address-from-bytes (bytes)
Package

bp/net/address.

Source

file-type.lisp.

Function: address-to-bytes (address)
Package

bp/net/address.

Source

file-type.lisp.

Function: base58-decode (string)

Decode a BASE58-encoded string and return a byte array.

Package

bp/core/encoding.

Source

file-type.lisp.

Function: base58-encode (bytes)

Encode a byte array with BASE58 and return a resulting string.

Package

bp/core/encoding.

Source

file-type.lisp.

Function: base58check-decode (string)

Decode a BASE58-encoded string STRING, verify that the last 4 bytes (checksum part) match the first 4 bytes of the double-SHA256 hash of all but the last 4 bytes of the original sequence (payload part) and return the payload part.

Package

bp/core/encoding.

Source

file-type.lisp.

Function: base58check-encode (bytes)

BASE58-encode a byte array BYTES (payload) followed by the checksum computed as first 4 bytes of the double-SHA256 hash of the payload.

Package

bp/core/encoding.

Source

file-type.lisp.

Function: bech32-decode (string &key versionp)
Package

bp/core/encoding.

Source

file-type.lisp.

Function: bech32-encode (hrp bytes &key versionp bech32m-p)
Package

bp/core/encoding.

Source

file-type.lisp.

Reader: block-header (instance)
Writer: (setf block-header) (instance)
Package

bp/core/block.

Source

file-type.lisp.

Target Slot

header.

Function: block-id (block)
Package

bp/core/block.

Source

file-type.lisp.

Reader: block-message-block (instance)
Writer: (setf block-message-block) (instance)
Package

bp/net/message.

Source

file-type.lisp.

Target Slot

block.

Function: block-transaction (cblock index)
Package

bp/core/block.

Source

file-type.lisp.

Reader: block-transactions (instance)
Writer: (setf block-transactions) (instance)
Package

bp/core/block.

Source

file-type.lisp.

Target Slot

transactions.

Function: build-merkle-tree (leaves)

Build merkle tree from the list of transactions LEAVES by taking a current tree level (starting from LEAVES), completing it to the even number of elements, grouping it into pairs and constructing the next level until it has length 1. Return a resulting root node.

Package

bp/core/merkletree.

Source

file-type.lisp.

Function: command-from-message-type (message-type)

Return a string command for a given message struct.

Package

bp/net/message.

Source

file-type.lisp.

Function: context-create-none ()
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Function: context-create-sign ()
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Function: context-create-verify ()
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Function: decode (entity-class string)

Decode Bitcoin Protocol entity given by its class name ENTITY-CLASS from hex STRING.

Package

bp/core/encoding.

Source

file-type.lisp.

Function: decode-integer (bytes)
Package

bp/core/script.

Source

file-type.lisp.

Function: ec-privkey-negate (seckey)
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Function: ec-pubkey-create (seckey)
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Function: ec-pubkey-negate (pubkey)
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Function: ec-pubkey-parse (input)
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Function: ec-pubkey-serialize (pubkey &key compressed)
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Function: ec-seckey-verify (seckey)
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Function: ecdsa-sign (msg32 seckey)

Create an ECDSA signature.

Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Function: ecdsa-signature-normalize (sigin)
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Function: ecdsa-signature-parse-compact (input64)
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Function: ecdsa-signature-parse-der (input)
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Function: ecdsa-signature-serialize-compact (signature)
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Function: ecdsa-signature-serialize-der (signature)
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Function: ecdsa-verify (signature msg32 pubkey)

Verify an ECDSA signature.

Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Function: encode (entity)

Encode Bitcoin Protocol ENTITY into a hex string.

Package

bp/core/encoding.

Source

file-type.lisp.

Function: encode-integer (integer)
Package

bp/core/script.

Source

file-type.lisp.

Function: execute-script (script &key state)

Execute a script using a state that can be provided externally.

Package

bp/core/script.

Source

file-type.lisp.

Function: execute-scripts (script-sig script-pubkey &key state)

Execute SCRIPT-SIG and SCRIPT-PUBKEY in succession, preserving the stack and performing the special rule detection (P2SH, SegWit).

Package

bp/core/script.

Source

file-type.lisp.

Function: get-block (hash &key encoded errorp)
Package

bp/core/chain.

Source

file-type.lisp.

Function: get-block-hash (height &key errorp)
Package

bp/core/chain.

Source

file-type.lisp.

Function: get-transaction (id &key encoded errorp)
Package

bp/core/chain.

Source

file-type.lisp.

Function: getblock (connection hash)
Package

bp/rpc/all.

Source

file-type.lisp.

Function: getblockhash (connection height)
Package

bp/rpc/all.

Source

file-type.lisp.

Function: getchaintxstats (connection)
Package

bp/rpc/all.

Source

file-type.lisp.

Reader: getdata-message-inventory (instance)
Writer: (setf getdata-message-inventory) (instance)
Package

bp/net/message.

Source

file-type.lisp.

Target Slot

inventory.

Function: getrawtransaction (connection id)
Package

bp/rpc/all.

Source

file-type.lisp.

Function: hash160 (bytes)
Package

bp/crypto/hash.

Source

file-type.lisp.

Function: hash256 (bytes)
Package

bp/crypto/hash.

Source

file-type.lisp.

Function: hex-decode (string)

Shortcut to avoid using long symbol IRONCLAD:HEX-STRING-TO-BYTE-ARRAY.

Package

bp/core/encoding.

Source

file-type.lisp.

Function: hex-encode (bytes)

Shortcut to avoid using long symbol IRONCLAD:BYTE-ARRAY-TO-HEX-STRING.

Package

bp/core/encoding.

Source

file-type.lisp.

Reader: inv-message-inventory (instance)
Writer: (setf inv-message-inventory) (instance)
Package

bp/net/message.

Source

file-type.lisp.

Target Slot

inventory.

Reader: inventory-vector-hash (instance)
Writer: (setf inventory-vector-hash) (instance)
Package

bp/net/message.

Source

file-type.lisp.

Target Slot

hash.

Reader: inventory-vector-type (instance)
Writer: (setf inventory-vector-type) (instance)
Package

bp/net/message.

Source

file-type.lisp.

Target Slot

type.

Function: make-addr-message (&key)
Package

bp/net/message.

Source

file-type.lisp.

Function: make-alert-message (&key)
Package

bp/net/message.

Source

file-type.lisp.

Function: make-block-message (&key block)
Package

bp/net/message.

Source

file-type.lisp.

Function: make-blocktxn-message (&key)
Package

bp/net/message.

Source

file-type.lisp.

Function: make-byte-array (length &optional contents)
Package

bp/core/encoding.

Source

file-type.lisp.

Function: make-checkorder-message (&key)
Package

bp/net/message.

Source

file-type.lisp.

Function: make-cmpctblock-message (&key)
Package

bp/net/message.

Source

file-type.lisp.

Function: make-feefilter-message (&key)
Package

bp/net/message.

Source

file-type.lisp.

Function: make-filteradd-message (&key)
Package

bp/net/message.

Source

file-type.lisp.

Function: make-filterclear-message (&key)
Package

bp/net/message.

Source

file-type.lisp.

Function: make-filterload-message (&key)
Package

bp/net/message.

Source

file-type.lisp.

Function: make-getaddr-message (&key)
Package

bp/net/message.

Source

file-type.lisp.

Function: make-getblocks-message (&key)
Package

bp/net/message.

Source

file-type.lisp.

Function: make-getblocktxn-message (&key)
Package

bp/net/message.

Source

file-type.lisp.

Function: make-getdata-message (&key inventory)
Package

bp/net/message.

Source

file-type.lisp.

Function: make-getheaders-message (&key)
Package

bp/net/message.

Source

file-type.lisp.

Function: make-headers-message (&key)
Package

bp/net/message.

Source

file-type.lisp.

Function: make-inv-message (&key inventory)
Package

bp/net/message.

Source

file-type.lisp.

Function: make-inventory-vector (&key type hash)
Package

bp/net/message.

Source

file-type.lisp.

Function: make-key ()
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Function: make-mempool-message (&key)
Package

bp/net/message.

Source

file-type.lisp.

Function: make-merkleblock-message (&key)
Package

bp/net/message.

Source

file-type.lisp.

Function: make-network-address (&key timestamp services address port)
Package

bp/net/message.

Source

file-type.lisp.

Function: make-notfound-message (&key inventory)
Package

bp/net/message.

Source

file-type.lisp.

Function: make-packet (&key magic command length checksum payload)
Package

bp/net/message.

Source

file-type.lisp.

Function: make-ping-message (&key nonce)
Package

bp/net/message.

Source

file-type.lisp.

Function: make-pong-message (&key nonce)
Package

bp/net/message.

Source

file-type.lisp.

Function: make-pubkey (key)
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Function: make-reject-message (&key)
Package

bp/net/message.

Source

file-type.lisp.

Function: make-reply-message (&key)
Package

bp/net/message.

Source

file-type.lisp.

Function: make-script (&key commands)
Package

bp/core/script.

Source

file-type.lisp.

Function: make-script-state (&key commands discard stack altstack conditions witness sighashf sigversion)
Package

bp/core/script.

Source

file-type.lisp.

Function: make-sendcmpct-message (&key)
Package

bp/net/message.

Source

file-type.lisp.

Function: make-sendheaders-message (&key)
Package

bp/net/message.

Source

file-type.lisp.

Function: make-signature (key hash)
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Function: make-submitorder-message (&key)
Package

bp/net/message.

Source

file-type.lisp.

Function: make-tx-message (&key tx)
Package

bp/net/message.

Source

file-type.lisp.

Function: make-verack-message (&key)
Package

bp/net/message.

Source

file-type.lisp.

Function: make-version-message (&key version services timestamp receiver-address sender-address nonce user-agent height relayp)
Package

bp/net/message.

Source

file-type.lisp.

Reader: merkle-tree-node-hash (instance)
Writer: (setf merkle-tree-node-hash) (instance)
Package

bp/core/merkletree.

Source

file-type.lisp.

Target Slot

hash.

Function: message-type-from-command (command)

Return a message type symbol for a given string command.

Package

bp/net/message.

Source

file-type.lisp.

Function: network ()
Package

bp/core/chain.

Source

file-type.lisp.

Reader: network-address-address (instance)
Writer: (setf network-address-address) (instance)
Package

bp/net/message.

Source

file-type.lisp.

Target Slot

address.

Reader: network-address-port (instance)
Writer: (setf network-address-port) (instance)
Package

bp/net/message.

Source

file-type.lisp.

Target Slot

port.

Reader: network-address-services (instance)
Writer: (setf network-address-services) (instance)
Package

bp/net/message.

Source

file-type.lisp.

Target Slot

services.

Reader: network-address-timestamp (instance)
Writer: (setf network-address-timestamp) (instance)
Package

bp/net/message.

Source

file-type.lisp.

Target Slot

timestamp.

Reader: notfound-message-inventory (instance)
Writer: (setf notfound-message-inventory) (instance)
Package

bp/net/message.

Source

file-type.lisp.

Target Slot

inventory.

Reader: packet-checksum (instance)
Writer: (setf packet-checksum) (instance)
Package

bp/net/message.

Source

file-type.lisp.

Target Slot

checksum.

Reader: packet-command (instance)
Writer: (setf packet-command) (instance)
Package

bp/net/message.

Source

file-type.lisp.

Target Slot

command.

Reader: packet-magic (instance)
Writer: (setf packet-magic) (instance)
Package

bp/net/message.

Source

file-type.lisp.

Target Slot

magic.

Reader: packet-payload (instance)
Writer: (setf packet-payload) (instance)
Package

bp/net/message.

Source

file-type.lisp.

Target Slot

payload.

Function: parse-pubkey (bytes)
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Function: parse-signature (bytes &key type)
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Reader: ping-message-nonce (instance)
Writer: (setf ping-message-nonce) (instance)
Package

bp/net/message.

Source

file-type.lisp.

Target Slot

nonce.

Reader: pong-message-nonce (instance)
Writer: (setf pong-message-nonce) (instance)
Package

bp/net/message.

Source

file-type.lisp.

Target Slot

nonce.

Function: random-bytes (size)
Package

bp/crypto/random.

Source

file-type.lisp.

Function: random-peer-address ()
Package

bp/net/address.

Source

file-type.lisp.

Function: read-bytes (stream size)
Package

bp/core/encoding.

Source

file-type.lisp.

Function: read-int (stream &key size byte-order)
Package

bp/core/encoding.

Source

file-type.lisp.

Function: read-varint (stream)
Package

bp/core/encoding.

Source

file-type.lisp.

Function: ripemd160 (bytes)
Package

bp/crypto/hash.

Source

file-type.lisp.

Function: script (&rest symbolic-commands)

Construct a SCRIPT object from a sequence of Lisp objects, doing the best effort to detect/convert the provided values.

Package

bp/core/script.

Source

file-type.lisp.

Reader: script-commands (instance)
Writer: (setf script-commands) (instance)
Package

bp/core/script.

Source

file-type.lisp.

Target Slot

commands.

Function: script-standard-p (script-pubkey &key network)

If given script is standard, return a common name for the script type (:P2SH, :P2PKH, :P2WSH, etc) or T, otherwise return NIL. Additionally, if the address format is defined for that type of script, return a Bitcoin address for a given script as a second value.

Package

bp/core/script.

Source

file-type.lisp.

Function: serialize-pubkey (key)
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Function: serialize-signature (signature &key type)
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Function: split-host/port-string (string)
Package

bp/net/address.

Source

file-type.lisp.

Function: testnet-p ()
Package

bp/core/chain.

Source

file-type.lisp.

Function: tx-hash (tx)

Raw transaction ID is a double SHA256 of its binary serialization.

Package

bp/core/transaction.

Source

file-type.lisp.

Function: tx-id (tx)

Return hex-encoded txid - little-endian hash of the transaction serialization without witness structures.

Package

bp/core/transaction.

Source

file-type.lisp.

Function: tx-input (tx index)

Return INDEXth input of the given transaction.

Package

bp/core/transaction.

Source

file-type.lisp.

Reader: tx-inputs (instance)
Writer: (setf tx-inputs) (instance)
Package

bp/core/transaction.

Source

file-type.lisp.

Target Slot

inputs.

Reader: tx-locktime (instance)
Writer: (setf tx-locktime) (instance)
Package

bp/core/transaction.

Source

file-type.lisp.

Target Slot

locktime.

Reader: tx-message-tx (instance)
Writer: (setf tx-message-tx) (instance)
Package

bp/net/message.

Source

file-type.lisp.

Target Slot

tx.

Function: tx-output (tx index)

Return INDEXth output of the given transaction.

Package

bp/core/transaction.

Source

file-type.lisp.

Reader: tx-outputs (instance)
Writer: (setf tx-outputs) (instance)
Package

bp/core/transaction.

Source

file-type.lisp.

Target Slot

outputs.

Reader: tx-version (instance)
Writer: (setf tx-version) (instance)
Package

bp/core/transaction.

Source

file-type.lisp.

Target Slot

version.

Function: tx-wid (tx)

Return hex-encoded wtxid - little-endian hash of the transaction serialization including witness structures.

Package

bp/core/transaction.

Source

file-type.lisp.

Function: tx-witness (tx index)

Return INDEXth witness of the given transaction if it is a SegWit transaction, otherwise return NIL.

Package

bp/core/transaction.

Source

file-type.lisp.

Reader: tx-witnesses (instance)
Writer: (setf tx-witnesses) (instance)
Package

bp/core/transaction.

Source

file-type.lisp.

Target Slot

witnesses.

Reader: txin-previous-tx-id (instance)
Writer: (setf txin-previous-tx-id) (instance)
Package

bp/core/transaction.

Source

file-type.lisp.

Target Slot

previous-tx-id.

Reader: txin-previous-tx-index (instance)
Writer: (setf txin-previous-tx-index) (instance)
Package

bp/core/transaction.

Source

file-type.lisp.

Target Slot

previous-tx-index.

Reader: txin-script-sig (instance)
Writer: (setf txin-script-sig) (instance)
Package

bp/core/transaction.

Source

file-type.lisp.

Target Slot

script-sig.

Reader: txin-sequence (instance)
Writer: (setf txin-sequence) (instance)
Package

bp/core/transaction.

Source

file-type.lisp.

Target Slot

sequence.

Reader: txout-amount (instance)
Writer: (setf txout-amount) (instance)
Package

bp/core/transaction.

Source

file-type.lisp.

Target Slot

amount.

Reader: txout-script-pubkey (instance)
Writer: (setf txout-script-pubkey) (instance)
Package

bp/core/transaction.

Source

file-type.lisp.

Target Slot

script-pubkey.

Function: validp (entity &key context)

Return T if the ENTITY is valid, NIL otherwise.

Package

bp/core/consensus.

Source

file-type.lisp.

Function: verify-signature (pubkey hash signature)
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Reader: version-message-height (instance)
Writer: (setf version-message-height) (instance)
Package

bp/net/message.

Source

file-type.lisp.

Target Slot

height.

Reader: version-message-nonce (instance)
Writer: (setf version-message-nonce) (instance)
Package

bp/net/message.

Source

file-type.lisp.

Target Slot

nonce.

Reader: version-message-receiver-address (instance)
Writer: (setf version-message-receiver-address) (instance)
Package

bp/net/message.

Source

file-type.lisp.

Target Slot

receiver-address.

Reader: version-message-relayp (instance)
Writer: (setf version-message-relayp) (instance)
Package

bp/net/message.

Source

file-type.lisp.

Target Slot

relayp.

Reader: version-message-sender-address (instance)
Writer: (setf version-message-sender-address) (instance)
Package

bp/net/message.

Source

file-type.lisp.

Target Slot

sender-address.

Reader: version-message-services (instance)
Writer: (setf version-message-services) (instance)
Package

bp/net/message.

Source

file-type.lisp.

Target Slot

services.

Reader: version-message-timestamp (instance)
Writer: (setf version-message-timestamp) (instance)
Package

bp/net/message.

Source

file-type.lisp.

Target Slot

timestamp.

Reader: version-message-user-agent (instance)
Writer: (setf version-message-user-agent) (instance)
Package

bp/net/message.

Source

file-type.lisp.

Target Slot

user-agent.

Reader: version-message-version (instance)
Writer: (setf version-message-version) (instance)
Package

bp/net/message.

Source

file-type.lisp.

Target Slot

version.

Reader: witness-items (instance)
Writer: (setf witness-items) (instance)
Package

bp/core/transaction.

Source

file-type.lisp.

Target Slot

items.

Function: write-bytes (bytes stream size)
Package

bp/core/encoding.

Source

file-type.lisp.

Function: write-int (i stream &key size byte-order)
Package

bp/core/encoding.

Source

file-type.lisp.

Function: write-varint (i stream)
Package

bp/core/encoding.

Source

file-type.lisp.


5.1.5 Generic functions

Generic Function: block-bits (block)
Package

bp/core/block.

Source

file-type.lisp.

Methods
Method: block-bits ((cblock cblock))
Method: block-bits ((block-header block-header))
Generic Function: block-hash (block)
Package

bp/core/block.

Source

file-type.lisp.

Methods
Method: block-hash ((cblock cblock))
Method: block-hash ((block-header block-header))
Generic Function: block-merkle-root (block)
Package

bp/core/block.

Source

file-type.lisp.

Methods
Method: block-merkle-root ((cblock cblock))
Method: block-merkle-root ((block-header block-header))
Generic Function: block-nonce (block)
Package

bp/core/block.

Source

file-type.lisp.

Methods
Method: block-nonce ((cblock cblock))
Method: block-nonce ((block-header block-header))
Generic Function: block-previous-block-hash (block)
Package

bp/core/block.

Source

file-type.lisp.

Methods
Method: block-previous-block-hash ((cblock cblock))
Method: block-previous-block-hash ((block-header block-header))
Generic Function: block-timestamp (block)
Package

bp/core/block.

Source

file-type.lisp.

Methods
Method: block-timestamp ((cblock cblock))
Method: block-timestamp ((block-header block-header))
Generic Function: block-version (block)
Package

bp/core/block.

Source

file-type.lisp.

Methods
Method: block-version ((cblock cblock))
Method: block-version ((block-header block-header))
Generic Function: chain-get-block (supplier hash &key encoded errorp)

Get raw block data from SUPPLIER by its HASH. HASH
can be either a hex-encoded string or a byte array. If ENCODED is non-NIL, returns a hex-encoded string, otherwise returns CBLOCK object. If there is no block with the given HASH, return NIL or signal an UNKNOWN-BLOCK-ERROR error, depending on the ERRORP value.

Package

bp/core/chain.

Source

file-type.lisp.

Methods
Method: chain-get-block ((supplier node-rpc-connection) hash &key encoded errorp)
Source

file-type.lisp.

Method: chain-get-block ((node simple-node) hash &key encoded errorp)
Source

file-type.lisp.

Generic Function: chain-get-block-hash (supplier height &key encoded errorp)

Get the hash of the block from SUPPLIER by its
HEIGHT in the chain. HEIGHT must be an integer. If ENCODED is non-NIL, returns a hex-encoded string, otherwise returns a raw id represented as byte array. If there is no known block at the given HEIGHT, return NIL or signal an UNKNOWN-BLOCK-HASH-ERROR error, depending on the ERRORP value.

Package

bp/core/chain.

Source

file-type.lisp.

Methods
Method: chain-get-block-hash ((supplier node-rpc-connection) height &key encoded errorp)
Source

file-type.lisp.

Method: chain-get-block-hash ((node simple-node) height &key encoded errorp)
Source

file-type.lisp.

Generic Function: chain-get-transaction (supplier id &key encoded errorp)

Get raw transaction data from SUPPLIER by its
ID. ID can be either a hex-encoded string or a byte array. If ENCODED is non-NIL, returns a hex-encoded string, otherwise returns TX object. If there is no transaction with a given ID, return NIL or signal an UNKNOWN-TRANSACTION-ERROR error, depending on the ERRORP value.

Package

bp/core/chain.

Source

file-type.lisp.

Methods
Method: chain-get-transaction ((supplier node-rpc-connection) id &key encoded errorp)
Source

file-type.lisp.

Method: chain-get-transaction ((node simple-node) id &key encoded errorp)
Source

file-type.lisp.

Generic Function: chain-testnet-p (supplier)

Return NIL if SUPPLIER’s network is :MAINNET and T otherwise.

Package

bp/core/chain.

Source

file-type.lisp.

Methods
Method: chain-testnet-p (supplier)
Generic Function: connect-peer (node &key host port)
Package

bp/net/node.

Source

file-type.lisp.

Methods
Method: connect-peer ((node simple-node) &key host port)
Generic Function: disconnect-peer (node peer)
Package

bp/net/node.

Source

file-type.lisp.

Methods
Method: disconnect-peer ((node simple-node) (peer peer))
Method: disconnect-peer ((node simple-node) (peer (eql :all)))
Generic Function: handle-message (node peer message)
Package

bp/net/node.

Source

file-type.lisp.

Methods
Method: handle-message ((node simple-node) (peer peer) (message ping-message))
Method: handle-message ((node simple-node) (peer peer) message)
Generic Reader: node-host (object)
Package

bp/net/node.

Methods
Reader Method: node-host ((simple-node simple-node))

automatically generated reader method

Source

file-type.lisp.

Target Slot

host.

Generic Writer: (setf node-host) (object)
Package

bp/net/node.

Methods
Writer Method: (setf node-host) ((simple-node simple-node))

automatically generated writer method

Source

file-type.lisp.

Target Slot

host.

Generic Reader: node-network (object)
Package

bp/net/node.

Methods
Reader Method: node-network ((node node))

automatically generated reader method

Source

file-type.lisp.

Target Slot

network.

Generic Writer: (setf node-network) (object)
Package

bp/net/node.

Methods
Writer Method: (setf node-network) ((node node))

automatically generated writer method

Source

file-type.lisp.

Target Slot

network.

Generic Reader: node-port (object)
Package

bp/net/node.

Methods
Reader Method: node-port ((simple-node simple-node))

automatically generated reader method

Source

file-type.lisp.

Target Slot

port.

Generic Writer: (setf node-port) (object)
Package

bp/net/node.

Methods
Writer Method: (setf node-port) ((simple-node simple-node))

automatically generated writer method

Source

file-type.lisp.

Target Slot

port.

Generic Function: parse (entity-class stream)

Parse bytes from the STREAM into an instance of the class named ENTITY-CLASS.

Package

bp/core/encoding.

Source

file-type.lisp.

Methods
Method: parse ((message-class (eql bp/net/message:blocktxn-message)) stream)
Source

file-type.lisp.

Method: parse ((message-class (eql bp/net/message:getblocktxn-message)) stream)
Source

file-type.lisp.

Method: parse ((message-class (eql bp/net/message:cmpctblock-message)) stream)
Source

file-type.lisp.

Method: parse ((message-class (eql bp/net/message:sendcmpct-message)) stream)
Source

file-type.lisp.

Method: parse ((message-class (eql bp/net/message:feefilter-message)) stream)
Source

file-type.lisp.

Method: parse ((message-class (eql bp/net/message:sendheaders-message)) stream)
Source

file-type.lisp.

Method: parse ((message-class (eql bp/net/message:alert-message)) stream)
Source

file-type.lisp.

Method: parse ((message-class (eql bp/net/message:merkleblock-message)) stream)
Source

file-type.lisp.

Method: parse ((message-class (eql bp/net/message:filterclear-message)) stream)
Source

file-type.lisp.

Method: parse ((message-class (eql bp/net/message:filteradd-message)) stream)
Source

file-type.lisp.

Method: parse ((message-class (eql bp/net/message:filterload-message)) stream)
Source

file-type.lisp.

Method: parse ((message-class (eql bp/net/message:reject-message)) stream)
Source

file-type.lisp.

Method: parse ((message-class (eql bp/net/message:pong-message)) stream)
Source

file-type.lisp.

Method: parse ((message-class (eql bp/net/message:ping-message)) stream)
Source

file-type.lisp.

Method: parse ((message-class (eql bp/net/message:reply-message)) stream)
Source

file-type.lisp.

Method: parse ((message-class (eql bp/net/message:submitorder-message)) stream)
Source

file-type.lisp.

Method: parse ((message-class (eql bp/net/message:checkorder-message)) stream)
Source

file-type.lisp.

Method: parse ((message-class (eql bp/net/message:mempool-message)) stream)
Source

file-type.lisp.

Method: parse ((message-class (eql bp/net/message:getaddr-message)) stream)
Source

file-type.lisp.

Method: parse ((message-class (eql bp/net/message:headers-message)) stream)
Source

file-type.lisp.

Method: parse ((message-class (eql bp/net/message:block-message)) stream)
Source

file-type.lisp.

Method: parse ((message-class (eql bp/net/message:tx-message)) stream)
Source

file-type.lisp.

Method: parse ((message-class (eql bp/net/message:getheaders-message)) stream)
Source

file-type.lisp.

Method: parse ((message-class (eql bp/net/message:getblocks-message)) stream)
Source

file-type.lisp.

Method: parse ((message-class (eql bp/net/message:notfound-message)) stream)
Source

file-type.lisp.

Method: parse ((message-class (eql bp/net/message:getdata-message)) stream)
Source

file-type.lisp.

Method: parse ((message-class (eql bp/net/message:inv-message)) stream)
Source

file-type.lisp.

Method: parse ((message-class (eql bp/net/message:addr-message)) stream)
Source

file-type.lisp.

Method: parse ((message-class (eql bp/net/message:verack-message)) stream)
Source

file-type.lisp.

Method: parse ((message-class (eql bp/net/message:version-message)) stream)
Source

file-type.lisp.

Method: parse ((struct-class (eql bp/net/message:inventory-vector)) stream)
Source

file-type.lisp.

Method: parse ((struct-class (eql bp/net/message:network-address)) stream)
Source

file-type.lisp.

Method: parse ((packet-class (eql bp/net/message:packet)) stream)
Source

file-type.lisp.

Method: parse ((entity-type (eql bp/core/block:cblock)) stream)
Source

file-type.lisp.

Method: parse ((entity-type (eql bp/core/block:block-header)) stream)
Source

file-type.lisp.

Method: parse ((entity-type (eql bp/core/transaction:witness)) stream)
Source

file-type.lisp.

Method: parse ((entity-type (eql bp/core/transaction:txout)) stream)
Source

file-type.lisp.

Method: parse ((entity-type (eql bp/core/transaction:txin)) stream)
Source

file-type.lisp.

Method: parse ((entity-type (eql bp/core/transaction:tx)) stream)
Source

file-type.lisp.

Method: parse ((entity-name (eql bp/core/script:script)) stream)
Source

file-type.lisp.

Generic Function: receive-message (node peer)
Package

bp/net/node.

Source

file-type.lisp.

Methods
Method: receive-message ((node simple-node) (peer peer))
Generic Function: seek-message (node peer message-type)
Package

bp/net/node.

Source

file-type.lisp.

Methods
Method: seek-message ((node simple-node) peer message-type)
Generic Function: send-message (node peer message)
Package

bp/net/node.

Source

file-type.lisp.

Methods
Method: send-message ((node simple-node) (peer peer) message)
Generic Function: serialize (entity stream)

Serialize ENTITY into the stream.

Package

bp/core/encoding.

Source

file-type.lisp.

Methods
Method: serialize ((message blocktxn-message) stream)
Source

file-type.lisp.

Method: serialize ((message getblocktxn-message) stream)
Source

file-type.lisp.

Method: serialize ((message cmpctblock-message) stream)
Source

file-type.lisp.

Method: serialize ((message sendcmpct-message) stream)
Source

file-type.lisp.

Method: serialize ((message feefilter-message) stream)
Source

file-type.lisp.

Method: serialize ((message sendheaders-message) stream)
Source

file-type.lisp.

Method: serialize ((message alert-message) stream)
Source

file-type.lisp.

Method: serialize ((message merkleblock-message) stream)
Source

file-type.lisp.

Method: serialize ((message filterclear-message) stream)
Source

file-type.lisp.

Method: serialize ((message filteradd-message) stream)
Source

file-type.lisp.

Method: serialize ((message filterload-message) stream)
Source

file-type.lisp.

Method: serialize ((message reject-message) stream)
Source

file-type.lisp.

Method: serialize ((message pong-message) stream)
Source

file-type.lisp.

Method: serialize ((message ping-message) stream)
Source

file-type.lisp.

Method: serialize ((message reply-message) stream)
Source

file-type.lisp.

Method: serialize ((message submitorder-message) stream)
Source

file-type.lisp.

Method: serialize ((message checkorder-message) stream)
Source

file-type.lisp.

Method: serialize ((message mempool-message) stream)
Source

file-type.lisp.

Method: serialize ((message getaddr-message) stream)
Source

file-type.lisp.

Method: serialize ((message headers-message) stream)
Source

file-type.lisp.

Method: serialize ((message block-message) stream)
Source

file-type.lisp.

Method: serialize ((message tx-message) stream)
Source

file-type.lisp.

Method: serialize ((message getheaders-message) stream)
Source

file-type.lisp.

Method: serialize ((message getblocks-message) stream)
Source

file-type.lisp.

Method: serialize ((message notfound-message) stream)
Source

file-type.lisp.

Method: serialize ((message getdata-message) stream)
Source

file-type.lisp.

Method: serialize ((message inv-message) stream)
Source

file-type.lisp.

Method: serialize ((message addr-message) stream)
Source

file-type.lisp.

Method: serialize ((message verack-message) stream)
Source

file-type.lisp.

Method: serialize ((message version-message) stream)
Source

file-type.lisp.

Method: serialize ((struct inventory-vector) stream)
Source

file-type.lisp.

Method: serialize ((struct network-address) stream)
Source

file-type.lisp.

Method: serialize ((message packet) stream)
Source

file-type.lisp.

Method: serialize ((cblock cblock) stream)
Source

file-type.lisp.

Method: serialize ((block-header block-header) stream)
Source

file-type.lisp.

Method: serialize ((witness witness) stream)
Source

file-type.lisp.

Method: serialize ((txout txout) stream)
Source

file-type.lisp.

Method: serialize ((txin txin) stream)
Source

file-type.lisp.

Method: serialize ((tx tx) stream)
Source

file-type.lisp.

Method: serialize ((script script) stream)
Source

file-type.lisp.

Generic Reader: unknown-block-hash (condition)
Generic Writer: (setf unknown-block-hash) (condition)
Package

bp/core/chain.

Methods
Reader Method: unknown-block-hash ((condition unknown-block-error))
Writer Method: (setf unknown-block-hash) ((condition unknown-block-error))
Source

file-type.lisp.

Target Slot

hash.

Generic Reader: unknown-block-height (condition)
Generic Writer: (setf unknown-block-height) (condition)
Package

bp/core/chain.

Methods
Reader Method: unknown-block-height ((condition unknown-block-hash-error))
Writer Method: (setf unknown-block-height) ((condition unknown-block-hash-error))
Source

file-type.lisp.

Target Slot

height.

Generic Reader: unknown-transaction-id (condition)
Generic Writer: (setf unknown-transaction-id) (condition)
Package

bp/core/chain.

Methods
Reader Method: unknown-transaction-id ((condition unknown-transaction-error))
Writer Method: (setf unknown-transaction-id) ((condition unknown-transaction-error))
Source

file-type.lisp.

Target Slot

id.

Generic Function: validate (entity &key context)

Validate entity according to the Bitcoin Protocol
consensus rules, throw an error if an entity is invalid for any reason.

Package

bp/core/consensus.

Source

file-type.lisp.

Methods
Method: validate ((txout txout) &key context)
Method: validate ((txin txin) &key context)
Method: validate ((tx tx) &key context)
Method: validate ((cblock cblock) &key context)
Method: validate ((block-header block-header) &key context)

5.1.6 Standalone methods

Method: initialize-instance :after ((object node-connection) &rest args)
Source

file-type.lisp.

Method: initialize-instance :after ((node simple-node) &key peer)
Source

file-type.lisp.

Method: print-object ((script script) stream)
Source

file-type.lisp.

Method: print-object ((condition script-non-standard-error) stream)
Source

file-type.lisp.

Method: print-object ((tx tx) stream)
Source

file-type.lisp.

Method: print-object ((txin txin) stream)
Source

file-type.lisp.

Method: print-object ((witness witness) stream)
Source

file-type.lisp.

Method: print-object ((txout txout) stream)
Source

file-type.lisp.

Method: print-object ((block-header block-header) stream)
Source

file-type.lisp.

Method: print-object ((cblock cblock) stream)
Source

file-type.lisp.


5.1.7 Conditions

Condition: base58check-bad-checksum-error
Package

bp/core/encoding.

Source

file-type.lisp.

Direct superclasses

base58check-checksum-error.

Condition: base58check-checksum-error
Package

bp/core/encoding.

Source

file-type.lisp.

Direct superclasses

checksum-error.

Direct subclasses
Condition: base58check-no-checksum-error
Package

bp/core/encoding.

Source

file-type.lisp.

Direct superclasses

base58check-checksum-error.

Condition: bech32-bad-checksum-error
Package

bp/core/encoding.

Source

file-type.lisp.

Direct superclasses

bech32-checksum-error.

Condition: bech32-checksum-error
Package

bp/core/encoding.

Source

file-type.lisp.

Direct superclasses
Direct subclasses
Condition: bech32-invalid-hrp-character-error
Package

bp/core/encoding.

Source

file-type.lisp.

Direct superclasses

bech32-error.

Direct slots
Slot: character
Package

common-lisp.

Initargs

:character

Condition: bech32-mixed-case-characters-error
Package

bp/core/encoding.

Source

file-type.lisp.

Direct superclasses

bech32-error.

Condition: bech32-no-checksum-error
Package

bp/core/encoding.

Source

file-type.lisp.

Direct superclasses

bech32-checksum-error.

Condition: bech32-no-hrp-error
Package

bp/core/encoding.

Source

file-type.lisp.

Direct superclasses

bech32-error.

Condition: bech32-no-separator-character-error
Package

bp/core/encoding.

Source

file-type.lisp.

Direct superclasses

bech32-error.

Condition: checksum-error
Package

bp/core/encoding.

Source

file-type.lisp.

Direct superclasses

error.

Direct subclasses
Condition: rpc-error
Package

bp/rpc/all.

Source

file-type.lisp.

Direct superclasses

http-error.

Direct slots
Slot: format-string
Initform

(quote "rpc connection error: rpc code ~a (~a)")

Condition: unknown-block-error
Package

bp/core/chain.

Source

file-type.lisp.

Direct superclasses

unknown-entity-error.

Direct methods
Direct slots
Slot: hash
Initargs

:hash

Readers

unknown-block-hash.

Writers

(setf unknown-block-hash).

Condition: unknown-block-hash-error
Package

bp/core/chain.

Source

file-type.lisp.

Direct superclasses

unknown-entity-error.

Direct methods
Direct slots
Slot: height
Initargs

:height

Readers

unknown-block-height.

Writers

(setf unknown-block-height).

Condition: unknown-entity-error
Package

bp/core/chain.

Source

file-type.lisp.

Direct superclasses

simple-error.

Direct subclasses
Condition: unknown-transaction-error
Package

bp/core/chain.

Source

file-type.lisp.

Direct superclasses

unknown-entity-error.

Direct subclasses

transaction-not-available-error.

Direct methods
Direct slots
Slot: id
Initargs

:id

Readers

unknown-transaction-id.

Writers

(setf unknown-transaction-id).


Next: , Previous: , Up: Public Interface   [Contents][Index]

5.1.8 Structures

Structure: addr-message
Package

bp/net/message.

Source

file-type.lisp.

Direct superclasses

structure-object.

Direct methods

serialize.

Structure: alert-message
Package

bp/net/message.

Source

file-type.lisp.

Direct superclasses

structure-object.

Direct methods

serialize.

Structure: block-header
Package

bp/core/block.

Source

file-type.lisp.

Direct superclasses

structure-object.

Direct methods
Direct slots
Slot: version
Readers

block-header-version.

Writers

(setf block-header-version).

Slot: previous-block-hash
Readers

block-header-previous-block-hash.

Writers

(setf block-header-previous-block-hash).

Slot: merkle-root
Readers

block-header-merkle-root.

Writers

(setf block-header-merkle-root).

Slot: timestamp
Readers

block-header-timestamp.

Writers

(setf block-header-timestamp).

Slot: bits
Readers

block-header-bits.

Writers

(setf block-header-bits).

Slot: nonce
Readers

block-header-nonce.

Writers

(setf block-header-nonce).

Structure: block-message
Package

bp/net/message.

Source

file-type.lisp.

Direct superclasses

structure-object.

Direct methods

serialize.

Direct slots
Slot: block
Package

common-lisp.

Readers

block-message-block.

Writers

(setf block-message-block).

Structure: blocktxn-message
Package

bp/net/message.

Source

file-type.lisp.

Direct superclasses

structure-object.

Direct methods

serialize.

Structure: cblock
Package

bp/core/block.

Source

file-type.lisp.

Direct superclasses

structure-object.

Direct methods
Direct slots
Slot: header
Readers

block-header.

Writers

(setf block-header).

Slot: transactions
Readers

block-transactions.

Writers

(setf block-transactions).

Structure: checkorder-message
Package

bp/net/message.

Source

file-type.lisp.

Direct superclasses

structure-object.

Direct methods

serialize.

Structure: cmpctblock-message
Package

bp/net/message.

Source

file-type.lisp.

Direct superclasses

structure-object.

Direct methods

serialize.

Structure: feefilter-message
Package

bp/net/message.

Source

file-type.lisp.

Direct superclasses

structure-object.

Direct methods

serialize.

Structure: filteradd-message
Package

bp/net/message.

Source

file-type.lisp.

Direct superclasses

structure-object.

Direct methods

serialize.

Structure: filterclear-message
Package

bp/net/message.

Source

file-type.lisp.

Direct superclasses

structure-object.

Direct methods

serialize.

Structure: filterload-message
Package

bp/net/message.

Source

file-type.lisp.

Direct superclasses

structure-object.

Direct methods

serialize.

Structure: getaddr-message
Package

bp/net/message.

Source

file-type.lisp.

Direct superclasses

structure-object.

Direct methods

serialize.

Structure: getblocks-message
Package

bp/net/message.

Source

file-type.lisp.

Direct superclasses

structure-object.

Direct methods

serialize.

Structure: getblocktxn-message
Package

bp/net/message.

Source

file-type.lisp.

Direct superclasses

structure-object.

Direct methods

serialize.

Structure: getdata-message
Package

bp/net/message.

Source

file-type.lisp.

Direct superclasses

structure-object.

Direct methods

serialize.

Direct slots
Slot: inventory
Readers

getdata-message-inventory.

Writers

(setf getdata-message-inventory).

Structure: getheaders-message
Package

bp/net/message.

Source

file-type.lisp.

Direct superclasses

structure-object.

Direct methods

serialize.

Structure: headers-message
Package

bp/net/message.

Source

file-type.lisp.

Direct superclasses

structure-object.

Direct methods

serialize.

Structure: inv-message
Package

bp/net/message.

Source

file-type.lisp.

Direct superclasses

structure-object.

Direct methods

serialize.

Direct slots
Slot: inventory
Readers

inv-message-inventory.

Writers

(setf inv-message-inventory).

Structure: inventory-vector
Package

bp/net/message.

Source

file-type.lisp.

Direct superclasses

structure-object.

Direct methods

serialize.

Direct slots
Slot: type
Package

common-lisp.

Readers

inventory-vector-type.

Writers

(setf inventory-vector-type).

Slot: hash
Readers

inventory-vector-hash.

Writers

(setf inventory-vector-hash).

Structure: key
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Direct superclasses

structure-object.

Direct slots
Slot: bytes
Readers

key-bytes.

Writers

(setf key-bytes).

Structure: mempool-message
Package

bp/net/message.

Source

file-type.lisp.

Direct superclasses

structure-object.

Direct methods

serialize.

Structure: merkle-tree-node
Package

bp/core/merkletree.

Source

file-type.lisp.

Direct superclasses

structure-object.

Direct slots
Slot: hash
Readers

merkle-tree-node-hash.

Writers

(setf merkle-tree-node-hash).

Slot: left
Readers

merkle-tree-node-left.

Writers

(setf merkle-tree-node-left).

Slot: right
Readers

merkle-tree-node-right.

Writers

(setf merkle-tree-node-right).

Structure: merkleblock-message
Package

bp/net/message.

Source

file-type.lisp.

Direct superclasses

structure-object.

Direct methods

serialize.

Structure: network-address
Package

bp/net/message.

Source

file-type.lisp.

Direct superclasses

structure-object.

Direct methods

serialize.

Direct slots
Slot: timestamp
Readers

network-address-timestamp.

Writers

(setf network-address-timestamp).

Slot: services
Readers

network-address-services.

Writers

(setf network-address-services).

Slot: address
Readers

network-address-address.

Writers

(setf network-address-address).

Slot: port
Readers

network-address-port.

Writers

(setf network-address-port).

Structure: notfound-message
Package

bp/net/message.

Source

file-type.lisp.

Direct superclasses

structure-object.

Direct methods

serialize.

Direct slots
Slot: inventory
Readers

notfound-message-inventory.

Writers

(setf notfound-message-inventory).

Structure: packet
Package

bp/net/message.

Source

file-type.lisp.

Direct superclasses

structure-object.

Direct methods

serialize.

Direct slots
Slot: magic
Readers

packet-magic.

Writers

(setf packet-magic).

Slot: command
Readers

packet-command.

Writers

(setf packet-command).

Slot: length
Package

common-lisp.

Readers

packet-length.

Writers

(setf packet-length).

Slot: checksum
Readers

packet-checksum.

Writers

(setf packet-checksum).

Slot: payload
Readers

packet-payload.

Writers

(setf packet-payload).

Structure: ping-message
Package

bp/net/message.

Source

file-type.lisp.

Direct superclasses

structure-object.

Direct methods
Direct slots
Slot: nonce
Readers

ping-message-nonce.

Writers

(setf ping-message-nonce).

Structure: pong-message
Package

bp/net/message.

Source

file-type.lisp.

Direct superclasses

structure-object.

Direct methods

serialize.

Direct slots
Slot: nonce
Readers

pong-message-nonce.

Writers

(setf pong-message-nonce).

Structure: pubkey
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Direct superclasses

structure-object.

Direct slots
Slot: bytes
Readers

pubkey-bytes.

Writers

(setf pubkey-bytes).

Structure: reject-message
Package

bp/net/message.

Source

file-type.lisp.

Direct superclasses

structure-object.

Direct methods

serialize.

Structure: reply-message
Package

bp/net/message.

Source

file-type.lisp.

Direct superclasses

structure-object.

Direct methods

serialize.

Structure: script
Package

bp/core/script.

Source

file-type.lisp.

Direct superclasses

structure-object.

Direct methods
Direct slots
Slot: commands
Readers

script-commands.

Writers

(setf script-commands).

Structure: sendcmpct-message
Package

bp/net/message.

Source

file-type.lisp.

Direct superclasses

structure-object.

Direct methods

serialize.

Structure: sendheaders-message
Package

bp/net/message.

Source

file-type.lisp.

Direct superclasses

structure-object.

Direct methods

serialize.

Structure: signature
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Direct superclasses

structure-object.

Direct slots
Slot: bytes
Readers

signature-bytes.

Writers

(setf signature-bytes).

Structure: submitorder-message
Package

bp/net/message.

Source

file-type.lisp.

Direct superclasses

structure-object.

Direct methods

serialize.

Structure: tx
Package

bp/core/transaction.

Source

file-type.lisp.

Direct superclasses

structure-object.

Direct methods
Direct slots
Slot: version
Readers

tx-version.

Writers

(setf tx-version).

Slot: inputs
Readers

tx-inputs.

Writers

(setf tx-inputs).

Slot: outputs
Readers

tx-outputs.

Writers

(setf tx-outputs).

Slot: witnesses
Readers

tx-witnesses.

Writers

(setf tx-witnesses).

Slot: locktime
Readers

tx-locktime.

Writers

(setf tx-locktime).

Structure: tx-message
Package

bp/net/message.

Source

file-type.lisp.

Direct superclasses

structure-object.

Direct methods

serialize.

Direct slots
Slot: tx
Package

bp/core/transaction.

Readers

tx-message-tx.

Writers

(setf tx-message-tx).

Structure: txin
Package

bp/core/transaction.

Source

file-type.lisp.

Direct superclasses

structure-object.

Direct methods
Direct slots
Slot: previous-tx-id
Readers

txin-previous-tx-id.

Writers

(setf txin-previous-tx-id).

Slot: previous-tx-index
Readers

txin-previous-tx-index.

Writers

(setf txin-previous-tx-index).

Slot: script-sig
Readers

txin-script-sig.

Writers

(setf txin-script-sig).

Slot: sequence
Package

common-lisp.

Readers

txin-sequence.

Writers

(setf txin-sequence).

Structure: txout
Package

bp/core/transaction.

Source

file-type.lisp.

Direct superclasses

structure-object.

Direct methods
Direct slots
Slot: amount
Readers

txout-amount.

Writers

(setf txout-amount).

Slot: script-pubkey
Readers

txout-script-pubkey.

Writers

(setf txout-script-pubkey).

Structure: verack-message
Package

bp/net/message.

Source

file-type.lisp.

Direct superclasses

structure-object.

Direct methods

serialize.

Structure: version-message
Package

bp/net/message.

Source

file-type.lisp.

Direct superclasses

structure-object.

Direct methods

serialize.

Direct slots
Slot: version
Readers

version-message-version.

Writers

(setf version-message-version).

Slot: services
Readers

version-message-services.

Writers

(setf version-message-services).

Slot: timestamp
Readers

version-message-timestamp.

Writers

(setf version-message-timestamp).

Slot: receiver-address
Readers

version-message-receiver-address.

Writers

(setf version-message-receiver-address).

Slot: sender-address
Readers

version-message-sender-address.

Writers

(setf version-message-sender-address).

Slot: nonce
Readers

version-message-nonce.

Writers

(setf version-message-nonce).

Slot: user-agent
Readers

version-message-user-agent.

Writers

(setf version-message-user-agent).

Slot: height
Readers

version-message-height.

Writers

(setf version-message-height).

Slot: relayp
Readers

version-message-relayp.

Writers

(setf version-message-relayp).

Structure: witness
Package

bp/core/transaction.

Source

file-type.lisp.

Direct superclasses

structure-object.

Direct methods
Direct slots
Slot: items
Readers

witness-items.

Writers

(setf witness-items).


Previous: , Up: Public Interface   [Contents][Index]

5.1.9 Classes

Class: chain-supplier
Package

bp/core/chain.

Source

file-type.lisp.

Direct subclasses

node-rpc-connection.

Direct methods
Direct slots
Slot: network

Network marker (one of :MAINNET, :TESTNET, :REGTEST).

Initform

:mainnet

Initargs

:network

Readers

chain-supplier-network.

Writers

(setf chain-supplier-network).

Class: node
Package

bp/net/node.

Source

file-type.lisp.

Direct subclasses

simple-node.

Direct methods
Direct slots
Slot: network
Package

bp/core/chain.

Initform

:mainnet

Initargs

:network

Readers

node-network.

Writers

(setf node-network).

Class: node-connection
Package

bp/core/all.

Source

file-type.lisp.

Direct superclasses

node-rpc-connection.

Direct methods

initialize-instance.

Class: node-rpc-connection
Package

bp/rpc/all.

Source

file-type.lisp.

Direct superclasses
Direct subclasses

node-connection.

Direct methods
Class: simple-node

Simple Bitcoin network node communicating with a single peer via peer-2-peer gossip protocol.

Package

bp/net/node.

Source

file-type.lisp.

Direct superclasses

node.

Direct methods
Direct slots
Slot: host
Initargs

:host

Readers

node-host.

Writers

(setf node-host).

Slot: port
Initform

bp/net/parameters:+bp-network-port+

Initargs

:port

Readers

node-port.

Writers

(setf node-port).

Slot: peer
Readers

node-peer.

Writers

(setf node-peer).

Class: validation-context

Structure for storing additional information needed during entity validation.

Package

bp/core/consensus.

Source

file-type.lisp.

Direct methods
Direct slots
Slot: height
Initargs

:height

Readers

@height.

Writers

(setf @height).

Slot: cblock
Package

bp/core/block.

Initargs

:block

Readers

@block.

Writers

(setf @block).

Slot: tx
Package

bp/core/transaction.

Initargs

:tx

Readers

@tx.

Writers

(setf @tx).

Slot: tx-index
Initargs

:tx-index

Readers

@tx-index.

Writers

(setf @tx-index).

Slot: txin
Package

bp/core/transaction.

Initargs

:txin

Readers

@txin.

Writers

(setf @txin).

Slot: txin-index
Initargs

:txin-index

Readers

@txin-index.

Writers

(setf @txin-index).

Slot: txout
Package

bp/core/transaction.

Initargs

:txout

Readers

@txout.

Writers

(setf @txout).

Slot: txout-index
Initargs

:txout-index

Readers

@txout-index.

Writers

(setf @txout-index).


5.2 Internals


Next: , Previous: , Up: Internals   [Contents][Index]

5.2.1 Constants

Constant: +bech32-encoding-constant+
Package

bp/core/encoding.

Source

file-type.lisp.

Constant: +bech32m-encoding-constant+
Package

bp/core/encoding.

Source

file-type.lisp.

Constant: +secp256k1-context-none+
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Constant: +secp256k1-context-sign+
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Constant: +secp256k1-context-verify+
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Constant: +secp256k1-ec-compressed+
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Constant: +secp256k1-ec-uncompressed+
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Constant: +secp256k1-flags-bit-compression+
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Constant: +secp256k1-flags-bit-context-sign+
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Constant: +secp256k1-flags-bit-context-verify+
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Constant: +secp256k1-flags-type-compression+
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Constant: +secp256k1-flags-type-context+
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Constant: +secp256k1-flags-type-mask+
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Constant: +secp256k1-tag-pubkey-even+
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Constant: +secp256k1-tag-pubkey-hybrid-even+
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Constant: +secp256k1-tag-pubkey-hybrid-odd+
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Constant: +secp256k1-tag-pubkey-odd+
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Constant: +secp256k1-tag-pubkey-uncompressed+
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Constant: +sighash-all+
Package

bp/core/consensus.

Source

file-type.lisp.

Constant: +sighash-anyonecanpay+
Package

bp/core/consensus.

Source

file-type.lisp.

Constant: +sighash-none+
Package

bp/core/consensus.

Source

file-type.lisp.

Constant: +sighash-single+
Package

bp/core/consensus.

Source

file-type.lisp.


Next: , Previous: , Up: Internals   [Contents][Index]

5.2.2 Special variables

Special Variable: *context-none*
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Special Variable: *context-sign*
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Special Variable: *context-verify*
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Special Variable: *dns-seed*

DNS seed is a list of hardcoded host names for Bitcoin nodes that can accept new connections when bootstrapping new nodes.

Package

bp/net/address.

Source

file-type.lisp.

Special Variable: *message-commands*

Mapping from message types (symbols) to message commands (strings).

Package

bp/net/message.

Source

file-type.lisp.

Special Variable: *message-types*

Mapping from commands (strings) to message types (symbols).

Package

bp/net/message.

Source

file-type.lisp.

Special Variable: *opcodes-by-code*

Table mapping opcodes to pairs (<list of opcode-names> . <function>).

Package

bp/core/script.

Source

file-type.lisp.

Special Variable: *opcodes-by-name*

Table mapping opcode names to pairs (<code> . <function>).

Package

bp/core/script.

Source

file-type.lisp.

Special Variable: *print-script-as-assembly*

If non-NIL, the script will be printed without Lisp object wrapping.

Package

bp/core/script.

Source

file-type.lisp.


5.2.3 Macros

Macro: bytes-from-foreign (bytes pointer size)
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Macro: bytes-to-foreign (bytes pointer size)
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Macro: define-alphabet (name &body charset)

Define two functions for encoding/decoding digits of a given encoding scheme named <NAME>-ENCODE-DIGIT and <NAME>-DECODE-DIGIT respective.

Package

bp/core/encoding.

Source

file-type.lisp.

Macro: define-disabled-opcode (op-name op-code op-hex-code (&rest args) &body doc)
Package

bp/core/script.

Source

file-type.lisp.

Macro: define-opcode (op-name op-code op-hex-code (&rest args) &body doc)

Define opcode function named OP-NAME for a given OP-CODE. OP-HEX-CODE is ignored and used only for documentation purposes.

Package

bp/core/script.

Source

file-type.lisp.

Macro: define-opcode-alias (new-op-name old-op-name)
Package

bp/core/script.

Source

file-type.lisp.

Macro: define-opcode-range ((op-name-prefix op-name-start op-name-end) (op-code-start op-code-end) (op-hex-code-start op-hex-code-end) (&rest args) &body body)
Package

bp/core/script.

Source

file-type.lisp.

Macro: defmessage (name (&rest options) &body slots)
Package

bp/net/message.

Source

file-type.lisp.

Macro: ensure-validation-context ((context-sym) &body body)

Ensure CONTEXT-SYM is bound to the VALIDATION-CONTEXT object before executing the BODY.

Package

bp/core/consensus.

Source

file-type.lisp.

Macro: ignore-rpc-errors (&body body)
Package

bp/rpc/all.

Source

file-type.lisp.


Next: , Previous: , Up: Internals   [Contents][Index]

5.2.4 Ordinary functions

Function: %make-key (&key bytes)
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Function: %make-pubkey (&key bytes)
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Function: %make-signature (&key bytes)
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Reader: @altstack (instance)
Writer: (setf @altstack) (instance)
Package

bp/core/script.

Source

file-type.lisp.

Target Slot

altstack.

Reader: @commands (instance)
Writer: (setf @commands) (instance)
Package

bp/core/script.

Source

file-type.lisp.

Target Slot

commands.

Reader: @conditions (instance)
Writer: (setf @conditions) (instance)
Package

bp/core/script.

Source

file-type.lisp.

Target Slot

conditions.

Reader: @discard (instance)
Writer: (setf @discard) (instance)
Package

bp/core/script.

Source

file-type.lisp.

Target Slot

discard.

Function: @execp (state op)

A command is considered executable if current branch is an executable one (i.e. the current code path does not contain false conditions), or it is a branching command.

For this purpose, OP_IF pushes its condition to CONDITIONS stack in script state (OP_NOTIF pushes an inverted condition), OP_ELSE inverts the top condition in CONDITIONS, while OP_ENDIF simply pops the top condition. For OP_ELSE/OP_ENDIF commands, empty CONDITIONS stack means that the branching construction is unbalanced.

This follows the implementation of script interpreter in Bitcoin Core.

Package

bp/core/script.

Source

file-type.lisp.

Function: @sighash (state hashtype)
Package

bp/core/script.

Source

file-type.lisp.

Reader: @sighashf (instance)
Writer: (setf @sighashf) (instance)
Package

bp/core/script.

Source

file-type.lisp.

Target Slot

sighashf.

Reader: @sigversion (instance)
Writer: (setf @sigversion) (instance)
Package

bp/core/script.

Source

file-type.lisp.

Target Slot

sigversion.

Reader: @stack (instance)
Writer: (setf @stack) (instance)
Package

bp/core/script.

Source

file-type.lisp.

Target Slot

stack.

Reader: @witness (instance)
Writer: (setf @witness) (instance)
Package

bp/core/script.

Source

file-type.lisp.

Target Slot

witness.

Function: addr-message-p (object)
Package

bp/net/message.

Source

file-type.lisp.

Function: alert-message-p (object)
Package

bp/net/message.

Source

file-type.lisp.

Function: base58-decode-digit (c)
Package

bp/core/encoding.

Source

file-type.lisp.

Function: base58-encode-digit (n)
Package

bp/core/encoding.

Source

file-type.lisp.

Function: bech32*-decode (string)
Package

bp/core/encoding.

Source

file-type.lisp.

Function: bech32*-encode (encoding hrp data)
Package

bp/core/encoding.

Source

file-type.lisp.

Function: bech32-compute-checksum (encoding hrp data)
Package

bp/core/encoding.

Source

file-type.lisp.

Function: bech32-decode-digit (c)
Package

bp/core/encoding.

Source

file-type.lisp.

Function: bech32-encode-digit (n)
Package

bp/core/encoding.

Source

file-type.lisp.

Function: bech32-hrp-expand (s)
Package

bp/core/encoding.

Source

file-type.lisp.

Function: bech32-polymod (values)
Package

bp/core/encoding.

Source

file-type.lisp.

Function: bech32-verify-checksum (hrp data)

Verify checksum using the both Bech32 and Bech32m constants. Return the detected encoding or NIL if neither match.

Package

bp/core/encoding.

Source

file-type.lisp.

Function: bits-to-target (bits)
Package

bp/core/consensus.

Source

file-type.lisp.

Function: block-difficulty (block)
Package

bp/core/consensus.

Source

file-type.lisp.

Function: block-fee (block)
Package

bp/core/consensus.

Source

file-type.lisp.

Reader: block-header-bits (instance)
Writer: (setf block-header-bits) (instance)
Package

bp/core/block.

Source

file-type.lisp.

Target Slot

bits.

Reader: block-header-merkle-root (instance)
Writer: (setf block-header-merkle-root) (instance)
Package

bp/core/block.

Source

file-type.lisp.

Target Slot

merkle-root.

Reader: block-header-nonce (instance)
Writer: (setf block-header-nonce) (instance)
Package

bp/core/block.

Source

file-type.lisp.

Target Slot

nonce.

Function: block-header-p (object)
Package

bp/core/block.

Source

file-type.lisp.

Reader: block-header-previous-block-hash (instance)
Writer: (setf block-header-previous-block-hash) (instance)
Package

bp/core/block.

Source

file-type.lisp.

Target Slot

previous-block-hash.

Reader: block-header-timestamp (instance)
Writer: (setf block-header-timestamp) (instance)
Package

bp/core/block.

Source

file-type.lisp.

Target Slot

timestamp.

Reader: block-header-version (instance)
Writer: (setf block-header-version) (instance)
Package

bp/core/block.

Source

file-type.lisp.

Target Slot

version.

Function: block-message-p (object)
Package

bp/net/message.

Source

file-type.lisp.

Function: block-target (block)
Package

bp/core/consensus.

Source

file-type.lisp.

Function: blocktxn-message-p (object)
Package

bp/net/message.

Source

file-type.lisp.

Function: cblock-p (object)
Package

bp/core/block.

Source

file-type.lisp.

Function: checkorder-message-p (object)
Package

bp/net/message.

Source

file-type.lisp.

Function: cmpctblock-message-p (object)
Package

bp/net/message.

Source

file-type.lisp.

Function: command-from-bytes (bytes)
Package

bp/net/message.

Source

file-type.lisp.

Function: command-number (command)

If a given script command is a simple integer data push command, return the corresponding integer, otherwise return ‘nil‘.

Package

bp/core/script.

Source

file-type.lisp.

Function: command-opcode (command)
Package

bp/core/script.

Source

file-type.lisp.

Function: command-payload (command)
Package

bp/core/script.

Source

file-type.lisp.

Function: command-payload-length (command)
Package

bp/core/script.

Source

file-type.lisp.

Function: command-push-p (command)
Package

bp/core/script.

Source

file-type.lisp.

Function: command-pushdata-p (command)
Package

bp/core/script.

Source

file-type.lisp.

Function: command-simple-p (command)
Package

bp/core/script.

Source

file-type.lisp.

Function: command-to-bytes (command)
Package

bp/net/message.

Source

file-type.lisp.

Function: command-unexpected-end-p (command)
Package

bp/core/script.

Source

file-type.lisp.

Function: convert-bits (values from-bits to-bits padp output-fn)

Convert from one power-of-2 number base to another. Feed each digit to the function OUTPUT-FN. We only need this to work for octets for now. A direct translation from Bitcoin Core’s ‘ConvertBits‘ function in ‘util/strencoding.h‘.

Package

bp/core/encoding.

Source

file-type.lisp.

Function: copy-addr-message (instance)
Package

bp/net/message.

Source

file-type.lisp.

Function: copy-alert-message (instance)
Package

bp/net/message.

Source

file-type.lisp.

Function: copy-block-header (instance)
Package

bp/core/block.

Source

file-type.lisp.

Function: copy-block-message (instance)
Package

bp/net/message.

Source

file-type.lisp.

Function: copy-blocktxn-message (instance)
Package

bp/net/message.

Source

file-type.lisp.

Function: copy-cblock (instance)
Package

bp/core/block.

Source

file-type.lisp.

Function: copy-checkorder-message (instance)
Package

bp/net/message.

Source

file-type.lisp.

Function: copy-cmpctblock-message (instance)
Package

bp/net/message.

Source

file-type.lisp.

Function: copy-feefilter-message (instance)
Package

bp/net/message.

Source

file-type.lisp.

Function: copy-filteradd-message (instance)
Package

bp/net/message.

Source

file-type.lisp.

Function: copy-filterclear-message (instance)
Package

bp/net/message.

Source

file-type.lisp.

Function: copy-filterload-message (instance)
Package

bp/net/message.

Source

file-type.lisp.

Function: copy-getaddr-message (instance)
Package

bp/net/message.

Source

file-type.lisp.

Function: copy-getblocks-message (instance)
Package

bp/net/message.

Source

file-type.lisp.

Function: copy-getblocktxn-message (instance)
Package

bp/net/message.

Source

file-type.lisp.

Function: copy-getdata-message (instance)
Package

bp/net/message.

Source

file-type.lisp.

Function: copy-getheaders-message (instance)
Package

bp/net/message.

Source

file-type.lisp.

Function: copy-headers-message (instance)
Package

bp/net/message.

Source

file-type.lisp.

Function: copy-inv-message (instance)
Package

bp/net/message.

Source

file-type.lisp.

Function: copy-inventory-vector (instance)
Package

bp/net/message.

Source

file-type.lisp.

Function: copy-key (instance)
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Function: copy-mempool-message (instance)
Package

bp/net/message.

Source

file-type.lisp.

Function: copy-merkle-tree-node (instance)
Package

bp/core/merkletree.

Source

file-type.lisp.

Function: copy-merkleblock-message (instance)
Package

bp/net/message.

Source

file-type.lisp.

Function: copy-network-address (instance)
Package

bp/net/message.

Source

file-type.lisp.

Function: copy-notfound-message (instance)
Package

bp/net/message.

Source

file-type.lisp.

Function: copy-packet (instance)
Package

bp/net/message.

Source

file-type.lisp.

Function: copy-peer (instance)
Package

bp/net/node.

Source

file-type.lisp.

Function: copy-ping-message (instance)
Package

bp/net/message.

Source

file-type.lisp.

Function: copy-pong-message (instance)
Package

bp/net/message.

Source

file-type.lisp.

Function: copy-pubkey (instance)
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Function: copy-reject-message (instance)
Package

bp/net/message.

Source

file-type.lisp.

Function: copy-reply-message (instance)
Package

bp/net/message.

Source

file-type.lisp.

Function: copy-script (instance)
Package

bp/core/script.

Source

file-type.lisp.

Function: copy-script-state (instance)
Package

bp/core/script.

Source

file-type.lisp.

Function: copy-sendcmpct-message (instance)
Package

bp/net/message.

Source

file-type.lisp.

Function: copy-sendheaders-message (instance)
Package

bp/net/message.

Source

file-type.lisp.

Function: copy-signature (instance)
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Function: copy-submitorder-message (instance)
Package

bp/net/message.

Source

file-type.lisp.

Function: copy-tx (instance)
Package

bp/core/transaction.

Source

file-type.lisp.

Function: copy-tx-message (instance)
Package

bp/net/message.

Source

file-type.lisp.

Function: copy-txin (instance)
Package

bp/core/transaction.

Source

file-type.lisp.

Function: copy-txout (instance)
Package

bp/core/transaction.

Source

file-type.lisp.

Function: copy-verack-message (instance)
Package

bp/net/message.

Source

file-type.lisp.

Function: copy-version-message (instance)
Package

bp/net/message.

Source

file-type.lisp.

Function: copy-witness (instance)
Package

bp/core/transaction.

Source

file-type.lisp.

Function: do-simple-rpc-call (connection method &rest arguments)
Package

bp/rpc/all.

Source

file-type.lisp.

Function: ecdsa-signature-parse-der-lax (input)

This function is taken from the libsecp256k1 distribution and implements DER parsing for ECDSA signatures, while supporting an arbitrary subset of format violations (see Bitcoin’s pubkey.cpp).

Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Function: execute-p2sh (script-pubkey &key state)
Package

bp/core/script.

Source

file-type.lisp.

Function: execute-p2wpkh (script-pubkey &key state)
Package

bp/core/script.

Source

file-type.lisp.

Function: execute-p2wsh (script-pubkey &key state)
Package

bp/core/script.

Source

file-type.lisp.

Function: extend-validation-context (context &key height block tx tx-index txin txin-index txout txout-index)

Create a new VALIDATION-CONTEXT object from the given one and extend it with additional data if supplied.

Package

bp/core/consensus.

Source

file-type.lisp.

Function: feefilter-message-p (object)
Package

bp/net/message.

Source

file-type.lisp.

Function: filteradd-message-p (object)
Package

bp/net/message.

Source

file-type.lisp.

Function: filterclear-message-p (object)
Package

bp/net/message.

Source

file-type.lisp.

Function: filterload-message-p (object)
Package

bp/net/message.

Source

file-type.lisp.

Function: get-transaction-output (id index)

Get txout described by its transaction ID and output index. Will signal an error if the transaction is unknown or does not have the output with given index. Assumes chain supplier context.

Package

bp/core/consensus.

Source

file-type.lisp.

Function: getaddr-message-p (object)
Package

bp/net/message.

Source

file-type.lisp.

Function: getblocks-message-p (object)
Package

bp/net/message.

Source

file-type.lisp.

Function: getblocktxn-message-p (object)
Package

bp/net/message.

Source

file-type.lisp.

Function: getdata-message-p (object)
Package

bp/net/message.

Source

file-type.lisp.

Function: getheaders-message-p (object)
Package

bp/net/message.

Source

file-type.lisp.

Function: headers-message-p (object)
Package

bp/net/message.

Source

file-type.lisp.

Function: inv-message-p (object)
Package

bp/net/message.

Source

file-type.lisp.

Function: inventory-vector-p (object)
Package

bp/net/message.

Source

file-type.lisp.

Reader: key-bytes (instance)
Writer: (setf key-bytes) (instance)
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Target Slot

bytes.

Function: key-p (object)
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Function: make-adjustable-byte-array (length)
Package

bp/core/encoding.

Source

file-type.lisp.

Function: make-block-header (&key version previous-block-hash merkle-root timestamp bits nonce)
Package

bp/core/block.

Source

file-type.lisp.

Function: make-cblock (&key header transactions)
Package

bp/core/block.

Source

file-type.lisp.

Function: make-command (op &key payload payload-length)

Make a new command. Argument ‘payload‘ should only be provided for ‘OP_PUSH*‘ and ‘OP_PUSHDATA*‘ commands, argument ‘payload-length‘ - only for ‘OP_PUSHDATA*‘ commands.

Package

bp/core/script.

Source

file-type.lisp.

Function: make-displaced-byte-array (bytes)
Package

bp/core/encoding.

Source

file-type.lisp.

Function: make-merkle-tree-node (&key hash left right)
Package

bp/core/merkletree.

Source

file-type.lisp.

Function: make-peer (&key host port connection version services timestamp user-agent height)
Package

bp/net/node.

Source

file-type.lisp.

Function: make-tx (&key version inputs outputs witnesses locktime)
Package

bp/core/transaction.

Source

file-type.lisp.

Function: make-txin (&key previous-tx-id previous-tx-index script-sig sequence)
Package

bp/core/transaction.

Source

file-type.lisp.

Function: make-txout (&key amount script-pubkey)
Package

bp/core/transaction.

Source

file-type.lisp.

Function: make-witness (&key items)
Package

bp/core/transaction.

Source

file-type.lisp.

Function: mempool-message-p (object)
Package

bp/net/message.

Source

file-type.lisp.

Reader: merkle-tree-node-left (instance)
Writer: (setf merkle-tree-node-left) (instance)
Package

bp/core/merkletree.

Source

file-type.lisp.

Target Slot

left.

Function: merkle-tree-node-p (object)
Package

bp/core/merkletree.

Source

file-type.lisp.

Reader: merkle-tree-node-right (instance)
Writer: (setf merkle-tree-node-right) (instance)
Package

bp/core/merkletree.

Source

file-type.lisp.

Target Slot

right.

Function: merkleblock-message-p (object)
Package

bp/net/message.

Source

file-type.lisp.

Function: network-address-p (object)
Package

bp/net/message.

Source

file-type.lisp.

Function: notfound-message-p (object)
Package

bp/net/message.

Source

file-type.lisp.

Function: null-data-p (script-pubkey)

Check if given SCRIPT-PUBKEY is a NULL DATA script.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_0 (state)

An empty array of bytes is pushed onto the stack. (This is not a no-op: an item is added to the stack.)

Package

bp/core/script.

Source

file-type.lisp.

Function: op_0notequal (state)

Returns 0 if the input is 0. 1 otherwise.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_1 (state)

The number 1 is pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_10 (state)

The number in the word name (2-16) is pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_11 (state)

The number in the word name (2-16) is pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_12 (state)

The number in the word name (2-16) is pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_13 (state)

The number in the word name (2-16) is pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_14 (state)

The number in the word name (2-16) is pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_15 (state)

The number in the word name (2-16) is pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_16 (state)

The number in the word name (2-16) is pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_1add (state)

1 is added to the input.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_1negate (state)

The number -1 is pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_1sub (state)

1 is subtracted from the input.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_2 (state)

The number in the word name (2-16) is pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_2div (state)

The input is divided by 2.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_2drop (state)

Removes the top two stack items.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_2dup (state)

Duplicates the top two stack items.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_2mul (state)

The input is multiplied by 2.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_2over (state)

Copies the pair of items two spaces back in the stack to the front.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_2rot (state)

The fifth and sixth items back are moved to the top of the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_2swap (state)

Swaps the top two pairs of items.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_3 (state)

The number in the word name (2-16) is pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_3dup (state)

Duplicates the top three stack items.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_4 (state)

The number in the word name (2-16) is pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_5 (state)

The number in the word name (2-16) is pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_6 (state)

The number in the word name (2-16) is pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_7 (state)

The number in the word name (2-16) is pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_8 (state)

The number in the word name (2-16) is pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_9 (state)

The number in the word name (2-16) is pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_abs (state)

The input is made positive.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_add (state)

a is added to b.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_and (state)

Boolean and between each bit in the inputs.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_booland (state)

If both a and b are not 0, the output is 1. Otherwise 0.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_boolor (state)

If a or b is not 0, the output is 1. Otherwise 0.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_cat (state)

Concatenates two strings.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_checklocktimeverify (state)

Marks transaction as invalid if the top stack item is greater than the transaction’s nLockTime field, otherwise script evaluation continues as though an OP_NOP was executed. Transaction is also invalid if 1. the stack is empty; or 2. the top stack item is negative; or 3. the top stack item is greater than or equal to 500000000 while the transaction’s nLockTime field is less than 500000000, or vice versa; or 4. the input’s nSequence field is equal to #xffffffff. The precise semantics are described in BIP 0065.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_checkmultisig (state)

Compares the first signature against each public key until it finds an ECDSA match. Starting with the subsequent public key, it compares the second signature against each remaining public key until it finds an ECDSA match. The process is repeated until all signatures have been checked or not enough public keys remain to produce a successful result. All signatures need to match a public key. Because public keys are not checked again if they fail any signature comparison, signatures must be placed in the scriptSig using the same order as their corresponding public keys were placed in the scriptPubKey or redeemScript. If all signatures are valid, 1 is returned, 0 otherwise. Due to a bug, one extra unused value is removed from the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_checkmultisigverify (state)

Same as OP_CHECKMULTISIG, but OP_VERIFY is executed afterward.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_checksequenceverify (state)

Marks transaction as invalid if the relative lock time of the input (enforced by BIP 0068 with nSequence) is not equal to or longer than the value of the top stack item. The precise semantics are described in BIP 0112.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_checksig (state)

The entire transaction’s outputs, inputs, and script (from the most recently-executed OP_CODESEPARATOR to the end) are hashed. The signature used by OP_CHECKSIG must be a valid signature for this hash and public key. If it is, 1 is returned, 0 otherwise.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_checksigverify (state)

Same as OP_CHECKSIG, but OP_VERIFY is executed afterward.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_codeseparator (state)

All of the signature checking words will only match signatures to the data after the most recently-executed OP_CODESEPARATOR.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_depth (state)

Puts the number of stack items onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_div (state)

a is divided by b.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_drop (state)

Removes the top stack item.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_dup (state)

Duplicates the top stack item.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_else (state)

If the preceding OP_IF or OP_NOTIF or OP_ELSE was not executed then these statements are and if the preceding OP_IF or OP_NOTIF or OP_ELSE was executed then these statements are not. See @EXECP for more details on how branching works.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_endif (state)

Ends an if/else block. All blocks must end, or the transaction is invalid. An OP_ENDIF without OP_IF earlier is also invalid. See @EXECP for more details on how branching works.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_equal (state)

Returns 1 if the inputs are exactly equal, 0 otherwise.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_equalverify (state)

Same as OP_EQUAL, but runs OP_VERIFY afterward.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_fromaltstack (state)

Puts the input onto the top of the main stack. Removes it from the alt stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_greaterthan (state)

Returns 1 if a is greater than b, 0 otherwise.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_greaterthanorequal (state)

Returns 1 if a is greater than or equal to b, 0 otherwise.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_hash160 (state)

The input is hashed twice: first with SHA-256 and then with RIPEMD-160.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_hash256 (state)

The input is hashed two times with SHA-256.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_if (state)

If the top stack value is not False, the statements are
executed. The top stack value is removed. See @EXECP for more details on how branching works.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_ifdup (state)

If the top stack value is not 0, duplicate it.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_invalidopcode (state)

Matches any opcode that is not yet assigned.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_invert (state)

Flips all of the bits in the input.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_left (state)

Keeps only characters left of the specified point in a string.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_lessthan (state)

Returns 1 if a is less than b, 0 otherwise.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_lessthanorequal (state)

Returns 1 if a is less than or equal to b, 0 otherwise.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_lshift (state)

Shifts a left b bits, preserving sign.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_max (state)

Returns the larger of a and b.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_min (state)

Returns the smaller of a and b.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_mod (state)

Returns the remainder after dividing a by b.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_mul (state)

a is multiplied by b.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_negate (state)

The sign of the input is flipped.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_nip (state)

Removes the second-to-top stack item.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_nop (state)

Does nothing.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_nop1 (state)

The word is ignored. Does not mark transaction as invalid.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_nop10 (state)

The word is ignored. Does not mark transaction as invalid.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_nop4 (state)

The word is ignored. Does not mark transaction as invalid.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_nop5 (state)

The word is ignored. Does not mark transaction as invalid.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_nop6 (state)

The word is ignored. Does not mark transaction as invalid.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_nop7 (state)

The word is ignored. Does not mark transaction as invalid.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_nop8 (state)

The word is ignored. Does not mark transaction as invalid.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_nop9 (state)

The word is ignored. Does not mark transaction as invalid.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_not (state)

If the input is 0 or 1, it is flipped. Otherwise the output will be 0.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_notif (state)

If the top stack value is False, the statements are executed. The top stack value is removed. See @EXECP for more details on how branching works.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_numequal (state)

Returns 1 if the numbers are equal, 0 otherwise.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_numequalverify (state)

Same as OP_NUMEQUAL, but runs OP_VERIFY afterward.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_numnotequal (state)

Returns 1 if the numbers are not equal, 0 otherwise.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_or (state)

Boolean or between each bit in the inputs.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_over (state)

Copies the second-to-top stack item to the top.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_pick (state)

The item n back in the stack is copied to the top.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_pubkey (state)

Represents a public key compatible with OP_CHECKSIG.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_pubkeyhash (state)

Represents a public key hashed with OP_HASH160.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_push1 (state)

The next opcode bytes is data to be pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_push10 (state)

The next opcode bytes is data to be pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_push11 (state)

The next opcode bytes is data to be pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_push12 (state)

The next opcode bytes is data to be pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_push13 (state)

The next opcode bytes is data to be pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_push14 (state)

The next opcode bytes is data to be pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_push15 (state)

The next opcode bytes is data to be pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_push16 (state)

The next opcode bytes is data to be pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_push17 (state)

The next opcode bytes is data to be pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_push18 (state)

The next opcode bytes is data to be pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_push19 (state)

The next opcode bytes is data to be pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_push2 (state)

The next opcode bytes is data to be pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_push20 (state)

The next opcode bytes is data to be pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_push21 (state)

The next opcode bytes is data to be pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_push22 (state)

The next opcode bytes is data to be pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_push23 (state)

The next opcode bytes is data to be pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_push24 (state)

The next opcode bytes is data to be pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_push25 (state)

The next opcode bytes is data to be pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_push26 (state)

The next opcode bytes is data to be pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_push27 (state)

The next opcode bytes is data to be pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_push28 (state)

The next opcode bytes is data to be pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_push29 (state)

The next opcode bytes is data to be pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_push3 (state)

The next opcode bytes is data to be pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_push30 (state)

The next opcode bytes is data to be pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_push31 (state)

The next opcode bytes is data to be pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_push32 (state)

The next opcode bytes is data to be pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_push33 (state)

The next opcode bytes is data to be pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_push34 (state)

The next opcode bytes is data to be pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_push35 (state)

The next opcode bytes is data to be pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_push36 (state)

The next opcode bytes is data to be pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_push37 (state)

The next opcode bytes is data to be pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_push38 (state)

The next opcode bytes is data to be pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_push39 (state)

The next opcode bytes is data to be pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_push4 (state)

The next opcode bytes is data to be pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_push40 (state)

The next opcode bytes is data to be pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_push41 (state)

The next opcode bytes is data to be pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_push42 (state)

The next opcode bytes is data to be pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_push43 (state)

The next opcode bytes is data to be pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_push44 (state)

The next opcode bytes is data to be pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_push45 (state)

The next opcode bytes is data to be pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_push46 (state)

The next opcode bytes is data to be pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_push47 (state)

The next opcode bytes is data to be pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_push48 (state)

The next opcode bytes is data to be pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_push49 (state)

The next opcode bytes is data to be pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_push5 (state)

The next opcode bytes is data to be pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_push50 (state)

The next opcode bytes is data to be pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_push51 (state)

The next opcode bytes is data to be pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_push52 (state)

The next opcode bytes is data to be pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_push53 (state)

The next opcode bytes is data to be pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_push54 (state)

The next opcode bytes is data to be pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_push55 (state)

The next opcode bytes is data to be pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_push56 (state)

The next opcode bytes is data to be pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_push57 (state)

The next opcode bytes is data to be pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_push58 (state)

The next opcode bytes is data to be pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_push59 (state)

The next opcode bytes is data to be pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_push6 (state)

The next opcode bytes is data to be pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_push60 (state)

The next opcode bytes is data to be pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_push61 (state)

The next opcode bytes is data to be pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_push62 (state)

The next opcode bytes is data to be pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_push63 (state)

The next opcode bytes is data to be pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_push64 (state)

The next opcode bytes is data to be pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_push65 (state)

The next opcode bytes is data to be pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_push66 (state)

The next opcode bytes is data to be pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_push67 (state)

The next opcode bytes is data to be pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_push68 (state)

The next opcode bytes is data to be pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_push69 (state)

The next opcode bytes is data to be pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_push7 (state)

The next opcode bytes is data to be pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_push70 (state)

The next opcode bytes is data to be pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_push71 (state)

The next opcode bytes is data to be pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_push72 (state)

The next opcode bytes is data to be pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_push73 (state)

The next opcode bytes is data to be pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_push74 (state)

The next opcode bytes is data to be pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_push75 (state)

The next opcode bytes is data to be pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_push8 (state)

The next opcode bytes is data to be pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_push9 (state)

The next opcode bytes is data to be pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_pushdata1 (state)

The next byte contains the number of bytes to be pushed onto the stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_pushdata2 (state)

The next two bytes contain the number of bytes to be pushed onto the stack in little endian order.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_pushdata4 (state)

The next four bytes contain the number of bytes to be pushed onto the stack in little endian order.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_reserved (state)

Transaction is invalid unless occuring in an unexecuted OP_IF branch.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_reserved1 (state)

Transaction is invalid unless occuring in an unexecuted OP_IF branch.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_reserved2 (state)

Transaction is invalid unless occuring in an unexecuted OP_IF branch.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_return (state)

Marks transaction as invalid. Since bitcoin 0.9, a standard way of attaching extra data to transactions is to add a zero-value output with a scriptPubKey consisting of OP_RETURN followed by data. Such outputs are provably unspendable and specially discarded from storage in the UTXO set, reducing their cost to the network. Since 0.12, standard relay rules allow a single output with OP_RETURN, that contains any sequence of push statements (or OP_RESERVED[1]) after the OP_RETURN provided the total scriptPubKey length is at most 83 bytes.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_right (state)

Keeps only characters right of the specified point in a string.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_ripemd160 (state)

The input is hashed using RIPEMD-160.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_roll (state)

The item n back in the stack is moved to the top.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_rot (state)

The top three items on the stack are rotated to the left.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_rshift (state)

Shifts a right b bits, preserving sign.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_sha1 (state)

The input is hashed using SHA-1.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_sha256 (state)

The input is hashed using SHA-256.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_size (state)

Pushes the string length of the top element of the stack (without popping it).

Package

bp/core/script.

Source

file-type.lisp.

Function: op_sub (state)

b is subtracted from a.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_substr (state)

Returns a section of a string.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_swap (state)

The top two items on the stack are swapped.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_toaltstack (state)

Puts the input onto the top of the alt stack. Removes it from the main stack.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_tuck (state)

The item at the top of the stack is copied and inserted before the second-to-top item.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_unknown186 (state)

Unknown opcode. Used for handling coinbase input scripts.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_unknown187 (state)

Unknown opcode. Used for handling coinbase input scripts.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_unknown188 (state)

Unknown opcode. Used for handling coinbase input scripts.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_unknown189 (state)

Unknown opcode. Used for handling coinbase input scripts.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_unknown190 (state)

Unknown opcode. Used for handling coinbase input scripts.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_unknown191 (state)

Unknown opcode. Used for handling coinbase input scripts.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_unknown192 (state)

Unknown opcode. Used for handling coinbase input scripts.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_unknown193 (state)

Unknown opcode. Used for handling coinbase input scripts.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_unknown194 (state)

Unknown opcode. Used for handling coinbase input scripts.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_unknown195 (state)

Unknown opcode. Used for handling coinbase input scripts.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_unknown196 (state)

Unknown opcode. Used for handling coinbase input scripts.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_unknown197 (state)

Unknown opcode. Used for handling coinbase input scripts.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_unknown198 (state)

Unknown opcode. Used for handling coinbase input scripts.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_unknown199 (state)

Unknown opcode. Used for handling coinbase input scripts.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_unknown200 (state)

Unknown opcode. Used for handling coinbase input scripts.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_unknown201 (state)

Unknown opcode. Used for handling coinbase input scripts.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_unknown202 (state)

Unknown opcode. Used for handling coinbase input scripts.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_unknown203 (state)

Unknown opcode. Used for handling coinbase input scripts.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_unknown204 (state)

Unknown opcode. Used for handling coinbase input scripts.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_unknown205 (state)

Unknown opcode. Used for handling coinbase input scripts.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_unknown206 (state)

Unknown opcode. Used for handling coinbase input scripts.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_unknown207 (state)

Unknown opcode. Used for handling coinbase input scripts.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_unknown208 (state)

Unknown opcode. Used for handling coinbase input scripts.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_unknown209 (state)

Unknown opcode. Used for handling coinbase input scripts.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_unknown210 (state)

Unknown opcode. Used for handling coinbase input scripts.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_unknown211 (state)

Unknown opcode. Used for handling coinbase input scripts.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_unknown212 (state)

Unknown opcode. Used for handling coinbase input scripts.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_unknown213 (state)

Unknown opcode. Used for handling coinbase input scripts.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_unknown214 (state)

Unknown opcode. Used for handling coinbase input scripts.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_unknown215 (state)

Unknown opcode. Used for handling coinbase input scripts.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_unknown216 (state)

Unknown opcode. Used for handling coinbase input scripts.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_unknown217 (state)

Unknown opcode. Used for handling coinbase input scripts.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_unknown218 (state)

Unknown opcode. Used for handling coinbase input scripts.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_unknown219 (state)

Unknown opcode. Used for handling coinbase input scripts.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_unknown220 (state)

Unknown opcode. Used for handling coinbase input scripts.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_unknown221 (state)

Unknown opcode. Used for handling coinbase input scripts.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_unknown222 (state)

Unknown opcode. Used for handling coinbase input scripts.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_unknown223 (state)

Unknown opcode. Used for handling coinbase input scripts.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_unknown224 (state)

Unknown opcode. Used for handling coinbase input scripts.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_unknown225 (state)

Unknown opcode. Used for handling coinbase input scripts.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_unknown226 (state)

Unknown opcode. Used for handling coinbase input scripts.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_unknown227 (state)

Unknown opcode. Used for handling coinbase input scripts.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_unknown228 (state)

Unknown opcode. Used for handling coinbase input scripts.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_unknown229 (state)

Unknown opcode. Used for handling coinbase input scripts.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_unknown230 (state)

Unknown opcode. Used for handling coinbase input scripts.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_unknown231 (state)

Unknown opcode. Used for handling coinbase input scripts.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_unknown232 (state)

Unknown opcode. Used for handling coinbase input scripts.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_unknown233 (state)

Unknown opcode. Used for handling coinbase input scripts.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_unknown234 (state)

Unknown opcode. Used for handling coinbase input scripts.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_unknown235 (state)

Unknown opcode. Used for handling coinbase input scripts.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_unknown236 (state)

Unknown opcode. Used for handling coinbase input scripts.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_unknown237 (state)

Unknown opcode. Used for handling coinbase input scripts.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_unknown238 (state)

Unknown opcode. Used for handling coinbase input scripts.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_unknown239 (state)

Unknown opcode. Used for handling coinbase input scripts.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_unknown240 (state)

Unknown opcode. Used for handling coinbase input scripts.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_unknown241 (state)

Unknown opcode. Used for handling coinbase input scripts.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_unknown242 (state)

Unknown opcode. Used for handling coinbase input scripts.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_unknown243 (state)

Unknown opcode. Used for handling coinbase input scripts.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_unknown244 (state)

Unknown opcode. Used for handling coinbase input scripts.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_unknown245 (state)

Unknown opcode. Used for handling coinbase input scripts.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_unknown246 (state)

Unknown opcode. Used for handling coinbase input scripts.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_unknown247 (state)

Unknown opcode. Used for handling coinbase input scripts.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_unknown248 (state)

Unknown opcode. Used for handling coinbase input scripts.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_unknown249 (state)

Unknown opcode. Used for handling coinbase input scripts.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_unknown250 (state)

Unknown opcode. Used for handling coinbase input scripts.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_unknown251 (state)

Unknown opcode. Used for handling coinbase input scripts.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_unknown252 (state)

Unknown opcode. Used for handling coinbase input scripts.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_ver (state)

Transaction is invalid unless occuring in an unexecuted OP_IF branch.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_verif (state)

Transaction is invalid even when occuring in an unexecuted OP_IF branch.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_verify (state)

Marks transaction as invalid if top stack value is not true. The top stack value is removed.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_vernotif (state)

Transaction is invalid even when occuring in an unexecuted OP_IF branch.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_within (state)

Returns 1 if x is within the specified range (left-inclusive), 0 otherwise.

Package

bp/core/script.

Source

file-type.lisp.

Function: op_xor (state)

Boolean exclusive or between each bit in the inputs.

Package

bp/core/script.

Source

file-type.lisp.

Function: opcode (opcode/name)

For a given OPCODE/NAME return (VALUES <code> <function>) if OPCODE/NAME is a keyword, and (VALUES <list of names> <function>) otherwise.

Package

bp/core/script.

Source

file-type.lisp.

Function: p2ms-p (script-pubkey)

Check if given SCRIPT-PUBKEY indicates a standard obsolete p2ms pattern:
OP_<N>
<key 1>
...
<key M>
OP_<M>
OP_CHECKMULTISIG

Package

bp/core/script.

Source

file-type.lisp.

Function: p2pk-p (script-pubkey)

Check if given SCRIPT-PUBKEY indicates a standard obsolete p2pk pattern:
<pubkkey>
OP_CHECKSIG

Package

bp/core/script.

Source

file-type.lisp.

Function: p2pkh-p (script-pubkey)

Check if current SCRIPT-PUBKEY indicates a standard p2pkh pattern: OP_DUP
OP_HASH160
<hash160>
OP_EQUALVERIFY
OP_CHECKSIG

Package

bp/core/script.

Source

file-type.lisp.

Function: p2sh-p (script-pubkey)

Check if current SCRIPT-PUBKEY indicates the BIP 0016 (p2sh) pattern:
<redeem-script>
OP_HASH160
<hash160>
OP_EQUAL

Package

bp/core/script.

Source

file-type.lisp.

Function: p2wpkh-p (script-pubkey)

Check if given SCRIPT-PUBKEY indicates a Pay to Witness Public Key Hash script structure:
<version-byte>
<20-byte witness-program>

Package

bp/core/script.

Source

file-type.lisp.

Function: p2wsh-p (script-pubkey)

Check if given SCRIPT-PUBKEY indicates a Pay to Witness Script Hash script structure:
<version-byte>
<32-byte witness-program>

Package

bp/core/script.

Source

file-type.lisp.

Reader: packet-length (instance)
Writer: (setf packet-length) (instance)
Package

bp/net/message.

Source

file-type.lisp.

Target Slot

length.

Function: packet-p (object)
Package

bp/net/message.

Source

file-type.lisp.

Reader: peer-connection (instance)
Writer: (setf peer-connection) (instance)
Package

bp/net/node.

Source

file-type.lisp.

Target Slot

connection.

Reader: peer-height (instance)
Writer: (setf peer-height) (instance)
Package

bp/net/node.

Source

file-type.lisp.

Target Slot

height.

Reader: peer-host (instance)
Writer: (setf peer-host) (instance)
Package

bp/net/node.

Source

file-type.lisp.

Target Slot

host.

Function: peer-p (object)
Package

bp/net/node.

Source

file-type.lisp.

Reader: peer-port (instance)
Writer: (setf peer-port) (instance)
Package

bp/net/node.

Source

file-type.lisp.

Target Slot

port.

Reader: peer-services (instance)
Writer: (setf peer-services) (instance)
Package

bp/net/node.

Source

file-type.lisp.

Target Slot

services.

Reader: peer-timestamp (instance)
Writer: (setf peer-timestamp) (instance)
Package

bp/net/node.

Source

file-type.lisp.

Target Slot

timestamp.

Reader: peer-user-agent (instance)
Writer: (setf peer-user-agent) (instance)
Package

bp/net/node.

Source

file-type.lisp.

Target Slot

user-agent.

Reader: peer-version (instance)
Writer: (setf peer-version) (instance)
Package

bp/net/node.

Source

file-type.lisp.

Target Slot

version.

Function: perform-handshake (node peer)
Package

bp/net/node.

Source

file-type.lisp.

Function: ping-message-p (object)
Package

bp/net/message.

Source

file-type.lisp.

Function: pong-message-p (object)
Package

bp/net/message.

Source

file-type.lisp.

Function: print-script-execution-state (current-command state)
Package

bp/core/script.

Source

file-type.lisp.

Reader: pubkey-bytes (instance)
Writer: (setf pubkey-bytes) (instance)
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Target Slot

bytes.

Function: pubkey-p (object)
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Function: read-message (network stream)
Package

bp/net/node.

Source

file-type.lisp.

Function: read-num-inputs-or-segwit-flag (stream)

If currently parsed transaction is a SegWit one, it will have SegWit marker and flag fields (0x00 0x01) bytes after its version field instead of the number of inputs, so this function reads a varint and if it is 0x00, verifies that the next byte is 0x01. Returns list (<number-of-inputs> <segwit-flag>), where <segwit-flag> is the value of the flag (0x01) if transaction is SegWit, or NIL otherwise.

Package

bp/core/transaction.

Source

file-type.lisp.

Function: register-opcode (code name &optional function)
Package

bp/core/script.

Source

file-type.lisp.

Function: reject-message-p (object)
Package

bp/net/message.

Source

file-type.lisp.

Function: reply-message-p (object)
Package

bp/net/message.

Source

file-type.lisp.

Function: script-p (object)
Package

bp/core/script.

Source

file-type.lisp.

Function: script-sigversion (script)

For non-SegWit transactions, signature version is represented as constant :BASE, and for SegWit ones - :WITNESS-V<N>, where N is the first op of the witness script pubkey.

Package

bp/core/script.

Source

file-type.lisp.

Function: script-state-p (object)
Package

bp/core/script.

Source

file-type.lisp.

Function: secp256k1-context-clone (ctx)
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Function: secp256k1-context-create (flags)
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Function: secp256k1-context-destroy (ctx)
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Function: secp256k1-context-randomize (ctx seed32)
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Function: secp256k1-ec-privkey-negate (ctx seckey)
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Function: secp256k1-ec-privkey-tweak-add (ctx seckey tweak)
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Function: secp256k1-ec-privkey-tweak-mul (ctx seckey tweak)
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Function: secp256k1-ec-pubkey-combine (ctx out ins n)
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Function: secp256k1-ec-pubkey-create (ctx pubkey seckey)
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Function: secp256k1-ec-pubkey-negate (ctx pubkey)
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Function: secp256k1-ec-pubkey-parse (ctx pubkey input inputlen)
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Function: secp256k1-ec-pubkey-serialize (ctx output outputlen pubkey flags)
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Function: secp256k1-ec-pubkey-tweak-add (ctx pubkey tweak)
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Function: secp256k1-ec-pubkey-tweak-mul (ctx pubkey tweak)
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Function: secp256k1-ec-seckey-verify (ctx seckey)
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Function: secp256k1-ecdsa-sign (ctx sig msg32 seckey noncefp ndata)
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Function: secp256k1-ecdsa-signature-normalize (ctx sigout sigin)
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Function: secp256k1-ecdsa-signature-parse-compact (ctx sig input64)
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Function: secp256k1-ecdsa-signature-parse-der (ctx sig input inputlen)
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Function: secp256k1-ecdsa-signature-serialize-compact (ctx output64 sig)
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Function: secp256k1-ecdsa-signature-serialize-der (ctx output outputlen sig)
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Function: secp256k1-ecdsa-verify (ctx sig msg32 pubkey)
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Function: secp256k1-scratch-space-create (ctx max-size)
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Function: secp256k1-scratch-space-destroy (scratch)
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Function: segwit-p (script-pubkey)

Check if given SCRIPT-PUBKEY indicates the BIP 0141 (Segregated Witness) structure:
<version-byte> (1 byte, OP_{0..16}) <witness-program> (2-40 bytes)

Package

bp/core/script.

Source

file-type.lisp.

Function: sendcmpct-message-p (object)
Package

bp/net/message.

Source

file-type.lisp.

Function: sendheaders-message-p (object)
Package

bp/net/message.

Source

file-type.lisp.

Reader: signature-bytes (instance)
Writer: (setf signature-bytes) (instance)
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Target Slot

bytes.

Function: signature-p (object)
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Function: submitorder-message-p (object)
Package

bp/net/message.

Source

file-type.lisp.

Function: tx-coinbase (tx)

Assume transaction TX is a coinbase transaction and extract its coinbase field (first input). Signal error if there is more then one input.

Package

bp/core/consensus.

Source

file-type.lisp.

Function: tx-fee (tx)
Package

bp/core/consensus.

Source

file-type.lisp.

Function: tx-message-p (object)
Package

bp/net/message.

Source

file-type.lisp.

Function: tx-outputs-hash (tx txin-index sighash-type)
Package

bp/core/consensus.

Source

file-type.lisp.

Function: tx-p (object)
Package

bp/core/transaction.

Source

file-type.lisp.

Function: tx-previous-outputs-hash (tx sighash-type)
Package

bp/core/consensus.

Source

file-type.lisp.

Function: tx-sequence-hash (tx sighash-type)
Package

bp/core/consensus.

Source

file-type.lisp.

Function: tx-sighash (tx txin-index amount script-code sighash-type sigversion)
Package

bp/core/consensus.

Source

file-type.lisp.

Function: tx-sighash-base (tx txin-index script-code sighash-type)
Package

bp/core/consensus.

Source

file-type.lisp.

Function: tx-sighash-witness-v0 (tx txin-index amount script-code sighash-type)

Compute sighash for version 0 witness transactions in BIP-0143 (see the spec at https://github.com/bitcoin/bips/blob/master/bip-0143.mediawiki).

Package

bp/core/consensus.

Source

file-type.lisp.

Function: txin-amount (txin)

Get the amount of the txout corresponding to the given txin. Assumes chain supplier context.

Package

bp/core/consensus.

Source

file-type.lisp.

Function: txin-p (object)
Package

bp/core/transaction.

Source

file-type.lisp.

Function: txout-p (object)
Package

bp/core/transaction.

Source

file-type.lisp.

Function: verack-message-p (object)
Package

bp/net/message.

Source

file-type.lisp.

Function: version-message-p (object)
Package

bp/net/message.

Source

file-type.lisp.

Function: witness-p (object)
Package

bp/core/transaction.

Source

file-type.lisp.

Function: write-message (network message stream)
Package

bp/net/node.

Source

file-type.lisp.


Next: , Previous: , Up: Internals   [Contents][Index]

5.2.5 Generic functions

Generic Reader: @block (object)
Package

bp/core/consensus.

Methods
Reader Method: @block ((validation-context validation-context))

automatically generated reader method

Source

file-type.lisp.

Target Slot

cblock.

Generic Writer: (setf @block) (object)
Package

bp/core/consensus.

Methods
Writer Method: (setf @block) ((validation-context validation-context))

automatically generated writer method

Source

file-type.lisp.

Target Slot

cblock.

Generic Reader: @height (object)
Package

bp/core/consensus.

Methods
Reader Method: @height ((validation-context validation-context))

automatically generated reader method

Source

file-type.lisp.

Target Slot

height.

Generic Writer: (setf @height) (object)
Package

bp/core/consensus.

Methods
Writer Method: (setf @height) ((validation-context validation-context))

automatically generated writer method

Source

file-type.lisp.

Target Slot

height.

Generic Reader: @tx (object)
Package

bp/core/consensus.

Methods
Reader Method: @tx ((validation-context validation-context))

automatically generated reader method

Source

file-type.lisp.

Target Slot

tx.

Generic Writer: (setf @tx) (object)
Package

bp/core/consensus.

Methods
Writer Method: (setf @tx) ((validation-context validation-context))

automatically generated writer method

Source

file-type.lisp.

Target Slot

tx.

Generic Reader: @tx-index (object)
Package

bp/core/consensus.

Methods
Reader Method: @tx-index ((validation-context validation-context))

automatically generated reader method

Source

file-type.lisp.

Target Slot

tx-index.

Generic Writer: (setf @tx-index) (object)
Package

bp/core/consensus.

Methods
Writer Method: (setf @tx-index) ((validation-context validation-context))

automatically generated writer method

Source

file-type.lisp.

Target Slot

tx-index.

Generic Reader: @txin (object)
Package

bp/core/consensus.

Methods
Reader Method: @txin ((validation-context validation-context))

automatically generated reader method

Source

file-type.lisp.

Target Slot

txin.

Generic Writer: (setf @txin) (object)
Package

bp/core/consensus.

Methods
Writer Method: (setf @txin) ((validation-context validation-context))

automatically generated writer method

Source

file-type.lisp.

Target Slot

txin.

Generic Reader: @txin-index (object)
Package

bp/core/consensus.

Methods
Reader Method: @txin-index ((validation-context validation-context))

automatically generated reader method

Source

file-type.lisp.

Target Slot

txin-index.

Generic Writer: (setf @txin-index) (object)
Package

bp/core/consensus.

Methods
Writer Method: (setf @txin-index) ((validation-context validation-context))

automatically generated writer method

Source

file-type.lisp.

Target Slot

txin-index.

Generic Reader: @txout (object)
Package

bp/core/consensus.

Methods
Reader Method: @txout ((validation-context validation-context))

automatically generated reader method

Source

file-type.lisp.

Target Slot

txout.

Generic Writer: (setf @txout) (object)
Package

bp/core/consensus.

Methods
Writer Method: (setf @txout) ((validation-context validation-context))

automatically generated writer method

Source

file-type.lisp.

Target Slot

txout.

Generic Reader: @txout-index (object)
Package

bp/core/consensus.

Methods
Reader Method: @txout-index ((validation-context validation-context))

automatically generated reader method

Source

file-type.lisp.

Target Slot

txout-index.

Generic Writer: (setf @txout-index) (object)
Package

bp/core/consensus.

Methods
Writer Method: (setf @txout-index) ((validation-context validation-context))

automatically generated writer method

Source

file-type.lisp.

Target Slot

txout-index.

Generic Function: chain-network (supplier)

Return keyword representing the given SUPPLIER’s network (one of :MAINNET, :TESTNET, :REGTEST).

Package

bp/core/chain.

Source

file-type.lisp.

Methods
Method: chain-network (supplier)
Generic Reader: chain-supplier-network (object)
Generic Writer: (setf chain-supplier-network) (object)
Package

bp/core/chain.

Methods
Reader Method: chain-supplier-network ((chain-supplier chain-supplier))
Writer Method: (setf chain-supplier-network) ((chain-supplier chain-supplier))

Network marker (one of :MAINNET, :TESTNET, :REGTEST).

Source

file-type.lisp.

Target Slot

network.

Generic Reader: connection-error-code (condition)
Package

bp/rpc/all.

Methods
Reader Method: connection-error-code ((condition connection-error))
Source

file-type.lisp.

Target Slot

code.

Generic Reader: connection-error-message (condition)
Package

bp/rpc/all.

Methods
Reader Method: connection-error-message ((condition connection-error))
Source

file-type.lisp.

Target Slot

message.

Generic Reader: node-peer (object)
Package

bp/net/node.

Methods
Reader Method: node-peer ((simple-node simple-node))

automatically generated reader method

Source

file-type.lisp.

Target Slot

peer.

Generic Writer: (setf node-peer) (object)
Package

bp/net/node.

Methods
Writer Method: (setf node-peer) ((simple-node simple-node))

automatically generated writer method

Source

file-type.lisp.

Target Slot

peer.

Generic Reader: rpc-connection-password (object)
Package

bp/rpc/all.

Methods
Reader Method: rpc-connection-password ((rpc-connection rpc-connection))

automatically generated reader method

Source

file-type.lisp.

Target Slot

password.

Generic Writer: (setf rpc-connection-password) (object)
Package

bp/rpc/all.

Methods
Writer Method: (setf rpc-connection-password) ((rpc-connection rpc-connection))

automatically generated writer method

Source

file-type.lisp.

Target Slot

password.

Generic Reader: rpc-connection-url (object)
Package

bp/rpc/all.

Methods
Reader Method: rpc-connection-url ((rpc-connection rpc-connection))

automatically generated reader method

Source

file-type.lisp.

Target Slot

url.

Generic Writer: (setf rpc-connection-url) (object)
Package

bp/rpc/all.

Methods
Writer Method: (setf rpc-connection-url) ((rpc-connection rpc-connection))

automatically generated writer method

Source

file-type.lisp.

Target Slot

url.

Generic Reader: rpc-connection-username (object)
Package

bp/rpc/all.

Methods
Reader Method: rpc-connection-username ((rpc-connection rpc-connection))

automatically generated reader method

Source

file-type.lisp.

Target Slot

username.

Generic Writer: (setf rpc-connection-username) (object)
Package

bp/rpc/all.

Methods
Writer Method: (setf rpc-connection-username) ((rpc-connection rpc-connection))

automatically generated writer method

Source

file-type.lisp.

Target Slot

username.

Generic Reader: script-error-script (condition)
Generic Writer: (setf script-error-script) (condition)
Package

bp/core/script.

Methods
Reader Method: script-error-script ((condition script-error))
Writer Method: (setf script-error-script) ((condition script-error))
Source

file-type.lisp.

Target Slot

script.


Next: , Previous: , Up: Internals   [Contents][Index]

5.2.6 Conditions

Condition: bech32-error
Package

bp/core/encoding.

Source

file-type.lisp.

Direct superclasses

condition.

Direct subclasses
Condition: connection-error
Package

bp/rpc/all.

Source

file-type.lisp.

Direct superclasses

simple-error.

Direct subclasses

http-error.

Direct methods
Direct slots
Slot: code
Initargs

:code

Readers

connection-error-code.

Writers

This slot is read-only.

Slot: message
Initargs

:message

Readers

connection-error-message.

Writers

This slot is read-only.

Slot: format-string
Allocation

:class

Initform

(quote "connection error: code ~a~@[ (~a)~]")

Condition: http-error
Package

bp/rpc/all.

Source

file-type.lisp.

Direct superclasses

connection-error.

Direct subclasses

rpc-error.

Direct slots
Slot: format-string
Initform

(quote "http connection error: http status ~a (~a)")

Condition: script-error
Package

bp/core/script.

Source

file-type.lisp.

Direct superclasses

error.

Direct subclasses

script-non-standard-error.

Direct methods
Direct slots
Slot: script
Initargs

:script

Readers

script-error-script.

Writers

(setf script-error-script).

Condition: script-non-standard-error
Package

bp/core/script.

Source

file-type.lisp.

Direct superclasses

script-error.

Direct methods

print-object.

Condition: transaction-not-available-error

NOTFOUND response to +IV-MSG-TX+ GETDATA message
means that the transaction that was requested is either unknown or is not present in mempool or relay-set, so this error is more precise than UNKNOWN-TRANSACTION-ERROR.

Package

bp/net/node.

Source

file-type.lisp.

Direct superclasses

unknown-transaction-error.


Next: , Previous: , Up: Internals   [Contents][Index]

5.2.7 Structures

Structure: peer
Package

bp/net/node.

Source

file-type.lisp.

Direct superclasses

structure-object.

Direct methods
Direct slots
Slot: host
Readers

peer-host.

Writers

(setf peer-host).

Slot: port
Readers

peer-port.

Writers

(setf peer-port).

Slot: connection
Readers

peer-connection.

Writers

(setf peer-connection).

Slot: version
Readers

peer-version.

Writers

(setf peer-version).

Slot: services
Readers

peer-services.

Writers

(setf peer-services).

Slot: timestamp
Readers

peer-timestamp.

Writers

(setf peer-timestamp).

Slot: user-agent
Readers

peer-user-agent.

Writers

(setf peer-user-agent).

Slot: height
Readers

peer-height.

Writers

(setf peer-height).

Structure: script-state
Package

bp/core/script.

Source

file-type.lisp.

Direct superclasses

structure-object.

Direct slots
Slot: commands
Readers

@commands.

Writers

(setf @commands).

Slot: discard
Readers

@discard.

Writers

(setf @discard).

Slot: stack
Readers

@stack.

Writers

(setf @stack).

Slot: altstack
Readers

@altstack.

Writers

(setf @altstack).

Slot: conditions
Readers

@conditions.

Writers

(setf @conditions).

Slot: witness
Readers

@witness.

Writers

(setf @witness).

Slot: sighashf
Readers

@sighashf.

Writers

(setf @sighashf).

Slot: sigversion
Readers

@sigversion.

Writers

(setf @sigversion).


Previous: , Up: Internals   [Contents][Index]

5.2.8 Classes

Class: rpc-connection

RPC-CONNECTION is a simple generic client for the RPC server.

Package

bp/rpc/all.

Source

file-type.lisp.

Direct subclasses

node-rpc-connection.

Direct methods
Direct slots
Slot: url
Initargs

:url

Readers

rpc-connection-url.

Writers

(setf rpc-connection-url).

Slot: username
Initargs

:username

Readers

rpc-connection-username.

Writers

(setf rpc-connection-username).

Slot: password
Initargs

:password

Readers

rpc-connection-password.

Writers

(setf rpc-connection-password).

Class: secp256k1-ecdsa-signature-tclass
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Direct superclasses
  • foreign-struct-type.
  • translatable-foreign-type.
Class: secp256k1-pubkey-tclass
Package

bp/crypto/secp256k1.

Source

file-type.lisp.

Direct superclasses
  • foreign-struct-type.
  • translatable-foreign-type.