Packages

sealed trait BlockHeader extends NetworkElement

Nodes collect new transactions into a block, hash them into a hash tree, and scan through nonce values to make the block's hash satisfy proof-of-work requirements. When they solve the proof-of-work, they broadcast the block to everyone and the block is added to the block chain. The first transaction in the block is a special one that creates a new coin owned by the creator of the block.

See also

Bitcoin Developer reference: https://bitcoin.org/en/developer-reference#block-headers

Bitcoin Core implementation: https://github.com/bitcoin/bitcoin/blob/master/src/primitives/block.h#L20

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. BlockHeader
  2. NetworkElement
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Abstract Value Members

  1. abstract def merkleRootHash: DoubleSha256Digest

    A SHA256(SHA256()) hash in internal byte order.

    A SHA256(SHA256()) hash in internal byte order. The merkle root is derived from the hashes of all transactions included in this block, ensuring that none of those transactions can be modified without modifying the header.

    returns

    the merkle root of the merkle tree

    See also

    https://bitcoin.org/en/developer-reference#merkle-trees

  2. abstract def nBits: UInt32

    An encoded version of the target threshold this block’s header hash must be less than or equal to.

    An encoded version of the target threshold this block’s header hash must be less than or equal to.

    See also

    See the nBits format described below. https://bitcoin.org/en/developer-reference#target-nbits

  3. abstract def nonce: UInt32

    An arbitrary number miners change to modify the header hash in order to produce a hash below the target threshold.

    An arbitrary number miners change to modify the header hash in order to produce a hash below the target threshold. If all 32-bit values are tested, the time can be updated or the coinbase transaction can be changed and the merkle root updated.

    returns

    the nonce used to try and solve a block

  4. abstract def previousBlockHash: DoubleSha256Digest

    A SHA256(SHA256()) hash in internal byte order of the previous block’s header.

    A SHA256(SHA256()) hash in internal byte order of the previous block’s header. This ensures no previous block can be changed without also changing this block’s header.

    returns

    the previous block's hash

  5. abstract def time: UInt32

    The block time is a Unix epoch time when the miner started hashing the header (according to the miner).

    The block time is a Unix epoch time when the miner started hashing the header (according to the miner). Must be greater than or equal to the median time of the previous 11 blocks. Full nodes will not accept blocks with headers more than two hours in the future according to their clock.

    returns

    the time when the miner started solving the block

  6. abstract def version: Int32

    The block version number indicates which set of block validation rules to follow.

    The block version number indicates which set of block validation rules to follow. See the list of block versions below.

    returns

    the version number for this block

    See also

    BIP9 for more information on what version number signify https://github.com/bitcoin/bips/blob/master/bip-0009.mediawiki

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def byteSize: Long

    The size of the NetworkElement in bytes.

    The size of the NetworkElement in bytes.

    Definition Classes
    NetworkElement
  6. lazy val bytes: ByteVector

    The byte representation of the NetworkElement

    The byte representation of the NetworkElement

    Definition Classes
    BlockHeaderNetworkElement
  7. def bytesLE: ByteVector

    The byte representation of the NetworkElement in little endian

    The byte representation of the NetworkElement in little endian

    Definition Classes
    NetworkElement
  8. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  9. def difficulty: BigInt

    This is the decoded version of nBits.

    This is the decoded version of nBits. nBits is used to compactly represent the difficulty target for the bitcoin network. This field is the expanded version that is the _actual_ requirement needed for the network. This is a 256 bit unsigned integer See the bitcoin developer reference for more information on how this is constructed documentation

    The hash of this block needs to be _less than_ this difficulty to be considered a valid block on the network

  10. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  11. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  12. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  13. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  14. lazy val hash: DoubleSha256Digest

    Returns the block's hash in the protocol level little endian encoding

  15. lazy val hashBE: DoubleSha256DigestBE

    Returns the block hash in big endian format, this is useful for rpc and block explorer debugging.

    Returns the block hash in big endian format, this is useful for rpc and block explorer debugging. This is *not* used in the core protocol itself. See this link for more info https://bitcoin.stackexchange.com/questions/2063/why-does-the-bitcoin-protocol-use-the-little-endian-notation

  16. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  17. def hex: String

    The hexadecimal representation of the NetworkElement

    The hexadecimal representation of the NetworkElement

    Definition Classes
    NetworkElement
  18. def hexLE: String

    The hexadecimal representation of the NetworkElement in little endian

    The hexadecimal representation of the NetworkElement in little endian

    Definition Classes
    NetworkElement
  19. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  20. def merkleRootHashBE: DoubleSha256DigestBE

    Returns the merkle root hash in BIG ENDIAN format.

    Returns the merkle root hash in BIG ENDIAN format. This is not compatible with the bitcoin protocol but it is useful for rpc clients and block explorers

    See also

    this link for more info https://bitcoin.stackexchange.com/questions/2063/why-does-the-bitcoin-protocol-use-the-little-endian-notation

  21. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  22. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  23. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  24. def previousBlockHashBE: DoubleSha256DigestBE

    Returns the big endian encoding of the previous block hash This is useful for using rpc and block exporers, but is NOT used in the protocol itself

    Returns the big endian encoding of the previous block hash This is useful for using rpc and block exporers, but is NOT used in the protocol itself

    See also

    see this Stack Exchange question for more: https://bitcoin.stackexchange.com/questions/2063/why-does-the-bitcoin-protocol-use-the-little-endian-notation

  25. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  26. def toString(): String
    Definition Classes
    BlockHeader → AnyRef → Any
  27. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  28. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  29. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Inherited from NetworkElement

Inherited from AnyRef

Inherited from Any

Ungrouped