Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: mizerydearia on September 05, 2010, 06:56:45 AM



Title: [PATCH REQUEST] Sending To Yourself - Cancelled
Post by: mizerydearia on September 05, 2010, 06:56:45 AM
I would like to request for a patch to be developed that treats sending bitcoins to an address that matches one on the same computer like sending to  any other address.

http://bitcointalk.org/index.php?topic=241.msg9333#msg9333

Don't send coins from one address to a different one on the same computer. This actually reduces your anonymity because it combines several different coins (some of which, such as generations, might be pretty anonymous). It's also obvious what you're doing because Bitcoin makes a special transaction when you send coins to yourself: it includes the full public key for the destination instead of the hashed public key used in normal transactions.


Title: Re: [PATCH REQUEST] Sending To Yourself (5BTC reward)
Post by: theymos on September 05, 2010, 08:33:31 AM
I was wrong about this. Even though transactions to yourself are displayed differently, it appears like a normal transaction in the block.

Code:
            "out" : [
                {
                    "value" : "0.24000000",
                    "scriptPubKey" : "OP_DUP OP_HASH160 0x4434DD10F5392C1F080B83
92D3135D0D13670400 OP_EQUALVERIFY OP_CHECKSIG"
                },
                {
                    "value" : "51.13000000",
                    "scriptPubKey" : "OP_DUP OP_HASH160 0x98352ACB25A13F646AB75D
825B1B8911341BAE14 OP_EQUALVERIFY OP_CHECKSIG"
                }
            ]

http://img837.imageshack.us/img837/1940/paytoself.png

To determine that the payment is from yourself, Bitcoin just checks to see if all of the receiving addresses and all of sending addresses are in your wallet.

Code:
if (fAllFromMe && fAllToMe)
        {
            // Payment to self
            int64 nValue = wtx.vout[0].nValue;
            InsertLine(fNew, nIndex, hash, strSort,
                       strStatus,
                       nTime ? DateTimeStr(nTime) : "",
                       _("Payment to yourself"),
                       "",
                       "");
            /// issue: can't tell which is the payment and which is the change anymore
            //           FormatMoney(nNet - nValue, true),
            //           FormatMoney(nValue, true));
        }