novitski / bitcoinj

Automatically exported from code.google.com/p/bitcoinj
Apache License 2.0
0 stars 0 forks source link

Add support for anyonecanpay #386

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Changes at: 
http://code.google.com/r/simonvermeersch-anyonecanpay/source/detail?r=d10ee03c29
7a5d79e6fbd395c68522abb01d154e

This adds support for the anyonecanpay feature of signing transactions, which 
is needed to enable assurance contracts.

The way this works is by setting a MaxInputValue of a Wallet.SendRequest: when 
set, wallet.completeTx will add enough inputs to get exactly this value and 
ignores the outputs.

Please note that when the wallet doesn't have exact outputs (in other words: if 
this was a normal transaction, there would be a change address created) then 
completeTx will fail. Ideally there would be two transactions: one to our own 
wallet, creating an output of the correct size and another to the actual 
transaction.

Most of those changes have been described by Mike Hearn in the following 
thread: https://bitcointalk.org/index.php?topic=110402.0

Original issue reported on code.google.com by SimonVer...@gmail.com on 12 Apr 2013 at 7:43

GoogleCodeExporter commented 9 years ago
This won't make it for 0.10, sorry, but I want to merge something based on this 
very soon after release. I didn't forget about it.

Original comment by hearn@google.com on 11 Jul 2013 at 2:37

GoogleCodeExporter commented 9 years ago
I decided that this sort of thing is best done by crafting transactions 
directly rather than expanding the already enormous wallet API. It's only a few 
lines of code to do it directly and in practice, an assurance contract system 
would be embedded inside some other higher level protocol. So I'm going to 
close this. ANYONECANPAY is supported at the right levels for doing contracts 
outside of the wallet and we gained some experience with using it that way this 
summer.

Original comment by hearn@google.com on 13 Nov 2013 at 5:34