Received: from sog-mx-4.v43.ch3.sourceforge.com ([172.29.43.194] helo=mx.sourceforge.net) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1RIGID-0005xz-1C for bitcoin-development@lists.sourceforge.net; Mon, 24 Oct 2011 08:54:01 +0000 X-ACL-Warn: Received: from vm119.rz.uni-osnabrueck.de ([131.173.17.200] helo=mail-in-7.serv.Uni-Osnabrueck.DE) by sog-mx-4.v43.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) id 1RIGIB-0005Z2-47 for bitcoin-development@lists.sourceforge.net; Mon, 24 Oct 2011 08:54:01 +0000 Received: from vm179.rz.Uni-Osnabrueck.DE (vm179.rz.uni-osnabrueck.de [131.173.16.37]) by mail-in-7.serv.Uni-Osnabrueck.DE (8.13.8/8.13.8) with ESMTP id p9O8Tvpx025591 for ; Mon, 24 Oct 2011 10:29:57 +0200 Received: by vm179.rz.Uni-Osnabrueck.DE (Postfix, from userid 48) id 755985B3; Mon, 24 Oct 2011 10:29:57 +0200 (CEST) Received: from 134.106.52.172 (SquirrelMail authenticated user jan) by webmail.uni-osnabrueck.de with HTTP; Mon, 24 Oct 2011 10:29:57 +0200 (CEST) Message-ID: <44861.134.106.52.172.1319444997.squirrel@webmail.uni-osnabrueck.de> Date: Mon, 24 Oct 2011 10:29:57 +0200 (CEST) From: "Jan Vornberger" To: "Bitcoin Dev" User-Agent: SquirrelMail/1.4.8-5.el5_4.10 MIME-Version: 1.0 Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-PMX-Version: 5.5.9.395186, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2011.10.24.82114 (Univ. Osnabrueck) X-PMX-Spam: Gauge=XI, Probability=11%, Report= PRIORITY_NO_NAME 0.716, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_1200_1299 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, WEBMAIL_SOURCE 0, WEBMAIL_USER_AGENT 0, __ANY_URI 0, __CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __HAS_MSGID 0, __HAS_X_PRIORITY 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __PHISH_SPEAR_HTTP_RECEIVED 0, __PHISH_SPEAR_STRUCTURE_1 0, __PHISH_SPEAR_STRUCTURE_2 0, __SANE_MSGID 0, __TO_MALFORMED_2 0, __URI_NO_MAILTO 0, __URI_NO_PATH 0, __URI_NO_WWW 0, __URI_NS , __USER_AGENT 0 X-PMX-Spam-Level: XI X-Spam-Score: 0.0 (/) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. X-Headers-End: 1RIGIB-0005Z2-47 Subject: [Bitcoin-development] Determine input addresses of a transaction 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: Mon, 24 Oct 2011 08:54:01 -0000 Hi there! As part of my green address endeavor, I'm currently trying to extend the 'gettransaction' call to include an extra field "inputaddresses" which should return a list of the Bitcoin addresses associated with the inputs of the transaction. I understand that this is not generally possible, because of the different possible structures enabled through the scripting language. But it would be fine, if this only worked for 'regular' transactions. So my first shot at this is to go through the inputs of a transaction and see if the scriptSig field has only two opcodes. If that is the case, I assume that it is of the structure and calculate the Bitcoin address from . The patch for this is here: https://github.com/javgh/bitcoin/compare/vps_wheezy...showinputaddresses But then I started to wonder if this is safe. Can this be tricked somehow? Would it be possible to create a valid transaction which has an input that has only two opcodes but with an arbitrary pubKey at the second position? Could someone who has a better grasp on the scripting capabilities comment on this? Or alternatively: should I determine the input addresses of a transaction in a different way? if so, how? Regards! Jan