Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: Erkallys on December 15, 2015, 09:52:52 AM



Title: Is it possible to import a private key offline ?
Post by: Erkallys on December 15, 2015, 09:52:52 AM
The title talks by itself. Is it possible to import a private key into an offline Bitcoin Core/lightwallet ? If it possible there is no risk of fraud, by adding fake bitcoins to an address and then spend it elsewhere ?


Title: Re: Is it possible to import a private key offline ?
Post by: altcoinhosting on December 15, 2015, 09:53:51 AM
Sure, you can import a private key in an offline bitcoin core client and use it to sign transactions :)


Title: Re: Is it possible to import a private key offline ?
Post by: Erkallys on December 15, 2015, 09:58:24 AM
Sure, you can import a private key in an offline bitcoin core client and use it to sign transactions :)

But how do your computer that is not connected to the internet how much BTC there is on it ? If funds are added, will your balance be actualised ?


Title: Re: Is it possible to import a private key offline ?
Post by: Was on December 15, 2015, 10:08:14 AM
The network "knows".

When you "send" coins, you're actually just changing the ownership of a previous input, by signing a transaction with your private key and creating/broadcasting an output.


Title: Re: Is it possible to import a private key offline ?
Post by: altcoinhosting on December 15, 2015, 10:12:07 AM
Sure, you can import a private key in an offline bitcoin core client and use it to sign transactions :)

But how do your computer that is not connected to the internet how much BTC there is on it ? If funds are added, will your balance be actualised ?

you should create the transaction with an online wallet, then transfer it to your offline machine where you imported the private key, and sign it offline... Afterwards you need to transfer the signed transaction to an online machine to broadcast it...

There are some good step by step guides on this forum on how to achieve this ;)


Title: Re: Is it possible to import a private key offline ?
Post by: DannyHamilton on December 15, 2015, 12:24:34 PM
The title talks by itself. Is it possible to import a private key into an offline Bitcoin Core/lightwallet?

Yes.  It is possible to import a private key into an offline wallet.


But how do your computer that is not connected to the internet how much BTC there is on it?

It doesn't.

You could copy the blockchain from an online wallet and then your offline wallet could compute the balance as of the time that the blockchain was copied.

or

You could run an online copy of the wallet with bitcoin addresses only (no private keys). This online wallet could calculate balances and allow you to create transactions. Then you could transport the unsigned transaction to the offline wallet to be signed.  Then you could transport the signed transaction back to the online wallet to be broadcast.  This is how Electrum Offline and Armory Offline work.

If funds are added, will your balance be actualised ?

Only on the online wallet (unless you copy the blockchain to the offline wallet).

If it possible there is no risk of fraud, by adding fake bitcoins to an address and then spend it elsewhere ?

It is not possible to spend fake bitcoins.  Bitcoins don't actually exist in a technical sense.  There are only transactions.  When you "spend", you are actually spending the unspent outputs of previous valid transactions.  Therefore, if there isn't a valid previous transaction to spend, then you aren't able to create a valid transaction.


Title: Re: Is it possible to import a private key offline ?
Post by: Was on December 15, 2015, 03:38:51 PM
Danny comes in for the dunk!

Thanks Danny


Title: Re: Is it possible to import a private key offline ?
Post by: moneyart on December 15, 2015, 07:20:12 PM
To import a private key offline you have to open the console of your core client and then type:

importprivkey <privkey>

Before that you have to set a password timeout. Most common use of this technique is to redeem the amount on a paper wallet.