blockheader.go raw

   1  package wire
   2  
   3  import (
   4  	"time"
   5  
   6  	"next.orly.dev/pkg/nostr/crypto/ec/chainhash"
   7  )
   8  
   9  // BlockHeader defines information about a block and is used in the bitcoin
  10  // block (MsgBlock) and headers (MsgHeaders) messages.
  11  type BlockHeader struct {
  12  	// Version of the block.  This is not the same as the protocol version.
  13  	Version int32
  14  	// Hash of the previous block header in the block chain.
  15  	PrevBlock chainhash.Hash
  16  	// Merkle tree reference to hash of all transactions for the block.
  17  	MerkleRoot chainhash.Hash
  18  	// Time the block was created.  This is, unfortunately, encoded as a
  19  	// uint32 on the wire and therefore is limited to 2106.
  20  	Timestamp time.Time
  21  	// Difficulty target for the block.
  22  	Bits uint32
  23  	// Nonce used to generate the block.
  24  	Nonce uint32
  25  }
  26