Bitcoin Forum
April 25, 2024, 07:30:33 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How does "balance" work in offline wallets?  (Read 604 times)
neurotypical (OP)
Hero Member
*****
Offline Offline

Activity: 672
Merit: 502


View Profile
November 16, 2017, 06:20:27 PM
Merited by ABCbits (1)
 #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?
"Bitcoin: mining our own business since 2009" -- Pieter Wuille
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714030233
Hero Member
*
Offline Offline

Posts: 1714030233

View Profile Personal Message (Offline)

Ignore
1714030233
Reply with quote  #2

1714030233
Report to moderator
1714030233
Hero Member
*
Offline Offline

Posts: 1714030233

View Profile Personal Message (Offline)

Ignore
1714030233
Reply with quote  #2

1714030233
Report to moderator
1714030233
Hero Member
*
Offline Offline

Posts: 1714030233

View Profile Personal Message (Offline)

Ignore
1714030233
Reply with quote  #2

1714030233
Report to moderator
pereira4
Legendary
*
Offline Offline

Activity: 1610
Merit: 1183


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: 3374
Merit: 4606



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
Legendary
*
Offline Offline

Activity: 2814
Merit: 6971



View Profile WWW
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.

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
neurotypical (OP)
Hero Member
*****
Offline Offline

Activity: 672
Merit: 502


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: 3374
Merit: 4606



View Profile
November 17, 2017, 04:07:05 PM
Last edit: November 17, 2017, 05:59:47 PM by DannyHamilton
Merited by ABCbits (2)
 #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: 377
Merit: 282


Finis coronat opus


View Profile
November 17, 2017, 04:14:14 PM
Merited by ABCbits (1)
 #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 (OP)
Hero Member
*****
Offline Offline

Activity: 672
Merit: 502


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: 2053
Merit: 1354


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: 2954
Merit: 4163


View Profile
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.


.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
piotr_n
Legendary
*
Offline Offline

Activity: 2053
Merit: 1354


aka tonikt


View Profile WWW
November 18, 2017, 09:14:53 AM
Merited by ABCbits (1)
 #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:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!