Bitcoin Forum
September 24, 2018, 08:35:30 PM *
News: ♦♦ New info! Bitcoin Core users absolutely must upgrade to previously-announced 0.16.3 [Torrent]. All Bitcoin users should temporarily trust confirmations slightly less. More info.
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: How does "balance" work in offline wallets?  (Read 497 times)
neurotypical
Hero Member
*****
Offline Offline

Activity: 672
Merit: 500


View Profile
November 16, 2017, 06:20:27 PM
 #1

I was considering setting up an offline wallet setup, maybe with for example Armory, which looks like the best cold storage wallet for desktops (or laptops). The thing is, I don't understand how are you supposed to get track of how many bitcoins you have, if your computer never touches the internet.

Let's say it's a proper air-gapped laptop with Armory installed on it, where I create receiving addresses, and make the transactions, to then be passed upon an online computer running a node. When I receive transactions on Armory's addresses (or make transactions) how does Armory know what my current balance is if it never reads the blockchain? How can it know how much to add or subtract to show up an updated correct balance?
1537821330
Hero Member
*
Offline Offline

Posts: 1537821330

View Profile Personal Message (Offline)

Ignore
1537821330
Reply with quote  #2

1537821330
Report to moderator
1537821330
Hero Member
*
Offline Offline

Posts: 1537821330

View Profile Personal Message (Offline)

Ignore
1537821330
Reply with quote  #2

1537821330
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1537821330
Hero Member
*
Offline Offline

Posts: 1537821330

View Profile Personal Message (Offline)

Ignore
1537821330
Reply with quote  #2

1537821330
Report to moderator
1537821330
Hero Member
*
Offline Offline

Posts: 1537821330

View Profile Personal Message (Offline)

Ignore
1537821330
Reply with quote  #2

1537821330
Report to moderator
1537821330
Hero Member
*
Offline Offline

Posts: 1537821330

View Profile Personal Message (Offline)

Ignore
1537821330
Reply with quote  #2

1537821330
Report to moderator
pereira4
Legendary
*
Offline Offline

Activity: 1386
Merit: 1052


View Profile
November 16, 2017, 06:25:23 PM
 #2

Good question, I was wondering the same the other day, since I have never tried offline wallets myself.

My guess is: You simply can't.

You have to trade off the comfort of having up-to-date balance on your cold storage computer, so you would need use a "watch-only" wallet. I don't know how this would be set up, but basically, this wallet would only contain your public addresses in the online computer, without the private addresses of course, this way you can check your balance updated without risks of a hack.
DannyHamilton
Legendary
*
Offline Offline

Activity: 2198
Merit: 1373



View Profile
November 16, 2017, 07:42:51 PM
 #3

- snip -
to then be passed upon an online computer running a node.
- snip -


That's your answer right there.

If you are sending transactions, then you have an online component.  That inline component might be a watch-only wallet, or it might capture block information to be manually transferred to the offline component.

Regardless, the online component (which will not have any access to the private keys if you have configured it properly) is what you would use to collect the information necessary for seeing balances.

TryNinja
Hero Member
*****
Offline Offline

Activity: 770
Merit: 760


ChipMixer's Badge of Honor


View Profile
November 16, 2017, 07:44:39 PM
 #4

Most of the time, it doesn't.

A offline wallet is most of the time meant to sign your transactions. You create a watch-only wallet and use it to create transactions (since it's connected to the internet, you can see all inputs available to be spent), move the raw transaction to your offline pc, sign the transaction and broadcast it through a connected device. Or at least, that's exactly how I make use of my cold-storage setup.

neurotypical
Hero Member
*****
Offline Offline

Activity: 672
Merit: 500


View Profile
November 17, 2017, 03:48:05 PM
 #5

Most of the time, it doesn't.

A offline wallet is most of the time meant to sign your transactions. You create a watch-only wallet and use it to create transactions (since it's connected to the internet, you can see all inputs available to be spent), move the raw transaction to your offline pc, sign the transaction and broadcast it through a connected device. Or at least, that's exactly how I make use of my cold-storage setup.

But the raw transaction should be made on the offline PC, otherwise this raw transaction data could be compromised if it's made on an online PC...

Anyone knows how to properly set up a watch-only wallet to keep track of your offline wallet's balance?

- snip -
to then be passed upon an online computer running a node.
- snip -


That's your answer right there.

If you are sending transactions, then you have an online component.  That inline component might be a watch-only wallet, or it might capture block information to be manually transferred to the offline component.

Regardless, the online component (which will not have any access to the private keys if you have configured it properly) is what you would use to collect the information necessary for seeing balances.

What software do you recommend as a watch-only wallet? Can I set up the node itself (Bitcoin Core's wallet) to be watch-only with the public addresses of my offline wallet?
DannyHamilton
Legendary
*
Offline Offline

Activity: 2198
Merit: 1373



View Profile
November 17, 2017, 04:07:05 PM
 #6

But the raw transaction should be made on the offline PC, otherwise this raw transaction data could be compromised if it's made on an online PC...

The transaction is built on the online wallet (or at least on a wallet that has access to enough of the blockchain).  Then it is brought to the offline wallet for signing.  Before signing, the offline wallet can display the transaction to the user.  It will be able to see all the outputs in the transaction, and so will be able to tell the user exactly how much BTC is being sent to each address.  The one thing the offline wallet might not reliably have access to is the value of the inputs (the online wallet that built the transaction theoretically could lie about the value of those inputs).  In that case, you could theoretically pay a larger (or smaller) transaction fee than intended.  This isn't likely to happen, and with coin control you could manually verify the values of the inputs if you wanted to.

Anyone knows how to properly set up a watch-only wallet to keep track of your offline wallet's balance?

That depends on which software you want to do it with.  If you are using Armory, or Electrum, then the online portion of the wallet should handle that for you.

What software do you recommend as a watch-only wallet?

That depends on your use case.  If you want a lightweight wallet and don't mind giving up a small amount of privacy, then Electrum is a good choice.  If you prefer a full node, then I believe it is possible to import addresses for watch-only into Bitcoin Core.  If you prefer something more mobile and don't mind the occasional issue with reliability then blockchain.info is a good choice.

Can I set up the node itself (Bitcoin Core's wallet) to be watch-only with the public addresses of my offline wallet?

I haven't done it myself, but I believe it is possible.

TechPriest
Sr. Member
****
Offline Offline

Activity: 353
Merit: 255



View Profile
November 17, 2017, 04:14:14 PM
 #7

The thing is, I don't understand how are you supposed to get track of how many bitcoins you have, if your computer never touches the internet.
It's simple: if your're import private key then it's "balance" are in blockchain already. If you're create a new one and sending bitcoins to this address - in  cold storage you will never see it. But bitcoins will be on it.
Paper wallet it's good example.

When I receive transactions on Armory's addresses (or make transactions) how does Armory know what my current balance is if it never reads the blockchain? How can it know how much to add or subtract to show up an updated correct balance?

As i said above it will not "know" about "balance". If it's really offline wallet.

What software do you recommend as a watch-only wallet? Can I set up the node itself (Bitcoin Core's wallet) to be watch-only with the public addresses of my offline wallet?

Yes, you need xpub (public master key) from your offline wallet and you can import it to some services and core wallet.

You need software with HD wallets supporting. Only in HD wallets you can create xpub or xpriv

In science we trust!
neurotypical
Hero Member
*****
Offline Offline

Activity: 672
Merit: 500


View Profile
November 17, 2017, 05:05:01 PM
 #8

It's simple: if your're import private key then it's "balance" are in blockchain already. If you're create a new one and sending bitcoins to this address - in  cold storage you will never see it. But bitcoins will be on it.
Paper wallet it's good example.

Yes, im aware of that, it is pretty obvious actually now that I think of it, it would be impossible to keep track of your coins in an offline computer.


Yes, you need xpub (public master key) from your offline wallet and you can import it to some services and core wallet.

You need software with HD wallets supporting. Only in HD wallets you can create xpub or xpriv

Why would I need to do that?

If I want to keep track of addresses A B and C, I just need a software that would let me list the public A B and C addresses and keep the balance updated for me, so I don't need to go to blockchain.info and sum the amounts manually. It would actually be easy to program but I don't have the time for that, im sure such a program exists. If Bitcoin Core can do this please tell me how.
piotr_n
Legendary
*
Offline Offline

Activity: 1932
Merit: 1018


aka tonikt


View Profile WWW
November 17, 2017, 07:17:05 PM
 #9

you can use whatever method you want for keeping track of a balance at the bitcoin addresses you need.
afaik, bitcoin core also has some kind of "watch address" feature.

for spending. to make the transaction, you need the balance data - which is basically the content of all the transactions that have sent to this wallet.
the format of this data is pretty much implementation specific these day.
armory has their own format, my software its own, hardware wallets also their own.
there is no one common standard and that's why it's quite hard to make a node and a wallet from two different origins to work together.

Check out gocoin - my original project of full bitcoin node & cold wallet written in Go.
PGP fingerprint: AB9E A551 E262 A87A 13BB  9059 1BE7 B545 CDF3 FD0E
ranochigo
Legendary
*
Offline Offline

Activity: 1554
Merit: 1094


View Profile WWW
November 18, 2017, 05:25:49 AM
 #10

Why would I need to do that?

If I want to keep track of addresses A B and C, I just need a software that would let me list the public A B and C addresses and keep the balance updated for me, so I don't need to go to blockchain.info and sum the amounts manually. It would actually be easy to program but I don't have the time for that, im sure such a program exists. If Bitcoin Core can do this please tell me how.
Yes. The recommended behavior of spending is to spend the change to a different address to promote privacy. If you are using a HD wallet and you have a xpub (for non-hardened HD wallets only), your online wallet will be able to check all the addresses that is linked to your seed. IIRC, Core can do this. Use import address.

for spending. to make the transaction, you need the balance data - which is basically the content of all the transactions that have sent to this wallet.
the format of this data is pretty much implementation specific these day.
armory has their own format, my software its own, hardware wallets also their own.
there is no one common standard and that's why it's quite hard to make a node and a wallet from two different origins to work together.
Just the UTXO will do.


piotr_n
Legendary
*
Offline Offline

Activity: 1932
Merit: 1018


aka tonikt


View Profile WWW
November 18, 2017, 09:14:53 AM
 #11

Just the UTXO will do.
Not if you want to verify (at the offline wallet) what you are actually spending.

For that you need the entire transaction to calculate its hash (ID).
This is to make sure that the output you are signing does not carry more coins than you expect it to.

Check out gocoin - my original project of full bitcoin node & cold wallet written in Go.
PGP fingerprint: AB9E A551 E262 A87A 13BB  9059 1BE7 B545 CDF3 FD0E
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!