Stacks 2.0 Launch: STX Miner Checklist

UPDATE: The launch of the Stacks 2.0 network has been triggered! The threshold trigger was reached at block 665250, export will be at block 665750, and Stacks 2.0 genesis should be at 666050.

Hi Everyone!

The sequence of events to launch of the Stacks 2.0 mainnet is here! In the next 24 hours, miners will be able to upgrade to the latest Stacks 1.0 release, and take part in triggering the transition to Stacks 2.0 mainnet. @diwaker has previously outlined the upgrade process from Stacks 1.0 to Stacks 2.0 in this forum post, and this other forum post.

We wanted to put together a checklist for miners to better guide them through the process of participating in the upgrade. If you want to be a miner on the Stacks 2.0 mainnet, follow the below checklist. We recommend completing this checklist before January 12th if you want to participate in the Stacks 2.0 launch as a miner:*

  • Follow this documentation to start mining and test your setup on the Xenon testnet.

    • Set up access to a Bitcoin node. You can self-host, get together with other miners to share a node, or try to use a publicly-accessible bitcoin node. While running a Stacks miner has no specialized hardware requirements, if you plan to self-host bitcoin, please be aware of the requirements to run bitcoind
  • Join the Stacks Discord. The #mining channel will be the place for live support.

  • Register a name in the .miner namespace starting on January 8th. Documentation for registering a name can be found below in the FAQ section.

  • Note: As soon as 20 miners have registered, a countdown will begin:

    • 300 blocks after this threshold is reached, a final snapshot of Stacks 1.0 state will be generated and any further Stacks 1.0 transactions will be rejected
    • 300 blocks after that (so, 600 blocks after the threshold trigger), Stacks 2.0 code will start processing burnchain blocks and be ready to mine the genesis block.
    • *Stacks 2.0 software will import the exported snapshot from the above step to instantiate the Stacks 2.0 genesis block. The Stacks 2.0 chain will go live 600 blocks (~4 days) after the threshold trigger (so 300 blocks after the export step). Note that this means there’s going to be a “dead time” of ~2 days during which no new Stacks 1.0 transactions would be admitted and Stacks 2.0 would not have launched yet.
  • Monitor the Stacks Forum for PBC to publish the Stacks 2.0 release build. As soon as the build is published, start running a node on it. If you are already running a Stacks 1.0 node, you will need to upgrade and restart your node/miner.

  • Have enough BTC to commit for 1 week or more.

  • Be prepared to restart your official stacks node and/or update software, potentially multiple time, during the first weeks of the mainnet.

To further help miners through this process, Daemon has set up a number of office hour sessions this week and next. The full schedule is as follows:

  • Jan 8th at 1pm UTC
  • Jan 9th at 2am UTC
  • Jan 10th/11th at 11:30pm UTC
  • Jan 11th at 1pm UTC
  • Jan 11th/12th at 11:30pm UTC
  • Jan 12th at 1pm UTC

To join any/all sessions please use the following zoom link: Launch Meeting - Zoom

Lastly, please use this forum thread to ask additional questions. We will continue to add to the FAQ below as questions come in.

FAQ

  • How do I get a name in .miner?
>   * Using the Stacks CLI register command https://docs.blockstack.org/references/stacks-cli#register
> 
> 1. Install the Blockstack CLI for the 1.0 network
> 
> npm install -g https://github.com/blockstack/cli-blockstack
> 
> 2. Use the register command to register the name. You need BTC in the address that shows up when you use the get_address command with your private key.
> 
> blockstack-cli register <NAME>.miner <OWNER_PRIVATE_KEY> <PAYMENT_KEY> https://hub.blockstack.org
> 
> Substitute <NAME> with the desired name
> 
> Substitute <OWNER_PRIVATE_KEY> and <PAYMENT_KEY> with the corresponding private keys. The payment key can be the same as the owner key. The owner key must be the private key corresponding to the STX address of the miner.
> 
> This command will queue and broadcast 2 Bitcoin transactions. 7 confirmations for each transaction are required for the name registration to complete. This takes about 2 hours.
> 
> Cost to register a 5 character name is ~0.001 BTC or $40 USD.
  • How much does a .miner name cost?

  • Do I need to copy the state or the snapshot of Stacks 1.0?

    • No need to copy any state: Stacks 1.0 data will be embedded in the Stacks 2.0 release build.
  • Do I need to be running Stacks 1.0 previously?

    • No.
4 Likes

To clarify, a name in .miner actually just costs 10 sats ($0.004) [e.g. see https://core.blockstack.org/v2/prices/names/hozz.miner ]. So the real cost above is dominated by Bitcoin transaction fees.

1 Like

Having a hard time getting the 1.0 up and running:
[email protected]:/home/derek/stacks-blockchain# blockstack-cli --help
internal/modules/cjs/loader.js:638
throw err;
^

Error: Cannot find module ‘…/lib/index’
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object. (/usr/local/lib/node_modules/blockstack-cli/cmd/index.js:3:1)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions…js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)

Attempted to install cjs manually, no change.

What version of node are you running? Try version 12.x

1 Like

Am on 10.19.0 installed via snap. Will try to figure out how to get 12.x installed

Updated node by installing nvm. Now node 15.5.1 npm 7.3.0

New error:
[email protected]:~$ npm install -g GitHub - blockstack/cli-blockstack: Node.js CLI for Blockstack, built on blockstack.js
npm WARN deprecated @types/[email protected]: This is a stub types definition. logform provides its own type definitions, so you do not need this installed.
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: request has been deprecated, see Request’s Past, Present and Future · Issue #3142 · request/request · GitHub
npm ERR! code 127
npm ERR! git dep preparation failed
npm ERR! command /home/derek/.nvm/versions/node/v15.5.1/bin/node /home/derek/.nvm/versions/node/v15.5.1/lib/node_modules/npm/bin/npm-cli.js install --cache=/home/derek/.npm/_cacache --prefer-offline=false --prefer-online=false --offline=false --no-progress --no-save --no-audit
npm ERR! npm ERR! code 127
npm ERR! npm ERR! path /home/derek/.npm/_cacache/tmp/git-clone-025ec027
npm ERR! npm ERR! command failed
npm ERR! npm ERR! command sh -c npm run build
npm ERR! npm ERR! > [email protected] build
npm ERR! npm ERR! > tsc -b ./tsconfig.json
npm ERR! npm ERR! sh: 1: tsc: not found
npm ERR! npm ERR! npm ERR! code 127
npm ERR! npm ERR! npm ERR! path /home/derek/.npm/_cacache/tmp/git-clone-025ec027
npm ERR! npm ERR! npm ERR! command failed
npm ERR! npm ERR! npm ERR! command sh -c tsc -b ./tsconfig.json
npm ERR! npm ERR!

problems here as well, node v14.15.4, npm v.6.14.10, ubuntu 18.04
after fixing the EACCES errors i’m getting a similar error:
blockstack-cli --help
internal/modules/cjs/loader.js:883
throw err;
^

Error: Cannot find module ‘…/lib/index’
Require stack:

  • /usr/local/lib/node_modules/blockstack-cli/cmd/index.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
    at Function.Module._load (internal/modules/cjs/loader.js:725:27)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object. (/usr/local/lib/node_modules/blockstack-cli/cmd/index.js:3:1)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions…js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12) {
    code: ‘MODULE_NOT_FOUND’,
    requireStack: [ ‘/usr/local/lib/node_modules/blockstack-cli/cmd/index.js’ ]
    }
1 Like

I was able to get this to install.

  1. Install NVM
  2. nvm install 12.14.1
  3. nvm use 12.14.1
  4. npm install -g https://github.com/blockstack/cli-blockstack

not working for me unfortunately

Do I send ~$50 to the BTC address that I have a private key to for this registration? And can I use the address provided by make_keychain in 2.x stack cli?

Are you using nvm for your node installation?

You need BTC in the address that shows up when you use the get_address command with your private key.

Example:

blockstack-cli get_address <payment_key>

{
  "BTC": "1FmFv4Ebej8NvYVLQjBZoKV7uhh5dHy3y1",
  "STACKS": "SP2GZ10VMV7KB48T6KWYJPJC9S6JBF2DEW3GPKZNB"
}

You will need to have the funds in 1FmFv4Ebej8NvYVLQjBZoKV7uhh5dHy3y1

1 Like

Yes

You can always try cloning the repo at https://github.com/blockstack/cli-blockstack and running the commands from the repo directory.

npm install
node cmd/index.js register <NAME>.miner <OWNER_PRIVATE_KEY> <PAYMENT_KEY> https://hub.blockstack.org

For those that don’t have an address/private key you can use these commands to get one.

blockstack-cli make_keychain

{
  "mnemonic": "dice jewel antique shop eyebrow canal kidney flat select move gaze screen",
  "ownerKeyInfo": {
    "privateKey": "84a7cca1a1f5fe8f60c0a775a2b09b7f41f8e271be211d91ddf87598212c6f2001",
    "version": "v0.10-current",
    "index": 0,
    "idAddress": "ID-1FW5o2D9sCH3tLUbgshZnCsGPBTvaXcdUw"
  },
  "paymentKeyInfo": {
    "privateKey": "d3f170e0c76ca4dbbcc7cef59251392ce306b44d34af02b5c2acdcdfde92649101",
    "address": {
      "BTC": "1Co3b5RE9zqJNakcDQGLrpp4BPgKReezD",
      "STACKS": "SP13P0QXWBKETBXQDT3Z8MSG7BMZ2B6VCRFKJA7N"
    },
    "index": 0
  }
}

In the above example, you can register a .miner domain name to the address 1Co3b5RE9zqJNakcDQGLrpp4BPgKReezD by first sending about 0.001 BTC to it.

Note that the private key in the example is under paymentKeyInfo d3f170e0c76ca4dbbcc7cef59251392ce306b44d34af02b5c2acdcdfde92649101

Once the BTC has been deposited, you can now register a name using the command from the original post.

For example, registering the name hello.miner

> blockstack-cli register hello.miner d3f170e0c76ca4dbbcc7cef59251392ce306b44d34af02b5c2acdcdfde92649101 d3f170e0c76ca4dbbcc7cef59251392ce306b44d34af02b5c2acdcdfde92649101 https://hub.blockstack.org

FWIW, I used the stacks2 cli to generate my address pairs and phrase. worked good, got it working in the stacks wallet, got registered once I got nvm installed with node 12 installed. I intend to use the same STX/BTC pair to mine and stack

1 Like

Could you please clarify how to use the private keys in a bitcoin wallet and in a stacks wallet? Where will I see my registered miner username?

Please add to the checklist

  • I have enough BTC to commit for 1 week or more.
  • I understand that after 1 week I might not have won one block
  • I understand that there is a roadmap for more features for 2.1 and I am happy with the features of 2.0
  • I understand that I have to restart the official stacks node to change the commit amount (or use a fork) and that the average of min and mean of the last 6 blocks is used for sortition
1 Like

getting the same error from that

Ok, not running under root account fixed the problem