Skip to main content

Nakamoto Updates for Clarinet

Launch the Devnet in Nakamoto mode

As of Clarinet 2.4.0, the Devnet can run the blockchain in Nakamoto mode.

Once your Devnet reaches the right block height, it will deploy the pox-4.clar and run in Epoch 2.5. From there, Clarinet will send stack-stx and stack-extend requests to the new PoX contract. In Nakamoto mode, the Devnet has 2 signers. Eventually, you can observe the vote-for-aggregate-public-key transactions that they send.

Do not expect to reach Epoch 3.0 with Clarinet 2.4.0. This release is focusing on Epoch 2.5. Epoch 3.0, with fast blocks and others improvements, will come in a future release.

Setting up a project for Nakamoto

Using one of your Clarinet projects, or a new one (with clarinet new nakamoto-project), update the settings/Devnet.toml.

Under the [devnet] section when use_nakamoto = true is set, the pox-4.clar contract should be deployed around the Bitcoin block 108.

[devnet]
use_nakamoto = true

Start the Devnet with clarinet devnet start.

Deploy contracts on the Nakamoto Testnet

A Nakamoto testnet is available and running in Epoch 2.5. Clarinet can be used to deploy contracts on testnet.

In a Clarinet project, the settings/Testnet.toml file can be updated like so:

[network]
name = "testnet"
stacks_node_rpc_address = "https://api.testnet.hiro.so"
deployment_fee_rate = 10

[accounts.deployer]
mnemonic = "<YOUR PRIVATE TESTNET MNEMONIC HERE>"

Then run the following command to generate the deployments plan and deploy the contracts:

clarinet deployments generate --testnet --medium-cost
clarinet deployments apply --testnet