Author [EN] [ZH] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] [EN] [ZH] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] [EN] [ZH] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] Topic: Problem with wallet_add_contact_account  (Read 288 times)

0 Members and 1 Guest are viewing this topic.

Offline pc

  • Hero Member
  • *****
  • Posts: 1130
    • View Profile
    • Bitcoin - Perspektive oder Risiko?
  • BTS: cyrano
  • Witness: cyrano
  • Payrate: 100%
Problem with wallet_add_contact_account
« on: September 25, 2014, 01:11:13 PM »

I have two wallets with one account each. One is meant for everyday use and has a registered account name. The other is more or less "cold", its account name is unregistered and I have imported my PTS private keys there.

Yesterday I wanted to transfer funds from my everyday wallet to the "cold" wallet. So I opened the cold wallet, dumped its public keys, then opened the "everyday" wallet and added the unregistered account name with one of its public keys:

Code: [Select]
(wallet closed) >>> open pts
OK
pts (locked) >>> wallet_account_list_public_keys pts.local
[{
    "hex": "035dc3a125cca19787b58b2ba8af5a056a322f62f006f3b440192e7c50704fec6e",
    "native_pubkey": "BTSX7YXcLiSCP4nZg4psBo8R9FscJTytHmXVj2mcLxG1Cv1y7BFrKa",
    "native_address": "BTSXMVZZy1WUMCXxtLimkCGERNpVkfT4YmK59",
    "pts_normal_address": "PazdTWzxRst9aei352AwD6QbdcLAaStcB7",
    "pts_compressed_address": "PqPoCfTNqDjF5Rd2Wavis47JMvCn6Cgx6u",
    "btc_normal_address": "144rKSJpfmw5nNuBhXX645AYPMuLiLtdDB",
    "btc_compressed_address": "1JU24amF57nBH9pB96Gsi2sF7fmxEY4uj5"
  },{
...
  }
]
pts (locked) >>> open pmc
OK
pmc (locked) >>> wallet_add_contact_account pts.local BTSX7YXcLiSCP4nZg4psBo8R9FscJTytHmXVj2mcLxG1Cv1y7BFrKa
Wallet automatically backed up to: /home/peter/.BitSharesX/wallets/.backups/pmc/pmc-20140925T130206-account_add.json
pmc (locked) >>> wallet_account_list_public_keys pts.local
[{
    "hex": "035dc3a125cca19787b58b2ba8af5a056a322f62f006f3b440192e7c50704fec6e",
    "native_pubkey": "BTSX7YXcLiSCP4nZg4psBo8R9FscJTytHmXVj2mcLxG1Cv1y7BFrKa",
    "native_address": "BTSXMVZZy1WUMCXxtLimkCGERNpVkfT4YmK59",
    "pts_normal_address": "PazdTWzxRst9aei352AwD6QbdcLAaStcB7",
    "pts_compressed_address": "PqPoCfTNqDjF5Rd2Wavis47JMvCn6Cgx6u",
    "btc_normal_address": "144rKSJpfmw5nNuBhXX645AYPMuLiLtdDB",
    "btc_compressed_address": "1JU24amF57nBH9pB96Gsi2sF7fmxEY4uj5"
  }
]

The last command verifies that "pts.local" in the "pmc" wallet uses the same keys as in the "pts" wallet.
For testing (luckily), I transferred 1 BTSX from pmc to pts.local:
Code: [Select]
pmc (unlocked) >>> transfer 1 BTSX pmc pts.local test
OK
pmc (unlocked) >>> wallet_account_transaction_history
TIMESTAMP           BLOCK     FROM                TO                  AMOUNT                  MEMO                                        BALANCE                 FEE                 ID     
==============================================================================================================================================================================================
...
2014-09-24T19:19:48 571251    pmc                 pts.local           1.00000 BTSX            test                           xxxx BTSX       0.10000 BTSX        c863a255
However, after opening + unlocking the "pts" wallet again the TX hasn't arrived. Blockchain is in sync. Rescan doesn't help.
What I don't understand is that blockchain_get_transaction shows a deposit to a completely different address:
Code: [Select]
pts (unlocked) >>> blockchain_get_transaction c863a255
{
  "trx": {
...
  "provided_deposits": [[
      "BTSXfPy1KbpGxb3iWw5AU8buTydCZXFA6WPi",{
        "amount": 100000,
        "asset_id": 0
      }
    ]
  ],
...
Any ideas?
Please vote for my BitShares witness "cyrano" and for my STEEM witness "cyrano.witness"!
Bitcoin - Perspektive oder Risiko? ISBN 978-3-8442-6568-2 http://bitcoin.quisquis.de

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12242
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BTS: xeroc
  • GitHub: xeroc
Re: Problem with wallet_add_contact_account
« Reply #1 on: September 25, 2014, 01:19:02 PM »
did I get this right that you send the funds to one if the keys listed in "wallet_account_list_public_keys" ?
That's not how coldstorage/TITAN works: http://wiki.bitshares.org/index.php/ColdStorage

how to recover:

1) assuming you've send to a pubkey P from one of your accounts
2) export the private key that corresponds to that public key P by "wallet_dump_private_key P"
3) go to your cold storage computer and add a new account like this:
wallet_import_private_key P local-coldstorage true true

after the rescan your funds should be back!
« Last Edit: September 25, 2014, 01:21:13 PM by xeroc »
Give BitShares a try! Use the http://testnet.bitshares.eu provided by http://bitshares.eu powered by ChainSquad GmbH

Offline pc

  • Hero Member
  • *****
  • Posts: 1130
    • View Profile
    • Bitcoin - Perspektive oder Risiko?
  • BTS: cyrano
  • Witness: cyrano
  • Payrate: 100%
Re: Problem with wallet_add_contact_account
« Reply #2 on: September 25, 2014, 03:11:22 PM »
I guess I should have avoided the term "cold storage". It's a normal wallet that I usually keep closed, nothing more.

I have two wallets A and B. I have used wallet_account_list_public_keys to get the public keys from the account in wallet B. I have used wallet_add_contact_account in wallet A to add an unregistered account X with one of the public keys from B. Then I sent BTSX from A to X, assuming that they would arrive in wallet B.

I'd assume that wallet B already has all the private keys corresponding to the public keys returned by wallet_account_list_public_keys . Why is that not sufficient? (Your cold storage link says how to do this, but not why it has to be done that way.)
Please vote for my BitShares witness "cyrano" and for my STEEM witness "cyrano.witness"!
Bitcoin - Perspektive oder Risiko? ISBN 978-3-8442-6568-2 http://bitcoin.quisquis.de

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12242
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BTS: xeroc
  • GitHub: xeroc
Re: Problem with wallet_add_contact_account
« Reply #3 on: September 25, 2014, 03:27:05 PM »
you cannot send funds to a **public key**  .. what happens under the hood is TITAN ... it derives a new address from the given public key and send the funds there .. you can check in the transaction details ..

in order to gain access again to your funds .. you need to create a new account which uses the private key of your chosen pubkey as TITAN ACCOUNT private key .. I wrote the steps above!
Give BitShares a try! Use the http://testnet.bitshares.eu provided by http://bitshares.eu powered by ChainSquad GmbH

Offline pc

  • Hero Member
  • *****
  • Posts: 1130
    • View Profile
    • Bitcoin - Perspektive oder Risiko?
  • BTS: cyrano
  • Witness: cyrano
  • Payrate: 100%
Re: Problem with wallet_add_contact_account
« Reply #4 on: September 25, 2014, 03:44:40 PM »
So... if I understand this correctly, there is one special TITAN key for each account, which is the one listed by wallet_list_accounts, and what I have done works only with *THAT* key? And any other keys imported into the account are *not* TITAN keys and can therefore not be used in that way?

(Just trying to understand what's going on here. I don't really care if I can recover that 1 BTSX or not.)
Please vote for my BitShares witness "cyrano" and for my STEEM witness "cyrano.witness"!
Bitcoin - Perspektive oder Risiko? ISBN 978-3-8442-6568-2 http://bitcoin.quisquis.de

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12242
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BTS: xeroc
  • GitHub: xeroc
Re: Problem with wallet_add_contact_account
« Reply #5 on: September 25, 2014, 03:49:26 PM »
So... if I understand this correctly, there is one special TITAN key for each account, which is the one listed by wallet_list_accounts, and what I have done works only with *THAT* key? And any other keys imported into the account are *not* TITAN keys and can therefore not be used in that way?
basically yes ..

the keys under list_pubkeys are either imported manually (ie, to access genesis stake) or already generated by TITAN from the account master key ..
no idea what reason there is to even show all of them to the user ..

have you tried the above description already? is it working? curious to know as I never tried it that way :)
Give BitShares a try! Use the http://testnet.bitshares.eu provided by http://bitshares.eu powered by ChainSquad GmbH

Offline pc

  • Hero Member
  • *****
  • Posts: 1130
    • View Profile
    • Bitcoin - Perspektive oder Risiko?
  • BTS: cyrano
  • Witness: cyrano
  • Payrate: 100%
Re: Problem with wallet_add_contact_account
« Reply #6 on: September 25, 2014, 04:11:29 PM »
have you tried the above description already? is it working? curious to know as I never tried it that way :)

Yup, worked. :-) Using the correct pubkey with wallet_add_contact_account produces the desired result, too.

Thanks a lot!
Please vote for my BitShares witness "cyrano" and for my STEEM witness "cyrano.witness"!
Bitcoin - Perspektive oder Risiko? ISBN 978-3-8442-6568-2 http://bitcoin.quisquis.de

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12242
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BTS: xeroc
  • GitHub: xeroc
Re: Problem with wallet_add_contact_account
« Reply #7 on: September 25, 2014, 05:02:08 PM »
I thank your for doing theses steps .. now I don't need to verify that my theory is correct anymore :)
Give BitShares a try! Use the http://testnet.bitshares.eu provided by http://bitshares.eu powered by ChainSquad GmbH

 

Google+