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-7/

{
  "context": "This criteria evaluates how effectively the engineer uses bitcoinjs-lib to parse Bitcoin transactions and calculate transaction weight and virtual size metrics. The focus is on proper usage of the library's Transaction class and its associated properties/methods for size calculations.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "Transaction parsing",
      "description": "Uses Transaction.fromHex() or Transaction.fromBuffer() to parse the transaction hex string into a Transaction object",
      "max_score": 20
    },
    {
      "name": "Weight calculation",
      "description": "Uses the Transaction object's weight() method or virtualSize() method to obtain transaction weight in weight units",
      "max_score": 25
    },
    {
      "name": "Virtual size calculation",
      "description": "Uses the Transaction object's virtualSize() method or correctly derives vsize from weight (weight / 4, rounded up)",
      "max_score": 25
    },
    {
      "name": "Serialized size access",
      "description": "Uses Transaction.byteLength() method or accesses the serialized transaction size through toBuffer().length or toHex().length / 2",
      "max_score": 15
    },
    {
      "name": "Input/output counting",
      "description": "Accesses the Transaction object's ins and outs arrays to count inputs and outputs (e.g., transaction.ins.length, transaction.outs.length)",
      "max_score": 10
    },
    {
      "name": "Witness data detection",
      "description": "Checks for witness data by examining transaction.ins array for witness field or uses hasWitnesses() method if available",
      "max_score": 5
    }
  ]
}

Install with Tessl CLI

npx tessl i tessl/npm-bitcoinjs-lib

tile.json