Bitcoin Forum
May 22, 2024, 09:40:03 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Non-zero final balance of input address  (Read 150 times)
Chaotic_4 (OP)
Newbie
*
Offline Offline

Activity: 13
Merit: 1


View Profile
October 27, 2020, 11:47:51 PM
Merited by Rizzrack (1)
 #1

I sent an amount to an address and my transaction has as input multiple addresses of my wallet. As a result, most of the input addresses have a non-zero final balance after the transaction. Is this normal? I know that there is a security issue if you use an address as input and it still has a positive balance after the transaction. I have seen this topic explained by Antonopoulos but I don't know if it is an important security issue. Is there a way to make my used addresses to have 0 final balance?
RHavar
Legendary
*
Offline Offline

Activity: 2557
Merit: 1886



View Profile
October 28, 2020, 12:30:46 AM
Merited by ABCbits (1)
 #2

I wrote a technical reply, but I realize it's probably on the wrong level.

I know that there is a security issue if you use an address as input and it still has a positive balance after the transaction.

Theoretically. And people love flexing this bit of trivia, but in reality it's not an issue. There's literally tens of billions of dollars of bitcoin with an exposed public key (the problem with having a positive balance after a transaction), and it's never been a real concern.

But the best way to avoid this is is to try not to reuse addresses. Sometimes it's going to be unavoidable (people will unsolicited send you money, normally tiny amounts) but generally with a bit of effort you can create a new address for every time you receive money. There are some nice privacy (and organizational) benefits to doing this.

So yeah, try avoid re-using addresses. But don't worry about your money getting jacked if you don't.

Quote
Is there a way to make my used addresses to have 0 final balance?
Some wallets (but most won't) will try spend all money from an address when spending from that address. It's done for privacy reasons really, but generally done at the expense of less desirable coin-selection [Although most wallets are literally so bad at coin selection that it's actually hard to do worse]

Check out gamblingsitefinder.com for a decent list/rankings of crypto casinos. Note: I have no affiliation or interest in it, and don't even agree with all the rankings ... but it's the only uncorrupted review site I'm aware of.
odolvlobo
Legendary
*
Offline Offline

Activity: 4326
Merit: 3234



View Profile
October 28, 2020, 08:32:14 AM
Merited by ABCbits (1)
 #3

I sent an amount to an address and my transaction has as input multiple addresses of my wallet. As a result, most of the input addresses have a non-zero final balance after the transaction. Is this normal? I know that there is a security issue if you use an address as input and it still has a positive balance after the transaction. I have seen this topic explained by Antonopoulos but I don't know if it is an important security issue. Is there a way to make my used addresses to have 0 final balance?

When your wallet chooses inputs, it doesn't seem to consider addresses at all. If you want to ensure that an address has no balance after being used as an input, you should receive bitcoins at the address only once.

Join an anti-signature campaign: Click ignore on the members of signature campaigns.
PGP Fingerprint: 6B6BC26599EC24EF7E29A405EAF050539D0B2925 Signing address: 13GAVJo8YaAuenj6keiEykwxWUZ7jMoSLt
gmaxwell
Moderator
Legendary
*
expert
Offline Offline

Activity: 4186
Merit: 8424



View Profile WWW
October 29, 2020, 12:22:09 AM
Merited by ABCbits (1), Rizzrack (1)
 #4

When your wallet chooses inputs, it doesn't seem to consider addresses at all. If you want to ensure that an address has no balance after being used as an input, you should receive bitcoins at the address only once.
Current versions of Bitcoin core will first try to spend all outputs paid to a common address as a group.

That behavior is controlled by two options:

Quote
    -avoidpartialspends
       Group outputs by address, selecting all or none, instead of selecting on
       a per-output basis. Privacy is improved as an address is only
       used once (unless someone sends to it after spending from it),
       but may result in slightly higher fees as suboptimal coin
       selection may result due to the added limitation (default: 0
       (always enabled for wallets with "avoid_reuse" enabled))

     -maxapsfee=<n>
       Spend up to this amount in additional (absolute) fees (in BTC) if it
       allows the use of partial spend avoidance (default: 0.00)


The first, if enabled, forces all payments to the same address to always be grouped.

Otherwise,  it tries computing the transaction both ways, and if the grouped way doesn't pay more than a threshold amount of fees more then it uses the grouped way.  The default threshold is the conservative value of 0.  ... so it will prefer to group the inputs, but only if doing so doesn't make it pay more in total fees.


This is still kinda dumb: the threshold should probably be in terms of fee ABOVE the minimum feerate (e.g. so if your transaction is at the minimum feerate, it'll always do it, because you were going to pay the minimum feerate eventually in any case)... but at least it's something.
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!