Packages

trait Merkle extends AnyRef

Created by chris on 5/24/16. This trait contains all functionality related to computing merkle trees Mimics this functionality inside of bitcoin core https://github.com/bitcoin/bitcoin/blob/master/src/consensus/merkle.cpp

Linear Supertypes
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Merkle
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

  1. type MerkleTree = BinaryTree[DoubleSha256Digest]

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 build(hashes: Seq[DoubleSha256Digest]): MerkleTree

    Builds a merkle tree from a sequence of hashes

  6. final def build(subTrees: Seq[MerkleTree], accum: Seq[MerkleTree]): MerkleTree

    Builds a MerkleTree from sequence of sub merkle trees.

    Builds a MerkleTree from sequence of sub merkle trees. This subTrees can be individual txids (leafs) or full blown subtrees

    subTrees

    the trees that need to be hashed

    accum

    the accumulated merkle trees, waiting to be hashed next round

    returns

    the entire Merkle tree computed from the given merkle trees

    Annotations
    @tailrec()
  7. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  8. def computeBlockMerkleRoot(block: Block): DoubleSha256Digest

    Computes the merkle root for the given block

    Computes the merkle root for the given block

    block

    the given block that needs the merkle root computed

    returns

    the hash representing the merkle root for this block

  9. def computeBlockWitnessMerkleRoot(block: Block): DoubleSha256Digest

    Computes the merkle root for the committment inside of a coinbase txs scriptPubKey See BIP141 https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki#commitment-structure

  10. def computeBlockWitnessMerkleTree(block: Block): MerkleTree

    Computes the commitment of the block to the wtxids See the definition of a block commitment in BIP141 https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki#commitment-structure https://github.com/bitcoin/bitcoin/blob/7490ae8b699d2955b665cf849d86ff5bb5245c28/src/consensus/merkle.cpp#L168

  11. def computeMerkleRoot(transactions: Seq[Transaction]): DoubleSha256Digest

    Computes the merkle root for the given sequence of transactions

    Computes the merkle root for the given sequence of transactions

    transactions

    the list of transactions whose merkle root needs to be computed

    returns

    the merkle root for the sequence of transactions

  12. def computeTree(tree1: MerkleTree, tree2: MerkleTree): MerkleTree

    Computes the merkle tree of two sub merkle trees

  13. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  14. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  15. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  16. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  17. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  18. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  19. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  20. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  21. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  22. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  23. def toString(): String
    Definition Classes
    AnyRef → Any
  24. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  25. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  26. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Inherited from AnyRef

Inherited from Any

Ungrouped