Companion

object Companion : BtcSerializer<Block>

Functions

Link copied to clipboard
fun checkProofOfWork(block: Block): Boolean

Proof of work: hash(block) <= target difficulty

Link copied to clipboard
open override fun read(input: ByteArray): Block
open override fun read(input: String): Block
fun read(input: Input): Block

open override fun read(input: Input, protocolVersion: Long): Block

read a message from a stream

fun read(input: ByteArray, protocolVersion: Long): Block

read a message from a byte array

fun read(input: String, protocolVersion: Long): Block

read a message from a hex string

Link copied to clipboard
open override fun validate(message: Block)
Link copied to clipboard
fun verifyTxOutProof(proof: ByteArray): Pair<BlockHeader, List<Pair<ByteVector32, Int>>>

Verify a tx inclusion proof (a merkle proof that a set of transactions are included in a given block) Note that this method doesn't validate the header's proof of work.

Link copied to clipboard
open override fun write(message: Block): ByteArray
fun write(message: Block, out: Output)

fun write(message: Block, protocolVersion: Long): ByteArray

write a message to a byte array

open override fun write(    message: Block,     out: Output,     protocolVersion: Long)

write a message to a stream

Properties

Link copied to clipboard
val LivenetGenesisBlock: Block
Link copied to clipboard
val RegtestGenesisBlock: Block
Link copied to clipboard
val SignetGenesisBlock: Block
Link copied to clipboard
val TestnetGenesisBlock: Block