Launching a namespace with blockstack-cli on my testnet

Hello,

I have not been able to launch my namespace even though namespace_reveal prints out a txid.
The output of namespace_ready is always:
{
“status”: false,
“error”: “Namespace cannot be safely launched”,
“isNamespaceValid”: true,
“isNamespaceReady”: false,
“isPrivateKeyRevealer”: false,
“revealerBalanceBTC”: 499599462000,
“estimateCostBTC”: 360000
}

Example commands used:
blockstack-cli -i namespace_preorder hello mp4mpbBJDZUbqEtJ5T69tXMco8xqF71JqL 1a3441f4a2762f6f8801ebd07438d5fd392c28879d0ba32d7248e0b99b89148a01
blockstack-cli -i namespace_reveal hello mp4mpbBJDZUbqEtJ5T69tXMco8xqF71JqL 2 52595 250 4 6,5,4,3,2,1,0,0,0,0,0,0,0,0,0,0 10 10 1a3441f4a2762f6f8801ebd07438d5fd392c28879d0ba32d7248e0b99b89148a01
blockstack-cli -i namespace_ready hello 1a3441f4a2762f6f8801ebd07438d5fd392c28879d0ba32d7248e0b99b89148a01

Thanks for providing the private keys! For the namespace_ready command, you need to pass the private key for mp4mpbBJDZUbqEtJ5T69tXMco8xqF71JqL (not the one you were passing). It needs to be the private key of the namespace reveal address.

The private key from the wallet.dat (bitcoin-cli) you mean not the payment key?

Should I make a new address with bitcoin-cli? or with blockstack-cli make_keychain?
Because I cannot understand if I generate an address with bitcoin-cli, how do I link it to an owner/payment pair keys.

Ah, I see you are using the same private key for both the namespace creator address and the payment key. You should use separate private keys – one for paying for the namespace, and one for importing names and launching it with namespace_ready.

I have generated 2 owner/payment privkey pairs with make_keychain
I have used it this way but still it is not working:

blockstack-cli -i namespace_preorder hello btc_addr1 payment_addr1
blockstack-cli -i namespace_reveal hello btc_addr1 … payment_addr1
blockstack-cli-i namespace_ready hello payment_addr2

Is that what you meant?

The namespace_ready should use the private key for btc_addr1 (not the one for payment_addr1). Also, it needs to occur in a different block than the namespace_reveal.

If I want to get the private key of a bitcoin address I’ll have to generate it with bitcoin-cli. But If I generate it with bitcoin-cli I cannot find the mnemonic in order to generate a blockstack owner/payment keys for this specific bitcoin address. How do I do that?

That’s fine – you don’t need the mnemonic to register a namespace. You don’t even need mnemonics to register names (any two private keys will work) – we only use mnemonics because it makes it possible to re-derive all of your name owner and payment keys from a single string instead of requiring you to back up a bunch of different keys.

I am not understanding it sorry!
Each private key generates a public key and the corresponding address.
In the cli reference docs, namespace_preorder and namespace_reveal both of them need a reveal address and a payment key. If you are telling me that namespace_ready needs a different private key not the payment key then I need a different address, it will not correspond to the reveal address entered in namespace_preorder and namespace_reveal.
So how should I do that? Do I really need to 2 keychains?

I have generated these 2 private-keys/addresses:

"privateKey": "4023435e33da4aff0775f33e7b258f257fb20ecff039c919b5782313ab73afb401",
    "address": {
      "BTC": "mgVYsS6fPTNgDctqnE6gMiEpzfKAWrjWNs",
      "STACKS": "ST5B89ZJAQHBRXVYP15YB5PAY5E24FEW9K1GWTGA"  

"privateKey": "4fd38cda19eb2bdbb2c54def7f818761b4a4c236c5d0866a77963baad08aee4201",
    "address": {
      "BTC": "mtGbDyc1DseQ3xBme5W8J36YXGPRvY73GH",
      "STACKS": "ST25Y4E8YQ6FB4F08WQDX5YRAJE6TTSEBE9XS28KA"

The commands I am using:

blockstack-cli -i namespace_preorder hello mgVYsS6fPTNgDctqnE6gMiEpzfKAWrjWNs 4fd38cda19eb2bdbb2c54def7f818761b4a4c236c5d0866a77963baad08aee4201

blockstack-cli -i namespace_reveal hello mgVYsS6fPTNgDctqnE6gMiEpzfKAWrjWNs 2 52595 250 4 6,5,4,3,2,1,0,0,0,0,0,0,0,0,0,0 10 10 4fd38cda19eb2bdbb2c54def7f818761b4a4c236c5d0866a77963baad08aee4201

blockstack-cli -i namespace_ready hello 4023435e33da4aff0775f33e7b258f257fb20ecff039c919b5782313ab73afb401

I do generate a few blocks with bitcoin-cli in between them.
The error I still get after namespace_ready:

{
  "status": false,
  "error": "Namespace cannot be safely launched",
  "isNamespaceValid": true,
  "isNamespaceReady": false,
  "isPrivateKeyRevealer": false,
  "revealerBalanceBTC": 500000005500,
  "estimateCostBTC": 360000
}

Has your Blockstack Core node processed the blocks you generated? Your commands look correct, but if your Blockstack Core node isn’t actively indexing the blockchain, then it won’t know about the namespace_reveal transaction (and the CLI will error out because it can’t tell the difference).

You can tell if the Core node is processing blocks by looking at the log file – you should see a line with ACCEPT NAMESPACE_PREORDER and ACCEPT NAMESPACE_REVEAL. If you see REJECT NAMESPACE_PREORDER or REJECT NAMESPACE_REVEAL, it means that the Core node processed them and for whatever reason it didn’t consider them valid (the log messages will explain why). If you don’t see either of these, then your Core node hasn’t processed the block that contains them (and the CLI won’t let you send the NAMESPACE_READY transaction).

Hi i was trying the same thing, if i want to register a namespace on bitcoin testnet or regtest,
i saw that the commands that you were hitting to register the namespace,
where can i get the payment key, the bitcoin account has to be regstered on bitcoin testnet/regtest environment ?
Can you please take some time to explain the keys that you wrote while the namespace commands, It would be great help
Thanks in Advance

You’d first make a keychain with blockstack-cli -t make_keychain to generate owner and payment private keys. You would then fund them on the testnet faucet at testnet.blockstack.org, and once they confirm (about 5 minutes), you should be able to run the above commands.

1 Like

Hello,
Can you please tell me what should be the reason and what action should i take to perform indexing of blocks ?