block

package
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 9, 2021 License: MIT Imports: 8 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeserializeTransactions

func DeserializeTransactions(
	buf *bytes.Buffer,
) ([]*transaction.Transaction, error)

Types

type Block

type Block struct {
	Header           *Header
	TransactionsData *Transactions
}

func NewFromBuffer

func NewFromBuffer(buf *bytes.Buffer) (*Block, error)

func NewFromHex

func NewFromHex(h string) (*Block, error)

func (*Block) SerializeBlock

func (b *Block) SerializeBlock() ([]byte, error)

type CompactParams

type CompactParams struct {
	// "scriptPubKey" used for block signing
	SignBlockScript []byte
	/// Maximum, in bytes, of the size of a blocksigning witness
	SignBlockWitnessLimit uint32
	/// Merkle root of extra data
	ElidedRoot []byte
}

CompactParams params where the fedpeg data and extension space are not included, and are assumed to be equal to the values from the previous block

type DynamicFederation

type DynamicFederation struct {
	Current          *DynamicFederationParams
	Proposed         *DynamicFederationParams
	SignBlockWitness [][]byte
}

type DynamicFederationParams

type DynamicFederationParams struct {
	CompactParams *CompactParams
	FullParams    *FullParams
}

type ExtData

type ExtData struct {
	// Liquid v1-style static `signblockscript` and witness
	Proof *Proof
	// Dynamic federations
	DynamicFederation *DynamicFederation
	// is dynamic federation
	IsDyna bool
}

ExtData block signature and dynamic federation-related data

type FullParams

type FullParams struct {
	// "scriptPubKey" used for block signing
	SignBlockScript []byte
	// Maximum, in bytes, of the size of a blocksigning witness
	SignBlockWitnessLimit uint32
	// Untweaked `scriptPubKey` used for pegins
	FedpegProgram []byte
	// For v0 fedpeg programs, the witness script of the untweaked
	// pegin address. For future versions, this data has no defined
	// meaning and will be considered "anyone can spend".
	FedpegScript []byte
	/// "Extension space" used by Liquid for PAK key entries
	ExtensionSpace [][]byte
}

FullParams full dynamic federations parameters

type Header struct {
	// Version - should be 0x20000000 except when versionbits signalling
	Version uint32
	// Previous blockhash
	PrevBlockHash []byte
	// Transaction Merkle root
	MerkleRoot []byte
	// Block timestamp
	Timestamp uint32
	// Block Height
	Height uint32
	// Block signature and dynamic federation-related data
	ExtData *ExtData
}

func DeserializeHeader

func DeserializeHeader(
	buf *bytes.Buffer,
) (*Header, error)

func (*Header) SerializeHeader

func (h *Header) SerializeHeader(
	s *bufferutil.Serializer,
) error

type MerkleBlock

type MerkleBlock struct {
	BlockHeader       *wire.BlockHeader
	PartialMerkleTree *PartialMerkleTree
}

func NewMerkleBlockFromBuffer

func NewMerkleBlockFromBuffer(buf *bytes.Buffer) (*MerkleBlock, error)

func NewMerkleBlockFromHex

func NewMerkleBlockFromHex(h string) (*MerkleBlock, error)

func (*MerkleBlock) ExtractMatches

func (m *MerkleBlock) ExtractMatches() (*chainhash.Hash, []chainhash.Hash, error)

type PartialMerkleTree

type PartialMerkleTree struct {
	TxTotalCount uint32
	TxHashes     [][]byte
	FBad         bool
	VBits        []bool
}

type Proof

type Proof struct {
	// Block "public key"
	Challenge []byte
	// Satisfying witness to the above Challenge, or nothing
	Solution []byte
}

Proof Liquid v1-style static `signblockscript` and witness

type Transactions

type Transactions struct {
	Transactions []*transaction.Transaction
}

func (*Transactions) SerializeTransactions

func (t *Transactions) SerializeTransactions(
	s *bufferutil.Serializer,
) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL