CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-bitcoinjs-lib

Client-side Bitcoin JavaScript library for node.js and browsers with comprehensive Bitcoin protocol support

Overall
score

99%

Overview
Eval results
Files

rubric.jsonevals/scenario-3/

{
  "context": "This criteria evaluates how well the engineer uses bitcoinjs-lib's tagged hashing functions (BIP 340) to implement Taproot script hash computations. The focus is on proper usage of TapLeaf and TapBranch tagged hash functions from the crypto module.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "TapLeaf hash usage",
      "description": "Uses bitcoinjs-lib's tagged hash function for TapLeaf computation. Should import and use the appropriate crypto function (e.g., crypto.taggedHash with 'TapLeaf' tag) to compute leaf hashes with the script and leaf version.",
      "max_score": 30
    },
    {
      "name": "TapBranch hash usage",
      "description": "Uses bitcoinjs-lib's tagged hash function for TapBranch computation. Should import and use the appropriate crypto function (e.g., crypto.taggedHash with 'TapBranch' tag) to combine two child hashes into a parent hash.",
      "max_score": 30
    },
    {
      "name": "Hash ordering",
      "description": "Properly sorts the two child hashes lexicographically before computing the branch hash, as required by BIP 341. This is essential for ensuring consistent Merkle tree construction.",
      "max_score": 15
    },
    {
      "name": "Merkle tree construction",
      "description": "Correctly builds a Merkle tree by iteratively applying leaf and branch hash functions. Properly handles both even and odd numbers of leaves (unpaired leaves should be promoted to the next level).",
      "max_score": 15
    },
    {
      "name": "Leaf version handling",
      "description": "Correctly uses the leaf version byte (default 0xc0) when computing TapLeaf hashes. The leaf version should be properly encoded in the tagged hash input.",
      "max_score": 10
    }
  ]
}

Install with Tessl CLI

npx tessl i tessl/npm-bitcoinjs-lib

tile.json