Bitcoin Forum
April 17, 2014, 01:09:47 PM *
News: ♦♦ A bug in OpenSSL, used by Bitcoin-Qt/Bitcoin Core, could allow your bitcoins to be stolen. Immediately updating Bitcoin Core to 0.9.1 is required in some cases, especially if you're using 0.9.0. Download. More info.
The same bug also affected the forum. Changing your forum password is recommended.
 
   Home   Help Search Donate Login Register  
Pages: [1] 2 3 4 5 6 7 8 9  All
  Print  
Author Topic: Yet another Coin Control Release [CLOSED]  (Read 21169 times)
cozz
Member
**
Offline Offline

Activity: 60


View Profile

Ignore
February 15, 2013, 01:38:36 PM
 #1

Here's some good news for all coin control fans:

I was going to merge the old coin control code, making a few changes to the crappy GUI form, but ended up in a complete rewrite of coin control:)
I have been testing this for a week now, works great for me, so I guess, I can throw this out to the public now.

What is coin control?
When you send bitcoins to someone else, the bitcoin client chooses kinda randomly which of your addresses will send the coins. With coin control you can exactly choose, which of your addresses will be the sending addresses. And even more specific which of your unspent outputs will be the sending inputs.
  
What is an unspent output?
Lets say your bitcoin address is 111. Now someone sends 1 BTC to this address. Now address 111 has one unspent output. Now someone else sends 2 BTC to this address. Now address 111 has two unspent outputs and a balance of 3 BTC in total. Now lets say you want to send someone 0.1 BTC. One could say "ok, simply subtract 0.1 BTC from the first unspent output and send it". But this is not possible, because the bitcoin protocol works different. You always have to spent the whole output. This means in this case the bitcoin client would take the first unspent output, send 0.1 BTC to the other person and 0.9 BTC back to yourself. For this the client creates a new change address in the background and adds this address to your wallet. This address would then have one unspent output of 0.9 BTC. This means every wallet has kinda "hidden" change addresses. For example if you now would loose your wallet, but still know the private key of 111, you would be only able to get the 2 BTC back. The 0.9 BTC from the change address are gone, because you would have to know the private key of the change address.
  
Why coin control?
The first version of coin control was called "Patching The Bitcoin Client To Make It More Anonymous". Sometimes when you receive bitcoins, the sender or even the public knows that it is you who owns the bitcoin address. Now if you later want to make a real anonymous payment, you shouldnt use those coins. Also you get full control over your unspent outputs and can do things like choosing which address actually owns the coins, clean them up or send all change back to the origin address etc. You can also prevent the bitcoin client from creating a change address by exactly sending the amount of selected unspent outputs minus the fee. Also you get a better impression of whats going on in your wallet and get a better understanding of the bitcoin protocol.

Changes to the GUI

Screenshots
screenshot1.png
screenshot2.png
screenshot3.png
screenshot4.png
screenshot5.png

Main
  • Settings checkbox "Display coin control features (experts only!)" (default=no)

Tab Send coins
  • Button Inputs
    • click on this button opens actual coin control dialog. If no Inputs are selected "automatically selected" is shown.
  • Change Checkbox
    • checked -> provide custom change address

Coin Control Dialog
  • Shows a list of all unspent outputs with two view modes
    • tree mode: outputs including change are grouped by wallet address
      tree can be opened showing the actual outputs for this wallet address including change
      if change, the change bitcoin address is shown in column "address", otherwise the column "address" is empty, because its a direct output of the wallet address having the bitcoin address already shown in the parent node (same with label)
    • list mode: simple list of all unspent outputs
  • select outputs by checkbox -> only the checked outputs are used when sending a transaction
    if none are selected -> coin control inactive (just as normal)
  • check/uncheck all by clicking on "(Un)select all"
  • sort colums
  • tooltip available in column list mode in column label for the change (shows from which address the change came from)
  • Context menu
    Copy to clipboard (amount,label,address,transaction id,lock,unlock)
  • Labels at the top
    Quantity: number of selected outputs
    Amount: sum of selected unspent outputs
    Fee:   see "Calculation of fee and transaction size" below
    minus fee: simply the amount shown is "Selected" minus the amount shown in "Fee"
    Bytes: see "Calculation of fee and transaction size" below
    Priority: priority = coinage / transactionsize. coinage = value * confirmations.  miners order transactions by priority when selecting which go into a block
    Low Output: "yes" if any recipient receives an amount < 0.01BTC
    Change: shows the change you get back
  • direct right click the labels for copy amount to clipboard
   


Selection
In this version of coin control, all selected outputs are going into the transaction for sure!!
Of course, if you select more than you actually send, the bitcoin core will send the rest back to you as change, just as normal.
And of course, if you select less than you send you will get "The amount exceeds your balance".
And as already mentioned, if none are selected, coin control is inactive, this means everything is just the same as without coin control.
  
Fee
If the sum of selected outputs minus the amount you are going to send is smaller than the required fee, you will probably get
"The total exceeds your balance when the transaction fee is included"
This is because you didnt select enough outputs to pay the fee.
You always must select enough outputs, so that those outputs can pay the fee.
  
Calculation of fee and transaction size
The fee is calculated according to the fee set in the Settings menu.
The calculation assumes 2 outputs in total. One for the destination address and one for the change.
The formula is nBytesOutputs + (2 * 34) + 10. nBytesOutputs is the sum of selected outputs, 148 or 180 bytes per output, depending if compressed public key.
Due to the inner workings of bitcoin the size per output is actually +/- 1 byte. Meaning the shown calculation is not always 100% correct.
If you send exactly "selected minus fee" then you will not have change (1 output only). The transaction will then be 34 bytes smaller as what was calculated before.

Free Transactions
In order to be able to send a free transaction, you need to follow the rules:
     - transaction size must be < 10000 bytes
     - priority must be at least "medium"
     - any recipient must receive at least 0.01BTC
     - change must be either zero or at least 0.01BTC
  If you violate one rule you will see a min-fee and also the labels turn red:
  Bytes.Priority,Low Output,Change. Depending which rule you violated.
  Those 4 labels also have tool tips explaining this.
  Also remember that violating one of the first 2 rules means 0.0005 PER kilobyte min-fee,
  while violating one of the last 2 means 0.0005 min-fee only.

Links
Source code
Pull Request
Binaries including this patch available here
Bitcoin OMG


1cozzwyCJvDiyBA8zXGJ1qxtrd5b4i1nB
1397740187
Hero Member
*
Offline Offline

Posts: 1397740187

View Profile Personal Message (Offline)

Ignore
1397740187
Reply with quote  #2

1397740187
Report to moderator
1397740187
Hero Member
*
Offline Offline

Posts: 1397740187

View Profile Personal Message (Offline)

Ignore
1397740187
Reply with quote  #2

1397740187
Report to moderator
1397740187
Hero Member
*
Offline Offline

Posts: 1397740187

View Profile Personal Message (Offline)

Ignore
1397740187
Reply with quote  #2

1397740187
Report to moderator
ASIC Scrypt Miners Ship FREE Same-Day - Guaranteed Satisfaction!
Just Enter Code freeshipping at GAWMiners.com
Mining Made Easy
For Everyone

Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1397740187
Hero Member
*
Offline Offline

Posts: 1397740187

View Profile Personal Message (Offline)

Ignore
1397740187
Reply with quote  #2

1397740187
Report to moderator
1397740187
Hero Member
*
Offline Offline

Posts: 1397740187

View Profile Personal Message (Offline)

Ignore
1397740187
Reply with quote  #2

1397740187
Report to moderator
1397740187
Hero Member
*
Offline Offline

Posts: 1397740187

View Profile Personal Message (Offline)

Ignore
1397740187
Reply with quote  #2

1397740187
Report to moderator
1397740187
Hero Member
*
Offline Offline

Posts: 1397740187

View Profile Personal Message (Offline)

Ignore
1397740187
Reply with quote  #2

1397740187
Report to moderator
debianlinux
Full Member
***
Offline Offline

Activity: 221


View Profile

Ignore
February 15, 2013, 01:44:10 PM
 #2

For example if you now would loose your wallet, but still know the private key of 111, you would be only able to get the 2 BTC back. The 0.9 BTC from the change address are gone, because you would have to know the private key of the change address.

Can this be verified? My understanding was that each address within a given wallet was simply another hash function of the same private key. That is, there is only a single private key for all of the addresses in a given wallet. If the quoted portion is correct then there is a private key for each address and I have a lot of remedial work to do.
DannyHamilton
Hero Member
*****
Offline Offline

Activity: 686



View Profile

Ignore
February 15, 2013, 02:22:04 PM
 #3

My understanding was that each address within a given wallet was simply another hash function of the same private key. That is, there is only a single private key for all of the addresses in a given wallet. If the quoted portion is correct then there is a private key for each address and I have a lot of remedial work to do.

If the wallet used deterministic key generation (such as Electrum) then all the private keys could be derived from the single seed used for the deterministic algorithm. As of 0.7.2 Bitcoin-Qt uses a random key generation.  So the description in the OP is correct.  I'm not sure if this is changed in 0.8.0 (I haven't looked at that release yet).  I know there is work being done towards making Bitcoin-Qt deterministic, so the spirit of your statement may be true eventually in the future (even if the specifics aren't quite right).

I'm not sure that this means that you "have a lot of remedial work to do", but it certainly means that given the current 0.7.2 version of Bitcoin-Qt it is important to create backups on a regular basis. It also means that storing private keys from Bitcoin-Qt is only useful if you are not spending the bitcoin associated with those keys at all.

GPG ID: 20CA5E05, OTC ID: DannyHamilton
Escrow service available (send PM) - tips appreciated
My escrow addresses will always be GPG signed. Verify signature!
debianlinux
Full Member
***
Offline Offline

Activity: 221


View Profile

Ignore
February 15, 2013, 02:32:57 PM
 #4

It also means that storing private keys from Bitcoin-Qt is only useful if you are not spending the bitcoin associated with those keys at all.

This.
While I have electronic backups I also have paper backups and the paper backups consist of a single private key which is, apparently, insufficient.
jgarzik
Staff
Hero Member
*****
qt
Offline Offline

Activity: 1260


View Profile

Ignore
February 15, 2013, 02:38:26 PM
 #5

Version 0.7.2 and later include the raw transaction API (JSON-RPC), which permits full coin control.

The upcoming release 0.8 includes contrib/spendfrom/ utility, which illustrates how easily an external utility may provide coin control capability.  No GUI patching required.


Jeff Garzik, bitcoin core dev team and BitPay engineer; opinions are my own, not my employer.
Donations / tip jar: 1BrufViLKnSWtuWGkryPsKsxonV2NQ7Tcj
DannyHamilton
Hero Member
*****
Offline Offline

Activity: 686



View Profile

Ignore
February 15, 2013, 02:42:16 PM
 #6

. . . I also have paper backups and the paper backups consist of a single private key which is, apparently, insufficient.
Assuming that you are using Bitcoin-Qt, and unless you are using a special "coin control" release that allows you to specify where the change goes, you are correct.  A paper backup with a single private key is insufficient.  Fortunately you've discovered this before it was a problem.

I'm don't know how old your electronic backups are, nor do I know how many transactions you create per month, but if the sum of all the bitcoin addresses you've created in "Receive Coins" and the total number of transactions you've created since your last electronic backup is more than 100, and you haven't modified your configuration to increase the size of the address pool, then you don't have a recent enough electronic backup either.

GPG ID: 20CA5E05, OTC ID: DannyHamilton
Escrow service available (send PM) - tips appreciated
My escrow addresses will always be GPG signed. Verify signature!
Wolf0
Sr. Member
****
Offline Offline

Activity: 448


View Profile

Ignore
February 20, 2013, 02:23:32 AM
 #7

Why isn't coin control in the main client? It seems like an EXTREMELY useful feature.

BTC.sx - For an easy way to trade Bitcoin, using Bitcoin.
Buy cheap GPUs with GPU Coin
Win a video card! - Drawing/Contest
jgarzik
Staff
Hero Member
*****
qt
Offline Offline

Activity: 1260


View Profile

Ignore
February 20, 2013, 03:41:20 AM
 #8

Why isn't coin control in the main client? It seems like an EXTREMELY useful feature.

See the 'spendfrom' script in contrib/ of version 0.8.0.


Jeff Garzik, bitcoin core dev team and BitPay engineer; opinions are my own, not my employer.
Donations / tip jar: 1BrufViLKnSWtuWGkryPsKsxonV2NQ7Tcj
gmaxwell
Moderator
Hero Member
*
qt
Offline Offline

Activity: 1078


View Profile

Ignore
February 20, 2013, 04:09:46 AM
 #9

Why isn't coin control in the main client? It seems like an EXTREMELY useful feature.
Because basically no one was interested in doing even the most basic maintenance on the GUI and the code that was submitted wasn't really mergable without work. We added the bare minimum for a sufficiently technical user to do it on their own (or for someone to roll an external GUI for it).

The screenshots look pretty interesting! This seems like a MAJOR improvement over the old stuff.  I'm more inclined to merge something like this than Jeff is sounding, assuming that the author is willing to endure the requisite hoop jumping and shed painting... not just because it's useful, but because its a feature that can help increase technical understanding of the Bitcoin system.
Wolf0
Sr. Member
****
Offline Offline

Activity: 448


View Profile

Ignore
February 20, 2013, 09:55:55 PM
 #10

Why isn't coin control in the main client? It seems like an EXTREMELY useful feature.
Because basically no one was interested in doing even the most basic maintenance on the GUI and the code that was submitted wasn't really mergable without work. We added the bare minimum for a sufficiently technical user to do it on their own (or for someone to roll an external GUI for it).

I would help add it to the GUI, if there's no one else willing. But if I'm reading correctly, this patch does it already, so never mind.

BTC.sx - For an easy way to trade Bitcoin, using Bitcoin.
Buy cheap GPUs with GPU Coin
Win a video card! - Drawing/Contest
jgarzik
Staff
Hero Member
*****
qt
Offline Offline

Activity: 1260


View Profile

Ignore
February 20, 2013, 11:44:22 PM
 #11

Ideal for those who want a UI is simply to write an add-on utility or plugin that uses the RPC API.

Jeff Garzik, bitcoin core dev team and BitPay engineer; opinions are my own, not my employer.
Donations / tip jar: 1BrufViLKnSWtuWGkryPsKsxonV2NQ7Tcj
Luke-Jr
Hero Member
*****
expert
Online Online

Activity: 1204



View Profile

Ignore
February 21, 2013, 08:10:07 AM
 #12

Please open a pullreq for this after rebasing to 0.8. Smiley

wiggi
Full Member
***
Offline Offline

Activity: 153


View Profile

Ignore
February 21, 2013, 06:52:28 PM
 #13

It feels like individual coins in the wallet now, each with it's own history
instead of just a number.

Bonus points for improved privacy, improved control over fees, and being
educational for noobs about how bitcoin works.

Please include it in 0.8.1 *exactly like this* Smiley
Luke-Jr
Hero Member
*****
expert
Online Online

Activity: 1204



View Profile

Ignore
February 21, 2013, 06:53:25 PM
 #14

Please include it in 0.8.1 *exactly like this* Smiley
IMO, this is definitely a 0.9 feature at the earliest. Way too big a change for 0.8.x Smiley

Wolf0
Sr. Member
****
Offline Offline

Activity: 448


View Profile

Ignore
February 22, 2013, 02:11:38 AM
 #15

Please include it in 0.8.1 *exactly like this* Smiley
IMO, this is definitely a 0.9 feature at the earliest. Way too big a change for 0.8.x Smiley

Only if 0.9 comes out really fast! :3

BTC.sx - For an easy way to trade Bitcoin, using Bitcoin.
Buy cheap GPUs with GPU Coin
Win a video card! - Drawing/Contest
cozz
Member
**
Offline Offline

Activity: 60


View Profile

Ignore
March 04, 2013, 08:31:23 PM
 #16

update v0.8.0

Changes:
- GUI: removed tab coin control, it is now integrated in send coins dialog as popup
- REMOVAL: removed trace back feature completely, because it is no more possible with pruned txindex
- FEATURE: control of change address (auto,back to input,custom)
- rebased to current master, using the new lockCoin methods
- updated screenshots
- submitted pull request

1cozzwyCJvDiyBA8zXGJ1qxtrd5b4i1nB
ShadowOfHarbringer
Hero Member
*****
Offline Offline

Activity: 1232


Bringing Har® to you since 1952


View Profile

Ignore
March 05, 2013, 08:38:42 AM
 #17

@cozz:

This is soooo awesome.

I want to express my gratitude for your hard work on this. Is your donation address valid ?

creativex
Sr. Member
****
Offline Offline

Activity: 406



View Profile

Ignore
March 05, 2013, 08:57:20 AM
 #18

@cozz:

This is soooo awesome.

I want to express my gratitude for your hard work on this. Is your donation address valid ?

+1

Nice work!

https://bitcointalk.org/index.php?topic=130982.msg1401799#msg1401799 - [BTC-TC]bASIC-MINING
http://forum.litecoin.net/index.php/topic,886.0.html - [LTC-GLOBAL]LTC-DMF
http://forum.litecoin.net/index.php/topic,817.msg3279.html#msg3279 - [CRYPTOSTOCKS]AGLTC

BTC: 1Hfp99tugY4H5FYEoM3hj4JDLzShzZ9ifB

You have zero chance of changing others and only a slim chance at changing yourself. Be the change you want to see and others may follow.
rebroad
Newbie
*
Offline Offline

Activity: 19



View Profile

Ignore
March 05, 2013, 01:20:24 PM
 #19

Fantastic! Thank you! I shall be using this now in preference to the standard bitcoin-qt project. Do you have a reference to where the source is on github please? Also, I'd quite like to compile this myself on Windows - so if you'd be willing to include info on how you compiled the windows binary, this would be fantastic.

Thank you again!
jgarzik
Staff
Hero Member
*****
qt
Offline Offline

Activity: 1260


View Profile

Ignore
March 05, 2013, 03:43:19 PM
 #20

Anyone know PyQt?  That could provide the same functions, without patching bitcoind / Bitcoin-Qt, for coin control via python-bitcoinrpc.




Jeff Garzik, bitcoin core dev team and BitPay engineer; opinions are my own, not my employer.
Donations / tip jar: 1BrufViLKnSWtuWGkryPsKsxonV2NQ7Tcj
Pages: [1] 2 3 4 5 6 7 8 9  All
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!