Owner_address/payment_address and transferring Onename account


#1

Recently I transferred my Onename to Blockstack CLI (using Export username command in Settings). As far as I understand, all names transfers should be made to owner_address value from wallet.json file. So I entered my owner_address in the Onename settings. The transfer was made, but, strangely, to my payment_address instead. Here is my name:
https://explorer.blockstack.org/name/spankratov.id
"3NTpMHx4yzm9fBogfBWbkYGYTXiNrMLZQr" is my payment_address.
So when I call command “blockstack names”, it shows zero amount of owned names. But I tried to change my owner_address to my payment_address in wallet.json, and “blockstack names” recognized my name.

My question is what’s the connection between owner_address and payment_address. How it happened that my name went to my payment_address? And what should I do now? Should I temporarily replace my owner_address to my payment_address and then transfer spankratov.id name to my actual owner_address?


#2

Hey @spankratov,

My question is what’s the connection between owner_address and payment_address. How it happened that my name went to my payment_address? And what should I do now? Should I temporarily replace my owner_address to my payment_address and then transfer spankratov.id name to my actual owner_address?

A Blockstack wallet has two sets of keys: the owner keys, and the payment keys. The payment keys control the BTC that you pay to issue name registrations and name updates. The owner keys sign off on the name operations themselves. The idea is that you can have a 3rd party wallet (e.g. OpenBazaar, Onename, your existing Bitcoin wallet, a 3rd party name registrar) pay for your name operations while you retain ownership.

The keys themselves are encrypted in the wallet.json file. The owner_address and payment_address fields are pre-computed and stored in the wallet so you can run commands like blockstack names or blockstack balance without having to decrypt your keys. That’s why when you swapped the owner_address and payment_address fields, your names showed up in blockstack names. However, if you try to issue a name update or transfer, it will fail since the owner_address will not match the encrypted owner keys.

You can fix this by re-importing the wallet and swapping your owner private keys with your payment private keys. You can do this as follows:

  1. Run blockstack wallet to get your owner and payment private keys. Here’s an example:
$ blockstack wallet
Enter wallet password: 
------------------------------------------------------------
Payment address:	3KcPG2zH1qJBf8ZmypUTwhVxUwNnqRWhsP
Owner address:		3AWmgj8XPhf5cYizfbpzKuYCYCXMQtmvQu
Data public key:	04681425fbde7a3cc1636098c727ce31315e30a5dff2cec02ebe0eb8ceaeb61fe50245ce0b363df00af8bae9a9dc1d26ac827d04fbea79e62e240504371234199d
Failed to look up balance
Names Owned:
3AWmgj8XPhf5cYizfbpzKuYCYCXMQtmvQu: []
------------------------------------------------------------
Payment private key info: 13e218818c5d9fdf2686cf1a88d8fdafa2a60eaf3798728c018f1722f276160301,a76b25ba8a6ae27611d4884aebffe3a6bb5593935272462a962e6a5cadbfd1ec01,bcc786f3c02fd55bdcd0c6a5485db7f24e6484be036c168de27feda13a1e7be301
Owner private key info:   10bb646e5efe625513ebab262054b32d7d5867f8446c60b80f96fa320da87d1001,a113e15e02ecc511af0fec9f3c0e40d0cdb1eb6de19a108820c894f0d43d734301,d6abc4e20be519aeeca9819952e20a3e4b614310b535605498e8e9f52e719d0001
Data private key info:    605727b68c290e67743829950bf506b41b8206800bc297d74add0310598ccc2801
------------------------------------------------------------
{
    "data_privkey": "605727b68c290e67743829950bf506b41b8206800bc297d74add0310598ccc2801", 
    "data_pubkey": "04681425fbde7a3cc1636098c727ce31315e30a5dff2cec02ebe0eb8ceaeb61fe50245ce0b363df00af8bae9a9dc1d26ac827d04fbea79e62e240504371234199d", 
    "owner_address": "3AWmgj8XPhf5cYizfbpzKuYCYCXMQtmvQu", 
    "owner_privkey": {
        "address": "3AWmgj8XPhf5cYizfbpzKuYCYCXMQtmvQu", 
        "private_keys": [
            "10bb646e5efe625513ebab262054b32d7d5867f8446c60b80f96fa320da87d1001", 
            "a113e15e02ecc511af0fec9f3c0e40d0cdb1eb6de19a108820c894f0d43d734301", 
            "d6abc4e20be519aeeca9819952e20a3e4b614310b535605498e8e9f52e719d0001"
        ], 
        "redeem_script": "522102f91daa2a2239e7e22130862f33af33b0f8264bcb16a64cdc8cf30d84776cba2a2102042151e2d3a6f524d48aa6702fce3dfbd6f738438112528073965a7c6081923021028d7021c81dfeaf35df057908486f258bd6e258839189f26fb8e409b23c2186da53ae"
    }, 
    "payment_address": "3KcPG2zH1qJBf8ZmypUTwhVxUwNnqRWhsP", 
    "payment_privkey": {
        "address": "3KcPG2zH1qJBf8ZmypUTwhVxUwNnqRWhsP", 
        "private_keys": [
            "13e218818c5d9fdf2686cf1a88d8fdafa2a60eaf3798728c018f1722f276160301", 
            "a76b25ba8a6ae27611d4884aebffe3a6bb5593935272462a962e6a5cadbfd1ec01", 
            "bcc786f3c02fd55bdcd0c6a5485db7f24e6484be036c168de27feda13a1e7be301"
        ], 
        "redeem_script": "522102d7ba8c48bfefb3990c87d497fdc38885c78bbdf6c4bac042657963e6e91f7b222103c147036aed4e95ce38f016286c54408488c5ce67de204139600b9a8202f506422103b6103479f309f861a8f7889087ca121830d120ac4e27299145caac4dbc3ca63653ae"
    }
}

You’ll see that my payment private keys are 13e218818c5d9fdf2686cf1a88d8fdafa2a60eaf3798728c018f1722f276160301,a76b25ba8a6ae27611d4884aebffe3a6bb5593935272462a962e6a5cadbfd1ec01,bcc786f3c02fd55bdcd0c6a5485db7f24e6484be036c168de27feda13a1e7be301, and my owner private keys are 10bb646e5efe625513ebab262054b32d7d5867f8446c60b80f96fa320da87d1001,a113e15e02ecc511af0fec9f3c0e40d0cdb1eb6de19a108820c894f0d43d734301,d6abc4e20be519aeeca9819952e20a3e4b614310b535605498e8e9f52e719d0001.

  1. If you have any BTC on your current payment address, you should transfer your payment balance to your owner address. You can do this with blockstack withdraw OWNER_ADDRESS. This way, when we swap your owner and payment keys below, you’ll still have your balance available.

  2. Move your old wallet out of the way. This can be done as follows:

$ mv ~/.blockstack/wallet.json ~/.blockstack/wallet.json.old
  1. Run blockstack import_wallet with your owner private keys and payment private keys swapped. When prompted for your owner private keys, put in your payment private keys. When prompted for your payment private keys, put in your owner private keys.

Be sure to put 2,3, before your keys, so blockstack knows to send a 2-of-3 multisig transaction in the future. You can just paste this in front of your key list from blockstack wallet.

Example:

$ blockstack import_wallet

Interactive prompt engaged.  Press Ctrl+C to quit
Help for "import_wallet": Set the payment, owner, and data private keys for the wallet.

optional: Payment private key.  M-of-n multisig is supported by passing the CSV string "m,n,pk1,pk2,...". ("payment_privkey"): 2,3,10bb646e5efe625513ebab262054b32d7d5867f8446c60b80f96fa320da87d1001,a113e15e02ecc511af0fec9f3c0e40d0cdb1eb6de19a108820c894f0d43d734301,d6abc4e20be519aeeca9819952e20a3e4b614310b535605498e8e9f52e719d0001
optional: Name owner private key.  M-of-n multisig is supported by passing the CSV string "m,n,pk1,pk2,...". ("owner_privkey"): 2,3,13e218818c5d9fdf2686cf1a88d8fdafa2a60eaf3798728c018f1722f276160301,a76b25ba8a6ae27611d4884aebffe3a6bb5593935272462a962e6a5cadbfd1ec01,bcc786f3c02fd55bdcd0c6a5485db7f24e6484be036c168de27feda13a1e7be301
optional: Data-signing private key.  Must be a single private key. ("data_privkey"): 605727b68c290e67743829950bf506b41b8206800bc297d74add0310598ccc2801
Enter new password: 
Confirm new password: 
{
    "status": true
}

(I got the value for the last field, the Data-signing private key, from blockstack wallet).

This should swap your owner and payment keys, and you should see your name with blockstack names now. Also, blockstack balance should show you your current balance.

Hope this helps!


Sent Onename to the wrong Blockstack address, can I correct it?
#3

Hello, @jude. Thank you for clarification and instruction!
I would also like to use my name in Blockstack Portal. It seems that there’s no one easy command to do this, as Blockstack Core and Blockstack Portal use different owner keys, according to this topic: Backing up macOS app wallets
Is there any manual way to use my owner_address in Blockstack Portal? For instance, can I somehow retrieve or generate backup phrase for my owner_address in Blockstack Core so that I could use this phrase in Blockstack Portal?


#4

Hi @spankratov, I’m not sure. We’ll have to ask @larry and @ryan.


#5

You’d have to send your name to an address in the Portal. In this case you’d no longer be able to use it in CLI or Onename.

The bad news is that there’s currently no easy way to get an owner address in the portal.

The good news is I opened a github issue to add this feature:


#6

Thanks, @larry! I was able to get my Portal owner address through Firebug Net panel, so I guess the transfer is going to be okay right now.


#7

Awesome! Let us know how it goes! Very excited to hear your feedback!


#8

This is an issue I am currently trying to solve myself. Hoping there is an easier solution in future because even as a programmer comfortable with the terminal I am still struggling to try figure out how to get it sorted. I’m sure I’ll get there in the end but at the moment it is preventing me from even starting to build things for Blockstack as I want to get my identity and wallet sorted before I do.

My current issue similar to this one. First I’m trying to make sure I don’t lose my BTC in the process…


#9

I have followed @jude’s guide above and it seems to have worked now. Originally, I had followed it but was getting an error running blockstack wallet going for some reason. Not sure if it was due to the API not running (or running under another signed in user) causing issues. In any case the above guide seems to have worked. Thank you!


Sent Onename to the wrong Blockstack address, can I correct it?
#10

I got following error when trying to import my old wallet:

{
“error”: “Failed to make multisig information”
}

My old wallet version was “version”: “0.14.1”, are there any compatability issues with latest versions.