Skip to main content

DICE

Licensed under the Apache License 2.0.

DICE means Deterministic Intelligent Chain Executor. It is a Python 3.12+ terminal application for managing independent blockchain execution jobs.

This first build provides:

  • JSON-backed job storage
  • Async job lifecycle management
  • A daemon/client architecture so jobs can outlive the TUI
  • A workflow model built from triggers, conditions, and actions
  • A job plugin registry for extensible automation templates
  • Job-type form schemas used by the TUI for dynamic wizard guidance
  • Chain adapter interfaces with EVM and Solana profiles
  • A Web3-based EVM adapter for real RPC execution
  • A Solana adapter for native SOL balance watching and transfers
  • Encrypted private-key references and a signer layer
  • A reusable wallet vault for named encrypted wallet keys
  • Preflight checks before jobs start
  • Non-broadcast transaction simulation with gas and max-cost estimates
  • Workflow action handlers for contract calls, transfers, waits, notifications, withdrawals, and sweeps
  • Minimum amount thresholds so tiny sweeps/transfers can be skipped before wasting gas
  • Balance-trigger sweeps can calculate the transfer amount from the live watched wallet balance
  • User-entered transfer and sweep amounts use normal decimals like 0.001 or 1.5
  • ERC20 jobs support token decimals, so 1 USDC means one USDC instead of raw token units
  • Sweep timing logs show trigger, build, sign, broadcast, and total execution timing
  • Native balance sweeps use a faster transaction-build path to reduce duplicate RPC calls
  • One-shot and continuous run modes for active watch jobs
  • Dependency security auditing in CI
  • Watcher, trigger, builder, broadcaster, and executor boundaries
  • A Textual dashboard for viewing and starting/stopping jobs
  • A mock:// execution path suitable for local development

Setup

For local development from the project root:

py -3.12 -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
python -m pip install -e .

After DICE is published, install the packaged app with:

python -m pip install dice-chain-executor

Then run:

dice
dice-daemon

Note: pip install dice installs an existing unrelated PyPI package. This project uses the PyPI distribution name dice-chain-executor while keeping the command name dice.

If PowerShell blocks activation scripts, run this once:

Set-ExecutionPolicy -Scope CurrentUser RemoteSigned

After setup, activate the environment in every new terminal before running DICE:

.\.venv\Scripts\Activate.ps1

Before creating jobs with private keys, set the secret password in the daemon terminal:

$env:DICE_SECRET_PASSWORD = "use-a-long-random-password"

DICE encrypts imported private keys into storage/secrets and stores only a secret://... reference in each job file. New jobs can reuse an existing vault reference such as secret://wallets/base-sweeper instead of re-entering the private key.

DICE_SECRET_PASSWORD is the master password for that encryption. When you enter a private key, DICE derives an encryption key from this password, encrypts the private key, and writes only the encrypted ciphertext to storage/secrets/<job-id>.json. If someone opens the job JSON, they will only see a reference such as:

"private_key_ref": "secret://wallets/job-0001"

Keep this password safe. If you lose it, DICE cannot decrypt the saved private key later. If someone gets both the encrypted secret file and this password, they can unlock the private key.

Run

dice-daemon
dice

If you do not install the package, you can run the daemon and TUI directly:

python -m dice.service.daemon
python -m dice.app.main

You can also launch the TUI package entry point directly:

python -m dice

The TUI attaches to the daemon at 127.0.0.1:8765 when it is running. If no daemon is available, the TUI falls back to embedded development mode.

Real RPC Vs Mock RPC

Use mock://local when testing the DICE workflow without sending blockchain transactions.

Use a real HTTP RPC URL when you want live chain execution:

https://...
http://...

For EVM execution, DICE currently requires:

  • a supported EVM chain profile
  • a reachable RPC whose chain ID matches the selected chain
  • an encrypted private-key reference
  • a staking/target contract address
  • an ABI file path
  • a function name and arguments that exist in the ABI

Before a job starts, DICE runs preflight checks. The manager verifies the saved configuration, plugin rules, RPC connectivity, wallet key availability, signer address, contract bytecode, ABI function, and transaction simulation where those checks apply. Real EVM simulation builds the transaction, estimates gas, and shows the maximum native-token fee without signing or broadcasting. If any required check fails, the job is marked error and does not start.

For Solana execution, DICE supports native SOL and SPL token watch/sweep/transfer jobs. Use:

Chain: solana
HTTP RPC: https://api.mainnet-beta.solana.com
Asset type: native

For SPL tokens, use erc20/token, paste the Solana token mint into the token contract/mint field, and enter normal decimal token amounts. DICE uses associated token accounts and creates the destination associated token account idempotently when needed. Solana private keys can be imported as a base58 keypair string or a JSON byte array.

Job Plugins

DICE treats job types as plugins. Built-in plugins include:

  • Stake Sweep
  • Token Sweep
  • Scheduled Transfer
  • Wallet Watch
  • Contract Call
  • Balance Trigger
  • Event Trigger
  • Custom Workflow

Each plugin provides metadata, form hints, and a default workflow. The UI flow is:

Select Job Type
  |
  v
Select Chain
  |
  v
Dynamic Configuration Form
  |
  v
Validation
  |
  v
Summary
  |
  v
Save

Current TUI Workflow

The interface uses a sidebar for primary navigation and a job action strip above the jobs table. The first screen is the operator home:

Welcome to DICE

Create Job
View Jobs
Global Settings
Exit

Create Job opens a guided wizard that follows this flow:

  1. Select job type from the plugin registry.
  2. Select blockchain: Ethereum, BNB Chain, Arbitrum, Base, Optimism, Polygon, Solana.
  3. Configure RPC endpoint: HTTP RPC and optional WebSocket RPC.
  4. Configure wallet: wallet name, private key, wallet address, destination wallet.
  5. Choose sweep type: native coin or ERC20 token.
  6. Enter staking information: staking contract and optional ABI path.
  7. Choose unlock method: manual, event, timestamp, block, claimable function, or balance change.
  8. Enter withdrawal function and arguments.
  9. Choose gas strategy: standard, aggressive, ultra, or custom.
  10. Choose run behavior: once or continuous, repeat delay, poll interval, and gas replacement.
  11. Review the summary, then save the job.

The sidebar contains:

  • Home
  • Create Job
  • View Jobs
  • Logs
  • Settings
  • Exit

The jobs table is the operator control panel. Select a job row, then use the action strip:

  • Start
  • Check
  • Stop
  • Edit
  • Duplicate
  • Delete
  • Refresh

Use Check before Start to run preflight manually and see the result in the workflow panel. Start also runs the same checks automatically.

The TUI asks for fields, but execution still belongs to the daemon/job manager. The UI does not own long-running job state.

Test

python -m pytest

Security Audit

Run the dependency vulnerability audit locally with:

python -m pip_audit

The GitHub CI workflow also runs this audit on pushes and pull requests. Dependabot is configured to open weekly dependency and GitHub Actions update PRs.

Project Layout

src/
  dice/
    adapters/    Chain profiles and adapter interfaces
    app/         Textual app entry point
    core/        Job models, storage, manager, and runtime state
    execution/   Transaction build/broadcast orchestration
    service/     Long-running daemon and local control client
    ui/          Textual screens and widgets
    watcher/     Watchers and trigger evaluation
docs/          Architecture and operations notes
storage/
  jobs/        Local job JSON files
logs/          Runtime logs
tests/         Core tests

Docs

Open Source

DICE is licensed under the Apache License 2.0.

Metadata

Release files for dice-chain-executor 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dice-chain-executor 0.1.2
File Size Uploaded Provenance Actions
dice_chain_executor-0.1.2.tar.gz 71.0 kB With provenance Details for dice_chain_executor-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dice-chain-executor 0.1.2
File Interpreter ABI Platform Actions
dice_chain_executor-0.1.2-py3-none-any.whl Python 3 none any Details for dice_chain_executor-0.1.2-py3-none-any.whl

Total release size: 134.3 kB

Release files / dice_chain_executor-0.1.2.tar.gz

Download URL dice_chain_executor-0.1.2.tar.gz
Size 71.0 kB
Tags Source
SHA-256 checksum
How to use checksums
a003ec91ebf471515cfd081e037a6ce7cd3fa0b8a7761bb89642b95c9e6340d3
BLAKE2b-256 checksum
How to use checksums
2eab7d2321b46a3b5d32cd50f12ccddd2d31c24ba6901949002b970740610ac2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 25, 2026.

Transparency log

Release files / dice_chain_executor-0.1.2-py3-none-any.whl

Download URL dice_chain_executor-0.1.2-py3-none-any.whl
Size 63.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ea13b6cf015ea1b0aa13cd4f4f2a5a7f81c097332481ff78b773bdff6c0ca390
BLAKE2b-256 checksum
How to use checksums
5e439ea31a4f6339ceaf8812e035f823ba3197fbcd4af595598314899fcdea58
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 25, 2026.

Transparency log

Security for dice-chain-executor 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for dice_chain_executor-0.1.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 25, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page