Skip to content

Add support for PoX-5 and Epoch 4.0#40

Open
radu-stacks wants to merge 11 commits into
stacks-network:masterfrom
radu-stacks:feat/pox-5-support
Open

Add support for PoX-5 and Epoch 4.0#40
radu-stacks wants to merge 11 commits into
stacks-network:masterfrom
radu-stacks:feat/pox-5-support

Conversation

@radu-stacks

@radu-stacks radu-stacks commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

This PR updates hacknet to boot the network in Epoch 4.0 with PoX-5 enabled. It builds stacks-node and stacks-signer from the PoX waterfall integration commit (STACKS_CORE_BASE_BRANCH), adds the 4.0 epoch entry to the node configs, and ships a regenerated chainstate archive that already starts past the 4.0 activation height (STACKS_40_HEIGHT, default 262).

Stacking

  • pox5.ts / stacking.ts: PoX-5 stake and stake-update against a per-account signer-manager contract.
  • pox5-signer-manager.clar: minimal signer-manager that grants its signer key and registers with .pox-5. ensurePox5Signer deploys it once per account and only registers when not already registered.
  • pox5-setup.ts: deploys the PoX-5 prerequisite contracts before 4.0 using a funded deployer key.

Bitcoin Staking (opt-in)

New bitcoin-staking compose profile and bitcoin-staking.ts. Waits for .pox-5 and signer registration, sets up a protocol bond, mints mock sBTC to the configured participants, and registers them through register-for-bond.

sBTC is mocked

PoX-5 needs an sBTC token and an sBTC registry, so this PR stubs both instead of running real sBTC:

  • sbtc-token.clar: a plain fungible token with mint / transfer / get-balance.
  • sbtc-registry.template.clar: returns a configured aggregate pubkey.

That covers the PoX-5 bond and staking paths well enough to run them. The deployer key is temporary and goes away once these become boot contracts upstream. Wiring up real sBTC can follow in a later PR if it proves useful.

CI

ci.yml: dry-run on Linux and macOS (Makefile parses, dependency check passes, macOS chainstate extraction), plus a Linux live-run that boots from the archive, waits for liveness, and tears down.

Notes

  • Makefile gains a macOS/Linux split for tar and rm so genesis re-runs work on both; clean now also wipes ./docker/chainstate/*.
  • New compose knobs default in docker-compose.yml: POX_5_DEPLOYER_PRIVATE_KEY, POX_5_SBTC_CONTRACT, POX_5_SBTC_REGISTRY_CONTRACT, POX_5_BOND_ADMIN, POX_5_BOND_ADMIN_PRIVATE_KEY. Changing any of them needs a fresh make genesis and a regenerated archive.

@radu-stacks radu-stacks marked this pull request as draft June 17, 2026 19:57

@simone-stacks simone-stacks left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great changes, left just two comments

Comment thread Makefile Outdated
Comment thread docker/stacker/stacking/pox5-signer-manager.ts
@radu-stacks radu-stacks marked this pull request as ready for review June 30, 2026 16:00
@radu-stacks radu-stacks changed the title [DRAFT] Add support for PoX-5 and Epoch 4.0 Add support for PoX-5 and Epoch 4.0 Jun 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants