bitcoin-script-miniscript
This note records the first ProofForge classification for Bitcoin base-layer
contracts. It does not add a Lean target profile yet.
Primary sources:
- Bitcoin contracts guide
- Bitcoin transaction reference
- Bitcoin Core output descriptors
- BIP 379: Miniscript
- BIP 342: Tapscript
- Bitcoin Core RPC reference
Classification
Bitcoin should be treated as a limited UTXO spending-policy target, not as a general smart-contract chain.Why This Matters For ProofForge
ProofForge can support Bitcoin, but the support should be honest about the expressive ceiling. Target-specific concerns:- state and value live in UTXOs, not accounts or contract storage;
- scripts lock outputs and witnesses unlock them;
- policy is usually about who can spend, when they can spend, and which preimage or signature data must be revealed;
- standardness, relay policy, transaction weight, fee rate, dust, and script limits affect whether an artifact is practical even when consensus-valid;
- Taproot and Tapscript have different signature and script semantics from legacy P2SH/P2WSH;
- output descriptors and Miniscript are safer first artifacts than raw hand-made Script for many spending policies;
- PSBT or raw transaction construction is part of validation.
Candidate Target Family
Candidate family:Candidate Capabilities
Some existing UTXO candidate capabilities also apply to Bitcoin, but need Bitcoin-specific lowering rules:
Candidate capabilities that may need explicit ids later:
Do not add these ids to
ProofForge.Target.Capability until a target profile
and lowering rules are reviewed.
Implementation Road
Road 1: Miniscript/Descriptor Sourcegen
This is the most conservative first spike. First spike:- choose a small policy such as “A can spend immediately, or B can spend after a relative timelock”;
- generate Miniscript and a descriptor, not raw Script;
- derive the output script/address;
- build and sign a regtest PSBT or raw transaction spend;
- validate with Bitcoin Core RPC such as
testmempoolacceptor a regtest spend; - record descriptor, script, witness requirements, transaction scenario, weight/fee, tool versions, and validation result in artifact metadata.
Road 2: Restricted Script/Tapscript Emitter
This road should follow only after the policy route proves the artifact shape. First spike:- define a restricted policy IR for signatures, thresholds, hash locks, and time locks;
- emit Script or Tapscript only for policies that can be statically analyzed;
- keep covenants, vault protocols, DLCs, CoinJoin coordination, Lightning channel protocols, and future soft-fork opcodes out of the first direct path.
Non-Goals For The First Pass
- Do not add
bitcoin-script-miniscriptto the code registry yet. - Do not classify Bitcoin as EVM, Wasm-host, Move, Solana, TVM, AVM, or a general smart-contract platform.
- Do not model UTXO data as global mutable storage.
- Do not claim covenant/state-machine support from basic Script support.
- Do not treat BCH/CashScript semantics as Bitcoin semantics.
- Do not hide PSBT/transaction-building requirements from artifact metadata.
- Do not claim support until a regtest or equivalent Bitcoin Core validation flow exists.
Research Exit Criteria
Bitcoin can leave Research only when we have:- a reviewed target profile proposal;
- a decided first spike path, likely Miniscript/descriptor sourcegen;
- a minimal spending-policy scenario;
- a script version policy covering P2SH, P2WSH, and Taproot/Tapscript scope;
- a PSBT/raw-transaction validation policy;
- a standardness, weight, fee, and dust policy;
- a documented toolchain requirement set, including Bitcoin Core regtest;
- at least one reproducible local validation command;
- artifact metadata for policy, descriptor, script, witness/PSBT scenario, weight/fee, toolchain versions, and validation result.