Bitcoin Forum
December 15, 2024, 09:55:06 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 2 [3] 4 5 6 7 »  All
  Print  
Author Topic: Stats on malled transactions  (Read 17404 times)
itod
Legendary
*
Offline Offline

Activity: 1988
Merit: 1077


Honey badger just does not care


View Profile
February 11, 2014, 10:53:58 PM
 #41

I think you are misunderstanding.  

...

Right now there is no way for an average user to force the client to only used confirmed change in new transactions even if they wanted to, other than manually wait and make sure they have no unconfirmed change outputs before sending funds.

I see what you mean, you are right. Would a simple configuration option whether to show unconfirmed inputs in the balance do the trick? No may be the default option, and you can always go to the console and temporarily force the opposite behavior if you want to. It may not even mess up how QT client handles the blockchain, just how it calculates the balance.

Edit: I have to check how it is this done right now in the code. I'm not positive how the balance is calculated.
klondike_bar
Legendary
*
Offline Offline

Activity: 2128
Merit: 1005

ASIC Wannabe


View Profile
February 11, 2014, 10:59:09 PM
 #42

I think you are misunderstanding.  

...

Right now there is no way for an average user to force the client to only used confirmed change in new transactions even if they wanted to, other than manually wait and make sure they have no unconfirmed change outputs before sending funds.

I see what you mean, you are right. Would a simple configuration option whether to show unconfirmed inputs in the balance do the trick? No may be the default option, and you can always go to the console and temporarily force the opposite behavior if you want to. It may not even mess up how QT client handles the blockchain, just how it calculates the balance.

Edit: I have to check how it is this done right now in the code. I'm not positive how the balance is calculated.

THIS.

I compared my wallet balance against the transaction export and found that the two DID NOT MATCH. my hot wallet is 'richer' by exactly the amount in the second transaction's change wallet - I am not 100% sure which total is correct, though I imagine the wallet balance is the correct version

EDIT: my client just forced me to undergo 'reindexing blocks on disk', a process that appears to be going to take ~20min

24" PCI-E cables with 16AWG wires and stripped ends - great for server PSU mods, best prices https://bitcointalk.org/index.php?topic=563461
No longer a wannabe - now an ASIC owner!
Loozik
Sr. Member
****
Offline Offline

Activity: 378
Merit: 250


Born to chew bubble gum and kick ass


View Profile
February 11, 2014, 11:21:07 PM
 #43

Jan,

Can your programme also calculate / include the information about the value of double spends?

Date           | Number of double spends      | Value of double spends
2014-01-29  | 470                                  | e.g. 59099 BTC
itod
Legendary
*
Offline Offline

Activity: 1988
Merit: 1077


Honey badger just does not care


View Profile
February 11, 2014, 11:21:33 PM
 #44

It looks like it's already done, there are GetBalance(), GetUnconfirmedBalance() and GetImmatureBalance() methods in /src/wallet.cpp:

Code:
int64_t CWallet::GetBalance() const
{
    int64_t nTotal = 0;
    {
        LOCK(cs_wallet);
        for (map<uint256, CWalletTx>::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it)
        {
            const CWalletTx* pcoin = &(*it).second;
            if (pcoin->IsConfirmed())
                nTotal += pcoin->GetAvailableCredit();
        }
    }

    return nTotal;
}

int64_t CWallet::GetUnconfirmedBalance() const
{
    int64_t nTotal = 0;
    {
        LOCK(cs_wallet);
        for (map<uint256, CWalletTx>::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it)
        {
            const CWalletTx* pcoin = &(*it).second;
            if (!IsFinalTx(*pcoin) || !pcoin->IsConfirmed())
                nTotal += pcoin->GetAvailableCredit();
        }
    }
    return nTotal;
}

int64_t CWallet::GetImmatureBalance() const
{
    int64_t nTotal = 0;
    {
        LOCK(cs_wallet);
        for (map<uint256, CWalletTx>::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it)
        {
            const CWalletTx* pcoin = &(*it).second;
            nTotal += pcoin->GetImmatureCredit();
        }
    }
    return nTotal;
}

And there's a flag if unconfirmed outputs should be collected in spendable outputs:
Code:
// populate vCoins with vector of spendable COutputs
void CWallet::AvailableCoins(vector<COutput>& vCoins, bool fOnlyConfirmed, const CCoinControl *coinControl) const
{
    vCoins.clear();

    {
        LOCK(cs_wallet);
        for (map<uint256, CWalletTx>::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it)
        {
            const CWalletTx* pcoin = &(*it).second;

            if (!IsFinalTx(*pcoin))
                continue;

            if (fOnlyConfirmed && !pcoin->IsConfirmed())
                continue;

            if (pcoin->IsCoinBase() && pcoin->GetBlocksToMaturity() > 0)
                continue;

            for (unsigned int i = 0; i < pcoin->vout.size(); i++) {
                if (!(pcoin->IsSpent(i)) && IsMine(pcoin->vout[i]) &&
                    !IsLockedCoin((*it).first, i) && pcoin->vout[i].nValue > 0 &&
                    (!coinControl || !coinControl->HasSelected() || coinControl->IsSelected((*it).first, i)))
                        vCoins.push_back(COutput(pcoin, i, pcoin->GetDepthInMainChain()));
            }
        }
    }
}

So problem witch DeathAndTaxes talked about should not happen at all. If it does happen, there's easily correctable bug somewhere.
nibyokwy
Newbie
*
Offline Offline

Activity: 51
Merit: 0


View Profile
February 11, 2014, 11:35:53 PM
 #45

It really is not that much of a problem IMHO. If those change outputs will eventually confirm or not has nothing to do with mutated TxID. If someone wants to include unconfirmed change outputs as his new inputs that's his problem. .
it's not a matter of wanting to include unconfirmed change outputs, it's the fact that the satoshi client does this by default and you can't stop it without patching it. so user is vulnerable to getting their wallet messed up.
Barek
Full Member
***
Offline Offline

Activity: 168
Merit: 100


View Profile
February 11, 2014, 11:37:50 PM
 #46

This might be interesting.

https://github.com/bitcoin/bitcoin/pull/3651
itod
Legendary
*
Offline Offline

Activity: 1988
Merit: 1077


Honey badger just does not care


View Profile
February 11, 2014, 11:50:00 PM
 #47


Exactly what we talked above, lol. It really is the most obvious solution. There's already the pull request to make this the default option: https://github.com/bitcoin/bitcoin/pull/3654
Syke
Legendary
*
Offline Offline

Activity: 3878
Merit: 1193


View Profile
February 12, 2014, 12:06:51 AM
 #48

Malled transactions cannot steal coins.
You sure? It's pretty usual practice for Bitcoin merchants to update database upon transaction first seen in the network.

Whenever I want to receive bitcoins, I give the sender a unique address. I couldn't care less what the TXID is. I think most merchants work the same way. Malled transactions do not change the addresses.

Buy & Hold
btceic
Sr. Member
****
Offline Offline

Activity: 392
Merit: 250


♫ A wave came crashing like a fist to the jaw ♫


View Profile WWW
February 12, 2014, 12:07:46 AM
 #49


Exactly what we talked above, lol. It really is the most obvious solution. There's already the pull request to make this the default option: https://github.com/bitcoin/bitcoin/pull/3654

Any indication or chatter on when this patch will be available?

♫ This situation, which side are you on? Are you getting out? Are you dropping bombs? Have you heard of diplomatic resolve? ♫ How To Run A Cheap Full Bitcoin Node For $19 A Year ♫ If I knew where it was, I would take you there. There’s much more than this. ♫ Track Your Bitcoins Value
Sukrim
Legendary
*
Offline Offline

Activity: 2618
Merit: 1007


View Profile
February 12, 2014, 12:09:12 AM
 #50

I guess the issue is more often that people do send Bitcoins, then get a TXID from bitcoind after submitting the RPC call and store that TXID in case they need to check later if that transaction really went through.

https://www.coinlend.org <-- automated lending at various exchanges.
https://www.bitfinex.com <-- Trade BTC for other currencies and vice versa.
il--ya
Newbie
*
Offline Offline

Activity: 47
Merit: 0


View Profile
February 12, 2014, 12:19:13 AM
 #51

It really is not that much of a problem IMHO. If those change outputs will eventually confirm or not has nothing to do with mutated TxID. If someone wants to include unconfirmed change outputs as his new inputs that's his problem. .
it's not a matter of wanting to include unconfirmed change outputs, it's the fact that the satoshi client does this by default and you can't stop it without patching it. so user is vulnerable to getting their wallet messed up.

>it's not a matter of wanting to include unconfirmed change outputs, it's the fact that the satoshi client does this by default
is it a fact?
itod
Legendary
*
Offline Offline

Activity: 1988
Merit: 1077


Honey badger just does not care


View Profile
February 12, 2014, 12:29:58 AM
 #52

is it a fact?

It seems so, not only unconfirmed change outputs but any unconfirmed outputs. The developers are applying patches to make the opposite the default behavior as we speak, the patch is seven hours old.
DeathAndTaxes
Donator
Legendary
*
Offline Offline

Activity: 1218
Merit: 1079


Gerald Davis


View Profile
February 12, 2014, 12:31:32 AM
 #53

It really is not that much of a problem IMHO. If those change outputs will eventually confirm or not has nothing to do with mutated TxID. If someone wants to include unconfirmed change outputs as his new inputs that's his problem. .
it's not a matter of wanting to include unconfirmed change outputs, it's the fact that the satoshi client does this by default and you can't stop it without patching it. so user is vulnerable to getting their wallet messed up.

>it's not a matter of wanting to include unconfirmed change outputs, it's the fact that the satoshi client does this by default
is it a fact?

Yes.  The QT client (and all other clients AFAIK) does NOT allow spending unconfirmed outputs received from outside the wallet.  Change is treated differently and unconfirmed change is allowed to be spent.  Under normal conditions this is actually a beneficial thing (otherwise you can end up not being able to spend coins until change outputs confirm) but right now that action is undesirable.
DeathAndTaxes
Donator
Legendary
*
Offline Offline

Activity: 1218
Merit: 1079


Gerald Davis


View Profile
February 12, 2014, 12:33:05 AM
Last edit: February 12, 2014, 12:45:54 AM by DeathAndTaxes
 #54

is it a fact?

It seems so, not only unconfirmed change outputs but any unconfirmed outputs. The developers are applying patches to make the opposite the default behavior as we speak, the patch is seven hours old.

The reference client will not allow spending unconfirmed outputs received from outside the wallet.

If I send you 1 BTC right now, the client will indicate you do not have sufficient funds to make a tx if you try to spend it before it confirms.  Change outputs are handled differently though and could break transactions which use them before they are confirmed.
itod
Legendary
*
Offline Offline

Activity: 1988
Merit: 1077


Honey badger just does not care


View Profile
February 12, 2014, 12:35:38 AM
 #55

The reference client will not allow spending unconfirmed outputs received from outside the wallet.

Ah, yes, that's correct, sorry.
Anotheranonlol
Hero Member
*****
Offline Offline

Activity: 588
Merit: 504


View Profile
February 12, 2014, 12:40:34 AM
 #56

I am running a custom node that does real-time double spend analysis. I took a look at the log file over the last few days to see what was going on now that we have a lot of focus on malleable transactions.

Note that my custom node counts mutations on the same transaction as a double spend, which it isn't.

Detected double spends by date:

2014-01-29 470
2014-01-30 460
2014-01-31 460
2014-01-29 470
2014-01-30 460
2014-01-31 0
2014-02-01 39
2014-02-02 18
2014-02-03 97
2014-02-04 918
2014-02-05 461
2014-02-06 406
2014-02-07 769
2014-02-08 1260
2014-02-09 2618
2014-02-10 14576



Byzantine Candor CNY tea-break

waxwing
Sr. Member
****
Offline Offline

Activity: 469
Merit: 253


View Profile
February 12, 2014, 12:54:07 AM
 #57


Byzantine Candor CNY tea-break

Cheesy good call. The other "features" of this dataset are pretty interesting too, eh? The weird constancy around 460 and the massive ramp up just after the first Gox announcement.

PGP fingerprint 2B6FC204D9BF332D062B 461A141001A1AF77F20B (use email to contact)
Jan (OP)
Legendary
*
Offline Offline

Activity: 1043
Merit: 1002



View Profile
February 12, 2014, 01:00:12 AM
 #58

The number of "double spends" (most of which I believe is mutated transactions) for the last 24 hours:
2014-02-11 16960
(will edit OP to reflect this)

It is slightly lower than I anticipated, as it was already above 16k 9 hours before the CET day ended (24 hours). Maybe the attack subsided, or someone is having a break.

Mycelium let's you hold your private keys private.
waxwing
Sr. Member
****
Offline Offline

Activity: 469
Merit: 253


View Profile
February 12, 2014, 01:03:04 AM
 #59

The number of "double spends" (most of which I believe is mutated transactions) for the last 24 hours:
2014-02-11 16960
(will edit OP to reflect this)

It is slightly lower than I anticipated, as it was already above 16k 9 hours before the CET day ended (24 hours). Maybe the attack subsided, or someone is having a break.


Or maybe they went to bed around midnight? It's currently 9am in China...

PGP fingerprint 2B6FC204D9BF332D062B 461A141001A1AF77F20B (use email to contact)
il--ya
Newbie
*
Offline Offline

Activity: 47
Merit: 0


View Profile
February 12, 2014, 01:16:22 AM
 #60

The number of "double spends" (most of which I believe is mutated transactions) for the last 24 hours:
2014-02-11 16960
(will edit OP to reflect this)

It is slightly lower than I anticipated, as it was already above 16k 9 hours before the CET day ended (24 hours). Maybe the attack subsided, or someone is having a break.


LOL, isn't it MtGox with their custom client trying to re-submit failed transactions relentlessly?

Can you please post a couple of transactions to check what exactly was mutated? Many trivial mutations are already rejected by most nodes. Just want to see what's going on.
Pages: « 1 2 [3] 4 5 6 7 »  All
  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!