{
  "component": "identity-check independent baseline review",
  "baseCommit": "aebd9183af6a4b1643ddd1e71277f0e8166f3eda",
  "files": {
    "componentChanged": [],
    "result": "artifacts/goal/batches/e2-runner-components/items/baseline-identity/result.json",
    "treeGitSha1": "cc56510cf56a2790cc35154d0e7ef4d1f4cefdd4",
    "sourceSha256": {
      "identity-check/README.md": "7a766c32e255f4c0e19d7d5ff2acf4edd753d0e754393308a640a8ccdab9a438",
      "identity-check/verify.py": "ff49498934b1abc8ee84b4eee6f080a82d85ccf21b9ceb5a3d88f703e70deab7",
      "identity-check/test_verify.py": "095d61d9a84f9145d2841c602e83a5123b429ad9de31f908ed710fd34f1b0a07"
    },
    "scratch": "test/scratch/identity_independent.py is ephemeral; inline restartCommand reproduces it without that file."
  },
  "commands": [
    {
      "command": "git rev-parse HEAD && git status --short && git rev-parse aebd9183af6a4b1643ddd1e71277f0e8166f3eda^{commit}",
      "exitCode": 0,
      "reported": "HEAD and requested commit identical; initially clean."
    },
    {
      "command": "rg --files -g '*identity*' -g '!artifacts/**' && rg --files identity-check",
      "exitCode": 1,
      "reported": "First filename filter matched no filenames; second command was not run. Exploratory search failure, no source file or line named."
    },
    {
      "command": "git ls-tree -r --name-only aebd9183af6a4b1643ddd1e71277f0e8166f3eda",
      "exitCode": 0,
      "reported": "Located three identity-check files."
    },
    {
      "command": "ls -la",
      "exitCode": 0,
      "reported": "Inspected checkout top-level directory."
    },
    {
      "command": "cat identity-check/README.md",
      "exitCode": 0,
      "reported": "Read component scope and offline limitations."
    },
    {
      "command": "nl -ba identity-check/verify.py",
      "exitCode": 0,
      "reported": "Reviewed implementation."
    },
    {
      "command": "nl -ba identity-check/test_verify.py",
      "exitCode": 0,
      "reported": "Reviewed existing test cases and public vectors."
    },
    {
      "command": "sha256sum identity-check/README.md identity-check/verify.py identity-check/test_verify.py && git ls-tree aebd9183af6a4b1643ddd1e71277f0e8166f3eda identity-check/",
      "exitCode": 0,
      "reported": "Recorded SHA-256 hashes and Git blob IDs."
    },
    {
      "command": "python3 -B identity-check/verify.py",
      "exitCode": 0,
      "reported": "All six checks and overall PASS; objective INCOMPLETE."
    },
    {
      "command": "python3 -B -m unittest discover -s identity-check -p 'test_*.py' -v",
      "exitCode": 0,
      "reported": "Ran 34 tests in 0.354s; OK."
    },
    {
      "command": "python3 -B test/scratch/identity_independent.py",
      "exitCode": 0,
      "reported": "Independent arithmetic and mutations PASS; executable source embedded in restartCommand."
    },
    {
      "command": "git rev-parse aebd9183af6a4b1643ddd1e71277f0e8166f3eda:identity-check && git diff --exit-code aebd9183af6a4b1643ddd1e71277f0e8166f3eda -- identity-check",
      "exitCode": 0,
      "reported": "Tree hash recorded; no tracked component changes."
    },
    {
      "command": "python3 -B --version",
      "exitCode": 0,
      "reported": "Python 3.12.3."
    }
  ],
  "tests": {
    "implemented": "No component changes; independent scratch assertions were written and executed. The source for reproducing them is embedded in restartCommand.",
    "tested": [
      "Independent Base58Check checksum and HASH160 match, source script, independent Bech32m polymod and 5-bit decoding, witness program and recipient script.",
      "SEC 2 generator known coordinates, target point equation and parity, opposite prefix, invalid prefix, x=p and nonsquare x=0; swapped target prefix produces a valid opposite point but address match fails.",
      "Damaged recipient checksum and mixed case rejected; existing suite tests exhaustive single substitutions and BIP350 vectors.",
      "Inclusive lower and upper accepted; adjacent scalars rejected by independent comparisons; size 2^139.",
      "Synthetic generator scalar 1 lies outside range yet interval_scalar_bounds PASS when generator is passed, confirming this check only assesses bounds."
    ],
    "counterexample": "No component defect found. The generator example is a counterexample to interpreting interval_scalar_bounds PASS as membership; it is not a counterexample to the documented bounds-only behavior.",
    "fixRecommendation": "No component fix required for the reviewed behavior. Consumers must not treat interval_scalar_bounds PASS or overall PASS as proof of private-key interval membership, challenge provenance or funds; verify those independently.",
    "untested": [
      "Live challenge provenance, current spendable UTXOs, actual private-key membership, key recovery and prize payment are outside this read-only item."
    ]
  },
  "observed": {
    "challengeHash160": "ffbb35a7bb9bbe16c1aa2534f7ff11d59c8e3d1a",
    "challengeSourceScriptPubKey": "76a914ffbb35a7bb9bbe16c1aa2534f7ff11d59c8e3d1a88ac",
    "recipientWitnessVersion": 1,
    "recipientProgramHex": "46bfc36cb0a801aa7d19aff5ceffc6735d461e99bebd4c6c7fa3b2fbae2c0a6f",
    "recipientScriptPubKey": "512046bfc36cb0a801aa7d19aff5ceffc6735d461e99bebd4c6c7fa3b2fbae2c0a6f",
    "candidateCount": "696898287454081973172991196020261297061888"
  },
  "measurements": {
    "reportedUnittestElapsedSeconds": 0.354,
    "processDeviceLabel": "unknown",
    "interpretation": "Test suite wall time only, not search throughput."
  },
  "blockers": [],
  "restartCommand": "python3 -B identity-check/verify.py\npython3 -B -m unittest discover -s identity-check -p 'test_*.py' -v\npython3 -B - <<'PYREVIEW'\nimport sys, hashlib, importlib.util\nspec = importlib.util.spec_from_file_location('reviewed', 'identity-check/verify.py')\nv = importlib.util.module_from_spec(spec); spec.loader.exec_module(v)\np = 0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f\nn = 0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141\nsec = bytes.fromhex(v.PUBLIC_KEY); x = int.from_bytes(sec[1:], 'big')\nr = (x*x*x+7)%p; y = pow(r,(p+1)//4,p)\nassert y*y%p == r\nif y%2 != sec[0]%2: y=p-y\nassert y%2==1 and v.compressed_point(v.PUBLIC_KEY)==(x,y)\nassert v.compressed_point('02'+v.PUBLIC_KEY[2:])==(x,p-y)\nfor s in ['04'+v.PUBLIC_KEY[2:], '02'+format(p,'064x'), '02'+'00'*32, '03'+'00'*32]:\n    try: v.compressed_point(s)\n    except v.InvalidPublicInput: pass\n    else: raise AssertionError('accepted invalid point '+s)\nalpha='123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'\na=v.CHALLENGE_ADDRESS; num=0\nfor c in a: num=num*58+alpha.index(c)\nraw=b'\\0'*(len(a)-len(a.lstrip('1')))+num.to_bytes((num.bit_length()+7)//8,'big')\nh=lambda b:hashlib.sha256(b).digest()\nassert len(raw)==25 and raw[0]==0 and raw[-4:]==h(h(raw[:-4]))[:4]\ndigest=hashlib.new('ripemd160',h(sec)).digest()\nassert raw[1:-4]==digest and digest.hex()=='ffbb35a7bb9bbe16c1aa2534f7ff11d59c8e3d1a'\nassert '76a914'+digest.hex()+'88ac'==v.verify_manifest()['scripts_hex']['challenge_p2pkh']\nchars='qpzry9x8gf2tvdw0s3jn54khce6mua7l'; a=v.RECIPIENT; hrp,tail=a.rsplit('1',1); data=[chars.index(c) for c in tail]\nvalues=[ord(c)//32 for c in hrp]+[0]+[ord(c)%32 for c in hrp]+data\nstate=1; gen=[0x3b6a57b2,0x26508e6d,0x1ea119fa,0x3d4233dd,0x2a1462b3]\nfor z in values:\n    top=state//(1<<25); state=(state%(1<<25))*32 ^ z\n    for i in range(5):\n        if top & (1<<i): state ^= gen[i]\nassert hrp=='bc' and state==0x2bc830a3 and data[0]==1\nbits=''.join(format(z,'05b') for z in data[1:-6]); assert len(bits)==260 and bits[-4:]=='0000'\nprogram=int(bits[:-4],2).to_bytes(32,'big')\nassert program.hex()=='46bfc36cb0a801aa7d19aff5ceffc6735d461e99bebd4c6c7fa3b2fbae2c0a6f'\nassert v.recipient_program(a)==program and v.verify_manifest()['scripts_hex']['recipient_witness_v1']=='5120'+program.hex()\nfor bad in [a[:-1]+('q' if a[-1]!='q' else 'p'), 'bC'+a[2:]]:\n    try: v.recipient_program(bad)\n    except v.InvalidPublicInput: pass\n    else: raise AssertionError('accepted damaged recipient')\nlo,hi=2**139,2**140-1\nassert 1<=lo<=hi<n and hi-lo+1==2**139\nassert all(lo<=z<=hi for z in [lo,hi]) and all(not lo<=z<=hi for z in [lo-1,hi+1])\n# Public SEC 2 generator is associated with synthetic scalar 1; not a challenge key.\ng='0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798'\nassert v.compressed_point(g)[1]==0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8\nassert v.verify_manifest(public_key=g)['checks']['interval_scalar_bounds']['status']=='PASS' and not lo<=1<=hi\nassert v.verify_manifest(public_key='02'+v.PUBLIC_KEY[2:])['checks']['public_key_address_match']['status']=='FAIL'\nprint('PASS: independent Base58Check, HASH160, Bech32m, SEC parity/invalid points, inclusive boundaries and membership limitation')\nPYREVIEW",
  "objectiveStatus": "INCOMPLETE"
}
