Received: from sog-mx-2.v43.ch3.sourceforge.com ([172.29.43.192] helo=mx.sourceforge.net) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1UsBbs-0003on-7i for bitcoin-development@lists.sourceforge.net; Thu, 27 Jun 2013 12:47:36 +0000 Received-SPF: pass (sog-mx-2.v43.ch3.sourceforge.com: domain of bluematt.me designates 173.246.101.161 as permitted sender) client-ip=173.246.101.161; envelope-from=bitcoin-list@bluematt.me; helo=mail.bluematt.me; Received: from vps.bluematt.me ([173.246.101.161] helo=mail.bluematt.me) by sog-mx-2.v43.ch3.sourceforge.com with esmtp (Exim 4.76) id 1UsBbn-0002yK-SD for bitcoin-development@lists.sourceforge.net; Thu, 27 Jun 2013 12:47:36 +0000 Received: from [192.168.153.125] (unknown [74.125.61.18]) by mail.bluematt.me (Postfix) with ESMTPSA id AF43B639C; Thu, 27 Jun 2013 12:29:32 +0000 (UTC) User-Agent: K-9 Mail for Android MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 From: bitcoin-list@bluematt.me Date: Thu, 27 Jun 2013 14:29:30 +0200 To: bitcoinj@googlegroups.com,bitcoin-development@lists.sourceforge.net Message-ID: <44f8fd60-be4a-436d-a132-422b939d6de1@email.android.com> Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.8 (--) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain -0.0 SPF_PASS SPF: sender matches SPF record -1.3 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain X-Headers-End: 1UsBbn-0002yK-SD Subject: [Bitcoin-development] [ANN] Micropayment Channel Implementation X-BeenThere: bitcoin-development@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jun 2013 12:47:36 -0000 As of today, a full implementation of micropayment channels has been merg= ed onto bitcoinj's master branch (to be released in the next version). It is= =0Ddesigned to make it easy for users to create payment channel servers a= nd=0Dclients based on the design at=0Dhttps://en.bitcoin.it/wiki/Contract= s#Example_7:_Rapidly-adjusted_.28micro.29payments_to_a_pre-determined_par= ty,=0Dby creating a simple TCP socket and exchanging protobufs to initial= ize and=0Dmake payments. It supports various levels of abstractions, allowing users to drive the=0D= state machines which do basic channel init/verification themselves, allow= =0Dbitcoinj to handle all the complexity of channel management/expiry/etc= and=0Dsimply exchange protobufs over whatever whatever connection they w= ish to=0Dmake with the server, or let bitcoinj handle opening a TCP socke= t and do=0Dall the work. See=0Dhttps://code.google.com/p/bitcoinj/wiki/Wo= rkingWithMicropayments for=0Ddetails on how to use the implementation in = bitcoinj. A more full protocol description will be written up in the form of a BIP = as=0Dthe code matures a bit more (with the hope that other implementation= s can=0Dappear), but, generally: 1. Client and server exchange version handshake, and client may=0Doptiona= lly request that an existing channel be reopened (the channels last=0Dfor= 24 hours by default, so if the connection gets killed, reopening an=0Dex= isting channel is useful). 2. The protocol described on the wiki is followed, exchanging=0D(canonica= l!) signatures and transactions until a multisignature contract is=0Desta= blished and broadcast which locks money into the channel, and a refund=0D= transaction is created and signed which allows the client to spend the=0D= entire multisignature transaction to wherever they want=0D(SIGHASH_NONE|S= IGHASH_ANYONECANPAY) after some lock time (by default, 24=0Dhours). Both = client and server store a copy of the channel in their wallet=0Dso that i= f the app itself crashes the refund transaction can still be=0Dbroadcast/= the channel can still be resumed. At this point either the whole wallet s= hould be backed up or the total value in payment channels at any=0Dgiven = time should be kept reasonably low (because payment channels are=0Ddesign= ed to combine micropayments into confirmable payments, this shouldn't be = an issue) 3. The client increments payments by sending the server new signatures=0D= spending the multisig contract partially back to themselves and allowing=0D= the server to do what they want with the rest=0D(SIGHASH_SINGLE|SIGHASH_A= NYONECANPAY). 4. When the client sends a CLOSE message or the channel approaches the=0D= refund transaction unlock time, the server adds any necessary fees to the= =0Dlatest payment transaction and broadcasts it, closing the channel, dis= connecting the client if the connection is still open and removing the st= ored channel state from its wallet. See https://code.google.com/p/bitcoinj/source/browse/core/src/paymentchan= nel.proto for the protobuf/protocol description.