Skip to content

Add bip360-spend-verify RL environment - #5

Merged
let-the-dreamers-rise merged 1 commit into
mainfrom
prime-env-bip360-spend-verify
Oct 3, 2026
Merged

let-the-dreamers-rise merged 1 commit into
mainfrom
prime-env-bip360-spend-verify

Conversation

@let-the-dreamers-rise

Copy link
Copy Markdown
Owner

Requested by Ash · project thread

Before: the lab's findings could only be used as a test suite for implementations.

After: the same findings also make up an RL/eval environment for Prime Intellect's Environments Hub. A model gets one BIP 360 script-path spend and a tagged_hash tool, and has to say whether consensus accepts the spend and which rule fails first.

The invalid cases follow real bug classes this lab found: over-depth control blocks (fixed in bitcoin/bips#2273, and still present in bitcoinjs-lib #2312), padded zero elements, parity, flipped path or script bytes, and wrong leaf versions. Labels come from p2mr.py.

How: environments/bip360_spend_verify/ contains the generator, a vendored copy of p2mr.py, and tests. The tests check that the labels balance across all five codes, that they recompute exactly, and that the vendored file still matches the root p2mr.py. A literal reading of the system prompt, run with only the tool, matches all 400 tested labels. The environment loads under verifiers 0.3.1, and its reward functions score sample answers correctly.

🤖 Generated with Claude Code

https://claude.ai/code/session_01PBPzBYP67FvgjFczj4GVZ1


Generated by Claude Code

Tool-use environment for Prime Intellect's Environments Hub: the model
validates a BIP 360 script-path spend and names the first rule it breaks.
Labels come from p2mr.py; invalid cases mirror real bug classes the lab
found (over-depth control blocks, padded elements, parity).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PBPzBYP67FvgjFczj4GVZ1
@let-the-dreamers-rise let-the-dreamers-rise self-assigned this Oct 2, 2026
@let-the-dreamers-rise
let-the-dreamers-rise merged commit 3f4d4ab into main Oct 3, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant