Dear Bitcoin Dev Community,

I am excited to introduce Bitcoin BOSD (Bitcoin Output Script Descriptor), a new specification and open source Rust implementation to simplify relay-safe (standardness-guarantee) on-chain withdrawals for Bitcoin Layer 2 solutions.

Key Features:
- Standardness-by-construction for withdrawal outputs
- Eliminates ad-hoc standardness rule implementations in L2s
- Compact representation

Problem Solved:
L2 operators currently risk being unable to process withdrawals if users request non-standard transactions (e.g., oversized OP_RETURN). BOSD ensures outputs are correct-by-construction according to Bitcoin network's standardness rules, abstracting away complex validation logic.

Available on crates.io

Get Involved:
Detailed Specification and Motivation/Rationale: SPECIFICATION.md
Repository: github.com/alpenlabs/bitcoin-bosd
Feedback welcome via GitHub Issues and Discussion; or the mailing list. 

This work emerged from practical challenges faced by myself and Trey Del Bonis (GitHub @delbonis) at Alpen Labs, while building validation logic for processing L2 withdrawals on-chain for Strata: a Bitcoin-native BitVM-based bridge to a ZK-rollup. We believe standardization in this domain will benefit the entire ecosystem by reducing fragmentation and improving interoperability.
The specification is has a CC0 public domain license, and the Rust implementation is MIT/Apache-2.0 double licensed.

The structure of a BOSD consists of:

- 1-byte tag representing a type ID.
- Arbitrary-length cryptographic payload (although practically bounded to like
  80 bytes).

Here's a table for the supported outputs. Also note that we can trivially extend it by adding more prefixes using the type it byte.

```
| Type | Payload Length(s) | Payload Interpretation | Spend Type    | Mainnet Address Prefix |
| ---- | ----------------- | ---------------------- | ------------- | ---------------------- |
| 0    | ..=80             | `OP_RETURN` payload    | (N/A)         | (N/A)                  |
| 1    | 20                | pubkey hash            | P2PKH         | `1...`                 |
| 2    | 20                | script hash            | P2SH          | `3...`                 |
| 3    | 20, 32            | SegWit v0 hash         | P2WPKH, P2WSH | `bc1q...`              |
| 4    | 32                | SegWit v1 public key   | P2TR          | `bc1p...`              |
```

Since we strived for compact representation both in-memory and also over-the-wire, BOSD does not support checksums or any native error correction.

PS: Technically Strata is not a defect L2, since it is a 1-of-N trust-minimized bridge, and not a fully trustless bridge.

--
You received this message because you are subscribed to the Google Groups "Bitcoin Development Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bitcoindev+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/bitcoindev/94ac8f66-1627-4526-bb34-095361a30fb4n%40googlegroups.com.