# Functions
NewAlert returns an new Alert with values provided.
NewAlertFromPayload returns an Alert with values deserialized from the serialized payload.
NewBlockHeader returns a new BlockHeader using the provided version, previous block hash, merkle root hash, difficulty bits, and nonce used to generate the block with defaults for the remaining fields.
NewInvVect returns a new InvVect using the provided type and hash.
NewMerkleProof creates a new merkle proof with a specified transaction id.
NewMerkleTree creates a new merkle tree.
NewMsgAddr returns a new bitcoin addr message that conforms to the Message interface.
NewMsgAlert returns a new bitcoin alert message that conforms to the Message interface.
NewMsgBlock returns a new bitcoin block message that conforms to the Message interface.
NewMsgExtended returns a new bitcoin extended message that conforms to the Message interface.
NewMsgFeeFilter returns a new bitcoin feefilter message that conforms to the Message interface.
NewMsgFilterAdd returns a new bitcoin filteradd message that conforms to the Message interface.
NewMsgFilterClear returns a new bitcoin filterclear message that conforms to the Message interface.
NewMsgFilterLoad returns a new bitcoin filterload message that conforms to the Message interface.
NewMsgGetAddr returns a new bitcoin getaddr message that conforms to the Message interface.
NewMsgGetBlocks returns a new bitcoin getblocks message that conforms to the Message interface using the passed parameters and defaults for the remaining fields.
NewMsgGetData returns a new bitcoin getdata message that conforms to the Message interface.
NewMsgGetDataSizeHint returns a new bitcoin getdata message that conforms to the Message interface.
NewMsgGetHeaders returns a new bitcoin getheaders message that conforms to the Message interface.
NewMsgHeaders returns a new bitcoin headers message that conforms to the Message interface.
NewMsgInv returns a new bitcoin inv message that conforms to the Message interface.
NewMsgInvSizeHint returns a new bitcoin inv message that conforms to the Message interface.
NewMsgMemPool returns a new bitcoin pong message that conforms to the Message interface.
NewMsgMerkleBlock returns a new bitcoin merkleblock message that conforms to the Message interface.
NewMsgNotFound returns a new bitcoin notfound message that conforms to the Message interface.
NewMsgPing returns a new bitcoin ping message that conforms to the Message interface.
NewMsgPong returns a new bitcoin pong message that conforms to the Message interface.
NewMsgProtoconf returns a new bitcoin headers message that conforms to the Message interface.
NewMsgReject returns a new bitcoin reject message that conforms to the Message interface.
NewMsgSendHeaders returns a new bitcoin sendheaders message that conforms to the Message interface.
NewMsgTx returns a new bitcoin tx message that conforms to the Message interface.
NewMsgVerAck returns a new bitcoin verack message that conforms to the Message interface.
NewMsgVersion returns a new bitcoin version message that conforms to the Message interface using the passed parameters and defaults for the remaining fields.
NewNetAddress returns a new NetAddress using the provided TCP address and supported services with defaults for the remaining fields.
NewNetAddressIPPort returns a new NetAddress using the provided IP, port, and supported services with defaults for the remaining fields.
NewNetAddressTimestamp returns a new NetAddress using the provided timestamp, IP, port, and supported services.
NewOutPoint returns a new bitcoin transaction outpoint point with the provided hash and index.
NewTxIn returns a new bitcoin transaction input with the provided previous outpoint point and signature script with a default sequence of MaxTxInSequenceNum.
NewTxOut returns a new bitcoin transaction output with the provided transaction value and public key script.
OutPointFromStr parses a string into an outpoint.
RandomUint64 returns a cryptographically random uint64 value.
No description provided by the author
ReadMessage reads, validates, and parses the next bitcoin Message from r for the provided protocol version and bitcoin network.
ReadMessageN reads, validates, and parses the next bitcoin Message from r for the provided protocol version and bitcoin network.
No description provided by the author
No description provided by the author
No description provided by the author
ReadTxBytes reads a full tx and returns its size and the tx.
ReadVarBytes reads a variable length byte array.
ReadVarInt reads a variable length integer from r and returns it as a uint64.
ReadVarIntBytes reads a variable length integer from a byte slice and returns it's size and value as uint64s.
ReadVarIntN reads a variable length integer from r and returns it's size and value as uint64s.
ReadVarString reads a variable length string from r and returns it as a Go string.
VarIntSerializeSize returns the number of bytes it would take to serialize val as a variable length integer.
WriteMessage writes a bitcoin Message to w including the necessary header information.
WriteMessageN writes a bitcoin Message to w including the necessary header information and returns the number of bytes written.
WriteVarBytes serializes a variable length byte array to w as a varInt containing the number of bytes, followed by the bytes themselves.
WriteVarInt serializes val to w using a variable number of bytes depending on its value.
WriteVarString serializes str to w as a variable length integer containing the length of the string followed by the bytes that represent the string itself.
# Constants
BIP0031Version is the protocol version AFTER which a pong message and nonce field in ping were added (pver > BIP0031Version).
BIP0035Version is the protocol version which added the mempool message (pver >= BIP0035Version).
BIP0037Version is the protocol version which added new connection bloom filtering related messages and extended the version message with a relay flag (pver >= BIP0037Version).
BIP0111Version is the protocol version which added the SFNodeBloom service flag.
BloomUpdateAll indicates if the filter matches any data element in a public key script, the outpoint is serialized and inserted into the filter.
BloomUpdateNone indicates the filter is not adjusted when a match is found.
BloomUpdateP2PubkeyOnly indicates if the filter matches a data element in a public key script and the script is of the standard pay-to-pubkey or multisig, the outpoint is serialized and inserted into the filter.
Commands used in bitcoin message headers which describe the type of message.
Commands used in bitcoin message headers which describe the type of message.
Commands used in bitcoin message headers which describe the type of message.
added in protocol version 70016.
Commands used in bitcoin message headers which describe the type of message.
Commands used in bitcoin message headers which describe the type of message.
Commands used in bitcoin message headers which describe the type of message.
Commands used in bitcoin message headers which describe the type of message.
Commands used in bitcoin message headers which describe the type of message.
Commands used in bitcoin message headers which describe the type of message.
Commands used in bitcoin message headers which describe the type of message.
Commands used in bitcoin message headers which describe the type of message.
Commands used in bitcoin message headers which describe the type of message.
Commands used in bitcoin message headers which describe the type of message.
Commands used in bitcoin message headers which describe the type of message.
Commands used in bitcoin message headers which describe the type of message.
Commands used in bitcoin message headers which describe the type of message.
Commands used in bitcoin message headers which describe the type of message.
Commands used in bitcoin message headers which describe the type of message.
Commands used in bitcoin message headers which describe the type of message.
Commands used in bitcoin message headers which describe the type of message.
Commands used in bitcoin message headers which describe the type of message.
Commands used in bitcoin message headers which describe the type of message.
Commands used in bitcoin message headers which describe the type of message.
Commands used in bitcoin message headers which describe the type of message.
CommandSize is the fixed size of all commands in the common bitcoin message header.
DefaultUserAgent for wire in the stack.
FeeFilterVersion is the protocol version which added a new feefilter message.
These constants define the various supported inventory vector types.
These constants define the various supported inventory vector types.
These constants define the various supported inventory vector types.
These constants define the various supported inventory vector types.
MainNet represents the main bitcoin network.
MaxAddrPerMsg is the maximum number of addresses that can be in a single bitcoin addr message (MsgAddr).
MaxBlockHeaderPayload is the maximum number of bytes a block header can be.
MaxBlockHeadersPerMsg is the maximum number of block headers that can be in a single bitcoin headers message.
MaxBlockLocatorsPerMsg is the maximum number of block locator hashes allowed per message.
MaxBlockPayload is the maximum bytes a block message can be in bytes.
MaxBlocksPerMsg is the maximum number of blocks allowed per message.
MaxFilterAddDataSize is the maximum byte size of a data element to add to the Bloom filter.
MaxFilterLoadFilterSize is the maximum size in bytes a filter may be.
MaxFilterLoadHashFuncs is the maximum number of hash functions to load into the Bloom filter.
MaxInvPerMsg is the maximum number of inventory vectors that can be in a single bitcoin inv message.
MaxMessagePayload is the maximum bytes a message can be regardless of other individual limits imposed by messages themselves.
MaxPrevOutIndex is the maximum index the index field of a previous outpoint can be.
MaxTxInSequenceNum is the maximum sequence number the sequence field of a transaction input can be.
MaxUserAgentLen is the maximum allowed length for the user agent field in a version message (MsgVersion).
MaxVarIntPayload is the maximum payload size for a variable length integer.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
MessageHeaderSize is the number of bytes in a bitcoin message header.
MultipleAddressVersion is the protocol version which added multiple addresses per message (pver >= MultipleAddressVersion).
NetAddressTimeVersion is the protocol version which added the timestamp field (pver >= NetAddressTimeVersion).
ProtocolVersion is the latest protocol version this package supports.
used as version.
These constants define the various supported reject codes.
These constants define the various supported reject codes.
These constants define the various supported reject codes.
These constants define the various supported reject codes.
These constants define the various supported reject codes.
These constants define the various supported reject codes.
These constants define the various supported reject codes.
These constants define the various supported reject codes.
RejectVersion is the protocol version which added a new reject message.
SendHeadersVersion is the protocol version which added a new sendheaders message.
SequenceLockTimeDisabled is a flag that if set on a transaction input's sequence number, the sequence number will not be interpreted as a relative locktime.
SequenceLockTimeGranularity is the defined time based granularity for seconds-based relative time locks.
SequenceLockTimeIsSeconds is a flag that if set on a transaction input's sequence number, the relative locktime has units of 512 seconds.
SequenceLockTimeMask is a mask that extracts the relative locktime when masked against the transaction input sequence number.
Bitcoin Cash service bit.
SFNodeBloom is a flag used to indicate a peer supports bloom filtering.
SFNodeGetUTXO is a flag used to indicate a peer supports the getutxos and utxos commands (BIP0064).
SFNodeNetwork is a flag used to indicate a peer is a full node.
SimNet represents the simulation test network.
TestNet represents the regression test network.
TestNet3 represents the test network (version 3).
TxVersion is the current latest supported transaction version.
# Structs
Alert contains the data deserialized from the MsgAlert payload.
BlockHeader defines information about a block and is used in the bitcoin block (MsgBlock) and headers (MsgHeaders) messages.
InvVect defines a bitcoin inventory vector which is used to describe data, as specified by the Type field, that a peer wants, has, or does not have to another peer.
MerkleProof is a structure used to provide mathematical proof of existence of a transaction id in a merkle tree based on the merkle tree's root hash and a set of hashes to derive up the tree.
MerkleTree is an efficient structure for calculating a merkle root hash.
MessageError describes an issue with a message.
MessageHeader defines the header structure for all bitcoin P2P messages.
MsgAddr implements the Message interface and represents a bitcoin addr message.
MsgAlert implements the Message interface and defines a bitcoin alert message.
MsgBlock implements the Message interface and represents a bitcoin block message.
MsgExtended is a message that allows messages larger than 2^32 bytes to be sent in the P2P protocol.
MsgFeeFilter implements the Message interface and represents a bitcoin feefilter message.
MsgFilterAdd implements the Message interface and represents a bitcoin filteradd message.
MsgFilterClear implements the Message interface and represents a bitcoin filterclear message which is used to reset a Bloom filter.
MsgFilterLoad implements the Message interface and represents a bitcoin filterload message which is used to reset a Bloom filter.
MsgGetAddr implements the Message interface and represents a bitcoin getaddr message.
MsgGetBlocks implements the Message interface and represents a bitcoin getblocks message.
MsgGetData implements the Message interface and represents a bitcoin getdata message.
MsgGetHeaders implements the Message interface and represents a bitcoin getheaders message.
MsgHeaders implements the Message interface and represents a bitcoin headers message.
MsgInv implements the Message interface and represents a bitcoin inv message.
MsgMemPool implements the Message interface and represents a bitcoin mempool message.
MsgMerkleBlock implements the Message interface and represents a bitcoin merkleblock message which is used to reset a Bloom filter.
MsgNotFound defines a bitcoin notfound message which is sent in response to a getdata message if any of the requested data in not available on the peer.
MsgParseBlock is a more efficient version of MsgBlock.
MsgPing implements the Message interface and represents a bitcoin ping message.
MsgPong implements the Message interface and represents a bitcoin pong message which is used primarily to confirm that a connection is still valid in response to a bitcoin ping message (MsgPing).
No description provided by the author
MsgReject implements the Message interface and represents a bitcoin reject message.
MsgSendHeaders implements the Message interface and represents a bitcoin sendheaders message.
MsgTx implements the Message interface and represents a bitcoin tx message.
MsgVerAck defines a bitcoin verack message which is used for a peer to acknowledge a version message (MsgVersion) after it has used the information to negotiate parameters.
MsgVersion implements the Message interface and represents a bitcoin version message.
NetAddress defines information about a peer on the network including the time it was last seen, the services it supports, its IP address, and port.
OutPoint defines a bitcoin data type that is used to track previous transaction outputs.
TxIn defines a bitcoin transaction input.
TxLoc holds locator data for the offset and length of where a transaction is located within a MsgBlock data buffer.
TxOut defines a bitcoin transaction output.
# Type aliases
BitcoinNet represents which bitcoin network a message belongs to.
BloomUpdateType specifies how the filter is updated when a match is found.
InvType represents the allowed types of inventory vectors.
RejectCode represents a numeric value by which a remote peer indicates why a message was rejected.
ServiceFlag identifies services supported by a bitcoin peer.