Hot answers tagged

36

The wiki is correct, it is a technicality. Bitcoin "balances" are actually just unspent transaction outputs (UTXOs, from previous transactions) which you have the ability to spend. In most cases, that means knowing the private key corresponding to an address which the transaction was sent to. But the address itself doesn't have a balance, it just "locks up" ...


27

There is no such thing as a transaction "balance". I am going to assume if I jump right to the answer it won't make much sense so the first two sections are to make sure we are how Bitcoin "really works" (at a very high level abstracted view). We need to speak the same language for the answer to make any sense. For this question the two required concepts ...


17

If your business partner knows your address, they can learn the transaction history and balance of that address. Often it is possible to guess or deduce that other addresses also belong to you, but this requires a bit more effort and is less reliable. However, this certainly doesn't translate to your complete wallet's balance and activity to be known. This ...


16

Bitcoin addresses do not actually exist on the Bitcoin network. They are an abstraction for humans to be able to easily send money to each other. What Bitcoin actually uses are transaction outputs. A transaction creates outputs which consist of the value and the output script. When you send money to someone, you are spending from an Unspent Transaction ...


15

If I'm sending someone my wallet-address, am I making my account balance visible to him? Yes. all transactions are public, means if I know the wallet address, I can reconstruct the current account balance Yes. All transactions of that address are in the blockchain, so they're public. Owners of bitcoin addresses are not explicitly identified, but all ...


14

The network doesn't know your current balance. The bitcoin network doesn't use the concept of "balances". Instead the Bitcoin ledger tracks assignments of value. So every bitcoin that exists was initially claimed by a miner, and then there have been assignments of value ever since. Now a bitcoin client can show a "balance" for an address but that ...


11

This guy wanted to do the same thing. You can find a solution there. in short: get a Linux Box/VM with >=8GB RAM download blockparser compile it run "./parser allBalances -w 250000 >allBalances.txt" the parser run take around 2 minutes on my vSphere VM (2x3Ghz Xeon, 16GB of RAM) now you have a list of the top 250.000 adresses sorted by ...


7

You are correct that anyone can see the balance of bitcoins in any address at any time. So a better way to keep your total balance private is to make a new address and ask your friend to send the coins to that address. Then, don't transfer the money to another existing address of yours. Any reasonable wallet software is capable of handling coins divided ...


7

If you are not going to use a 3rd party API, you'll need to run a node and add each address you want to query as a watch only address. If you are looking to create a database with all addresses, similar to a block explorer website, you'll need to parse the blockchain using something like abe, and then continually update your database for each new transaction....


7

The blockchain defines your balance, but it doesn't have a specific field in which your balance is stored. Yes, it needs to be analyzed to find your balance. However, it doesn't have to be analyzed all over again, just to check for the balance of a new address. Instead, checking the UTXO set (which only has to be created once and then to be updated every ...


6

The blockchain does not see wallets at all. It only sees spent and unspent transaction outputs (txouts). A txout is either completely spent or completely unspent - it cannot be "partially" spent and so there is no notion of balance. (If you want to spend less than the full value of a transaction, you create a change output.) In your example, there are ...


6

You can use a self-hosted (but low-burden!) instance of Esplora. Blockstream is also exposing an instance for free (at the moment) at blockstream.info. Disclaimer: if you take part of Bitcoin as an economic actor (as an application providing account balances may imply), you should really consider using your own source of truth and self-host the instance. It'...


6

At the protocol level, Bitcoin has no concept of "balances" or "addresses", and their common interpretation isn't relevant during verification. Every transaction spends "coins" and reforges them into new "coins" (called UTXOs). Every UTXO has a value (in number of satoshis) and an locking script. UTXOs are always spent ...


5

Your balance is the sum of UTXO (unspent transaction output) values in the blockchain since genesis block (block#0). UTXO is the coins that the addresses' you control (by having their private keys) received and you haven't spend. Your wallet keep reference to your UTXOs. So, no need to scan blockchain every time you spend.


5

It depends on what data structure you have put the UTXO set into. Different implementations do this in different ways, there is no one way to have the UTXO set. For instance, one implementation may not maintain a UTXO set but rather iterates through the entire blockchain. This would be O(n) where n is the number of TXOs in the blockchain. Other ...


5

You cannot because Bitcoin Core does not store such information. Bitcoin Core does not store all information for all addresses, it only stores information for its own addresses and the lower level information needed for verifying transactions (addresses are a higher level abstraction). There are no commands that allow you to get the balances or transactions ...


5

Nope. Not 1 bit. A balance (in this context) is the sum of all UTXO's for a given address. There is no limit on the number of UTXO's or their total amount (from the perspective of how the blockchain works and the blockchains limitations). Software interpreting the balance may have limitations on consuming, processing and/or displaying a number beyond a ...


5

When a sender creates a transaction, they explicitly define which pieces of bitcoin they spend. We call such pieces of bitcoin Unspent Transaction Outputs (UTXO) and you can think of the UTXO Set as the distributed ledger of Bitcoin's balances. The state of UTXO is ternary: they either don't exist yet, are available for spending, or have been spent. So, you ...


4

Either one of the factors may affect either balance: There is a double spend against one of your accounts Some transaction might not have yet been included in a block and one program does not see it yet There can be an error in one of the programs that skipped over some transactions. In case of the client, you should try rescanning the blockchain to make ...


4

You would need to use a client node that has a different architecture, from the satoshi's client. Specifically, the client must be able to quickly browse through all the unspent outputs. You may want to check this table for clients that support Multi-wallet. Among them, there is a new client Gocoin. It is currently in a testing phase, and you need to build ...


4

You only see the balance of blocks that have at least another 100 on top. This is because coinbase outputs only become spendable after 101 confirmations (the maturity period). After the nodes reconnect, and one block is mined by node0, node1's previous chain is reorganized away, and from that point on, both nodes work on the same chain. However, whenever a ...


4

I found the solution for this question. I used this class: /** * This class implements a {@link org.bitcoinj.wallet.CoinSelector} which attempts to select all outputs * from a designated address. Outputs are selected in order of highest priority. Note that this means we may * end up "spending" more priority than would be required to get the ...


4

Certainly. If you use the master public key (the xpub that you have), you can enter it into a site like blockchain.info to get the balances of many of the addresses derived from that key. Generally software that do this sort of monitoring (including your wallet software), only search a few addresses (all of the ones that have been used in a transaction and ...


4

That's exactly what the Sentinel app does: imports a read-only XPUB key in order to passively watch the balance of an offline wallet, be it paper wallet, trezor or ledger. For use with Ledger Nano S use the following steps: From the chrome app: Click My Account. Click Account Settings in the top right corner. Click Export next to Extended public key. In ...


4

You don't need to check the whole 62*62*62*62 addresses online through API. That would be an insanely long journey, and you'll get blacklisted at any free service before finding what you seek, no doubt. In your place I would: 1) download the daily balance snapshot from blockchair.com 2) either in Windows through Cygwin or in Linux shell, or in MacOS ...


4

In each of your channels, you have a local balance. This is the balance that is yours in that channel. The counterparty of the channel has the remote balance. All lightning transactions change these balances with each one resulting in their sum being the same and matching the channel capacity. As all transactions in that channel just end up changing the ...


4

Walletbalance is showing your on-chain balance of a lightning wallet. Regarding channel balances (locked on layer 2 and not available onchain): local balance is your local balance that you can spend on lightning network remote balance is balance in your channels but it's being owned by the other party in the channel, this is the amount you are able to ...


4

There are approximately 800,000 unique addresses on the blockchain with some Bitcoin held at those addresses at the present time according to blockchain.com. Let's assume these addresses are all bech32 (to simplify the calculation, in reality these are the minority). The witness program in a bech32 SegWit v0 P2WSH address is 32 bytes. In theory this means ...


3

If you live in the states the only service that comes close to this would be https://www.xmlgold.eu/ - you can even order a pre-paid credit card that you are able to top up with bitcoins. https://www.okpay.com/en/index.html - Okpay used to offer the same service but due to regulatory reasons they have ceased offering thier services to US citizens. The ...


3

You are trying to use addresses for accounting, but they aren't designed for that. What you actually want is the accounts feature of bitcoind, though I doubt any mobile wallet implements such a thing. If you say explicitly why do you think you need to do that, someone might have an answer. Meanwhile, just use the whole balance, and create a new address for ...


Only top voted, non community-wiki answers of a minimum length are eligible