MCPcopy Index your code
hub / github.com/alpenlabs/alpen

github.com/alpenlabs/alpen @v0.1.3

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.1.3 ↗ · + Follow
2,879 symbols 8,718 edges 453 files 646 documented · 22%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Strata

License: MIT License: Apache-2.0 codecov ci docs

Strata Logo

Strata gives developers the freedom to program nearly any locking conditions for BTC imaginable, limited only by the Strata block size and gas limits. This enables developers to create new kinds of applications for BTC with features such as:

  • New signature types, "provide a valid P-256 signature to authorize a transfer"

  • Vaults, "transfers must wait N days after being initiated to be effectuated, and can be cancelled in the mean time"

  • Subscriptions, "address 0x123...9a can withdraw up to v BTC per month from this account"

  • Strong privacy, "transaction details are end-to-end encrypted and verified using a zero-knowledge proof"

  • Economically-secured zero-confirmation payments, "if a double-spend from this sender is reported, the reporter gets to claim the sender's full wallet balance"

  • Financial transactions, "if enough BTC is locked as collateral to maintain up to X% loan-to-value ratio, then up to N of this other asset can be borrowed"

... and many more possibilities.

Technically speaking, Strata is a work-in-progress EVM-compatible validity rollup on bitcoin. Let's break down what this means:

  • EVM-compatible: The Strata block producer runs a client that is based on Reth, an Ethereum execution client. So far, no changes have been made that affect compatibility with the EVM spec. If you can deploy a smart contract to Ethereum, you can deploy it to Strata with no changes.

  • Validity rollup: Every Strata state transition is proven to be valid using cryptographic validity proofs, which clients can use for fast, low-cost verification.

  • On bitcoin: Strata uses bitcoin for consensus and data availability. When a Strata block gets confirmed on bitcoin, the only way to reorganize this block is to reorganize the bitcoin block that the Strata block was confirmed in.

To learn more, check our documentation.

[!IMPORTANT] During the devnet phase, Strata will be running on a private bitcoin signet, and will use signet blocks to store state commitments rather than the complete Strata state data, making Strata function more like a commit chain than a rollup. Support for full onchain data availability and for running Strata on bitcoin mainnet are planned for future releases.

Repository structure

This repository is composed of:

  • bin/: binary crates for various clients and CLIs
  • crates/: library crates, provides types and functionalities
  • docker/: supporting files for our dockerized applications
  • functional-tests/: end-to-end tests for various scenarios
  • provers/: libraries and binaries related to zero-knowledge proofs
  • tests/: integration tests

Contributing

Contributions are generally welcome. If you intend to make larger changes please discuss them in an issue before opening a PR to avoid duplicate work and architectural mismatches.

For more information please see CONTRIBUTING.md.

License

This work is dual-licensed under MIT and Apache 2.0. You can choose between one of them if you use this work.

Extension points exported contracts — how you extend this code

ProofGenerator (Interface)
(no doc) [6 implementers]
provers/sp1/tests/helpers/proof_generator.rs
ProvingOperations (Interface)
(no doc) [6 implementers]
bin/prover-client/src/proving_ops/ops.rs
ExecEngineCtl (Interface)
Interface to control an execution engine. This is defined in terms of strata semantics which will be produced inside th [2 …
crates/eectl/src/engine.rs
ZKVMInputBuilder (Interface)
A trait for managing inputs to a ZKVM prover. This trait provides methods for adding inputs in various formats to be use [2 …
crates/zkvm/zkvm/src/lib.rs
TxKind (Interface)
Defines a method that any bridge transaction must implement in order to create a structure that can be signed. This is [2 …
crates/bridge-tx-builder/src/lib.rs
OperatorKeyProvider (Interface)
Some type that can provide operator keys. [2 implementers]
crates/primitives/src/operator.rs
L2DataStore (Interface)
L2 data store for CL blocks. Does not store anything about what we think the L2 chain tip is, that's controlled by the [2 …
crates/db/src/traits.rs
InMemoryDBHelper (Interface)
A helper trait to extend [`InMemoryDB`] with additional functionality. [1 implementers]
crates/proof-impl/evm-ee-stf/src/db.rs

Core symbols most depended-on inside this repo

clone
called by 688
crates/reth/db/src/rocksdb/db.rs
as_ref
called by 157
crates/state/src/id.rs
len
called by 151
crates/state/src/state_queue.rs
generate
called by 111
crates/test-utils/src/lib.rs
header
called by 73
crates/state/src/block.rs
rand_blkid
called by 70
crates/consensus-logic/src/reorg.rs
insert
called by 58
crates/state/src/bridge_state.rs
build
called by 53
crates/state/src/l1/header.rs

Shape

Method 1,389
Function 877
Class 458
Enum 96
Interface 59

Languages

Rust93%
Python7%

Modules by API surface

crates/proof-impl/evm-ee-stf/src/mpt.rs59 symbols
crates/primitives/src/l1.rs56 symbols
crates/state/src/bridge_state.rs46 symbols
bin/strata-client/src/rpc_server.rs40 symbols
crates/btcio/src/rpc/types.rs38 symbols
functional-tests/entry.py34 symbols
crates/util/mmr/src/lib.rs34 symbols
crates/state/src/client_state.rs34 symbols
crates/bridge-sig-manager/src/manager.rs34 symbols
crates/rocksdb-store/src/l1/db.rs30 symbols
crates/consensus-logic/src/duty/types.rs30 symbols
bin/datatool/src/main.rs30 symbols

For agents

$ claude mcp add alpen \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact