MCPcopy Index your code
hub / github.com/cube-btc/cube

github.com/cube-btc/cube @v0.1.3

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.1.3 ↗ · + Follow
2,091 symbols 5,049 edges 993 files 989 documented · 47%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Cube Cube is a four-elemental, fire-sampled virtual execution environment for Bitcoin.

Installation

Ensure you have Rust installed. Clone the repository and navigate into the project directory:

git clone https://github.com/cube-btc/cube
cd cube

Generating a Secret Key

If you don't already have a secret key, you can optionally generate a new one by running:

cargo run gensec

This will generate a random secret key and print it as an nsec string, which you'll need when running the program.

Cube abides by the NIP-19 format for secret keys, which uses bech32-encoded nsec strings for private keys.

Usage

Run the program with the following command:

cargo run <resource-mode> <chain> <kind> <rpc-url> <rpc-user> <rpc-password> <syncinflight?>

Parameters:

  • <resource-mode>: Whether to run in pruned or archival mode. Supported values:
  • pruned: For running in pruned mode.
  • archival: For running in archival mode.
  • <chain>: The Bitcoin network to use. Supported values:
  • signet
  • mainnet
  • <kind>: The kind of operating entity. Supported values:
  • node: For running a Cube node.
  • engine: For the network operator.
  • <rpc-url>: The RPC URL of the Bitcoin node.
  • <rpc-user>: The RPC username of the Bitcoin node.
  • <rpc-password>: The RPC password of the Bitcoin node.
  • <syncinflight?>: Whether to sync in-flight unconfirmed executions.
  • true: For syncing in-flight executions.
  • false: For syncing confirmed-executions-only.

Example:

cargo run pruned signet node http://127.0.0.1:38332 user password true

License

This project is licensed under the CC0 1.0 Universal License. See the LICENSE file for details.

Extension points exported contracts — how you extend this code

Commonable (Interface)
Trait to determine whether a value is ShortOrLong. [2 implementers]
src/constructive/core_types/valtypes/maybe_common/maybe_common/maybe_common.rs
ToNostrKeyStr (Interface)
Trait for converting 32-byte keys into Bech32-encoded `nsec` or `npub` strings. [1 implementers]
src/transmutative/key.rs
OpcodeCompiler (Interface)
A trait for compiling and decompiling an opcode. [1 implementers]
src/executive/vm/opcodes/compiler/compiler.rs
Relay (Interface)
(no doc) [1 implementers]
src/communicative/nns/relay.rs
ChainSync (Interface)
(no doc) [1 implementers]
src/operative/tasks/chain_sync/chain_sync.rs
P2TR (Interface)
(no doc) [4 implementers]
src/constructive/bitcoiny/taproot.rs
FromNostrKeyStr (Interface)
Trait for decoding Bech32-encoded `nsec` or `npub` strings into 32-byte keys. [1 implementers]
src/transmutative/key.rs
SafeConverter (Interface)
Trait for converting `StackUint` to `usize`, `u64`, and `u32` safely. [1 implementers]
src/executive/vm/stack/stack_uint.rs

Core symbols most depended-on inside this repo

push
called by 561
src/executive/vm/stack/stack.rs
to_string
called by 507
src/operative/run_args/chain.rs
len
called by 432
src/executive/vm/stack/stack_item.rs
execute
called by 200
src/executive/vm/program_execution/exec.rs
to_vec
called by 176
src/constructive/bitcoiny/taproot.rs
pop
called by 144
src/executive/vm/stack/stack.rs
active_execution
called by 131
src/executive/vm/stack/stack_holder.rs
ok
called by 119
src/communicative/tcp/protocol/move/bodies/response_body.rs

Shape

Method 1,278
Function 308
Enum 240
Class 234
Interface 31

Languages

Rust100%

Modules by API surface

src/operative/cli/commands/common_commands/runexplorer.rs48 symbols
src/inscriptive/registery/registery.rs43 symbols
src/inscriptive/coin_manager/coin_manager.rs42 symbols
src/inscriptive/privileges_manager/privileges_manager.rs37 symbols
src/executive/vm/stack/stack_holder.rs35 symbols
src/constructive/bitcoiny/taproot.rs35 symbols
src/inscriptive/params_manager/params_manager.rs28 symbols
src/transmutative/key.rs25 symbols
src/transmutative/secp/into.rs20 symbols
src/executive/vm/stack/stack_uint.rs19 symbols
src/transmutative/musig/session.rs18 symbols
src/constructive/txout_types/payload/payload.rs18 symbols

For agents

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

⬇ download graph artifact