From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from sog-mx-3.v43.ch3.sourceforge.com ([172.29.43.193] helo=mx.sourceforge.net) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1RkFgC-0003QH-Mx for bitcoin-development@lists.sourceforge.net; Mon, 09 Jan 2012 13:54:28 +0000 Received-SPF: pass (sog-mx-3.v43.ch3.sourceforge.com: domain of gmail.com designates 74.125.82.53 as permitted sender) client-ip=74.125.82.53; envelope-from=pieter.wuille@gmail.com; helo=mail-ww0-f53.google.com; Received: from mail-ww0-f53.google.com ([74.125.82.53]) by sog-mx-3.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1RkFgC-0006zY-26 for bitcoin-development@lists.sourceforge.net; Mon, 09 Jan 2012 13:54:28 +0000 Received: by wgbdt10 with SMTP id dt10so1543985wgb.10 for ; Mon, 09 Jan 2012 05:54:21 -0800 (PST) MIME-Version: 1.0 Received: by 10.180.94.97 with SMTP id db1mr27765044wib.16.1326117261896; Mon, 09 Jan 2012 05:54:21 -0800 (PST) Received: by 10.223.3.11 with HTTP; Mon, 9 Jan 2012 05:53:51 -0800 (PST) Date: Mon, 9 Jan 2012 14:53:51 +0100 Message-ID: From: Pieter Wuille To: Bitcoin Dev Content-Type: text/plain; charset=ISO-8859-1 X-Spam-Score: -1.6 (-) 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 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (pieter.wuille[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-Headers-End: 1RkFgC-0006zY-26 Subject: [Bitcoin-development] Compressed public keys: import/export and test cases 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, 09 Jan 2012 13:54:28 -0000 Hello all, pull #649 now also defines an import/export format for private keys whose public key is compressed. Rationale: even though a compressed and uncompressed public key share the same actual 32-byte secret, the import/export format needs a marker that states whether the corresponding compressed or uncompressed public key should be used (since they have different addresses). Format: * uncompressed: 0x80 + [32-byte secret] + [4 bytes of Hash() of previous 33 bytes], base58 encoded * compressed: 0x80 + [32-byte secret] + 0x01 + [4 bytes of Hash() previous 34 bytes], base58 encoded Any comments or suggestions regarding this format? Below I've included 3 cases to test implementations with. Test cases: case 1: * secret (hex): 1111111111111111111111111111111111111111111111111111111111111111 * uncompressed: * secret (base58): 5HwoXVkHoRM8sL2KmNRS217n1g8mPPBomrY7yehCuXC1115WWsh * pubkey (hex): 044f355bdcb7cc0af728ef3cceb9615d90684bb5b2ca5f859ab0f0b704075871aa385b6b1b8ead809ca67454d9683fcf2ba03456d6fe2c4abe2b07f0fbdbb2f1c1 * address (base58): 1MsHWS1BnwMc3tLE8G35UXsS58fKipzB7a * compressed: * secret (base58): KwntMbt59tTsj8xqpqYqRRWufyjGunvhSyeMo3NTYpFYzZbXJ5Hp * pubkey (hex): 034f355bdcb7cc0af728ef3cceb9615d90684bb5b2ca5f859ab0f0b704075871aa * address (base58): 1Q1pE5vPGEEMqRcVRMbtBK842Y6Pzo6nK9 case 2: * secret (hex): dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd * uncompressed: * secret (base58): 5KVzsHJiUxgvBBgtVS7qBTbbYZpwWM4WQNCCyNSiuFCJzYMxg8H * pubkey (hex): 04ed83704c95d829046f1ac27806211132102c34e9ac7ffa1b71110658e5b9d1bdedc416f5cefc1db0625cd0c75de8192d2b592d7e3b00bcfb4a0e860d880fd1fc * address (base58): 1JyMKvPHkrCQd8jQrqTR1rBsAd1VpRhTiE * compressed: * secret (base58): L4ezQvyC6QoBhxB4GVs9fAPhUKtbaXYUn8YTqoeXwbevQq4U92vN * pubkey (hex): 02ed83704c95d829046f1ac27806211132102c34e9ac7ffa1b71110658e5b9d1bd * address (base58): 1NKRhS7iYUGTaAfaR5z8BueAJesqaTyc4a case 3: * secret (hex): 47f7616ea6f9b923076625b4488115de1ef1187f760e65f89eb6f4f7ff04b012 * uncompressed: * secret (base58): 5JMys7YfK72cRVTrbwkq5paxU7vgkMypB55KyXEtN5uSnjV7K8Y * pubkey (hex): 042596957532fc37e40486b910802ff45eeaa924548c0e1c080ef804e523ec3ed3ed0a9004acf927666eee18b7f5e8ad72ff100a3bb710a577256fd7ec81eb1cb3 * address (base58): 1PM35qz2uwCDzcUJtiqDSudAaaLrWRw41L * compressed: * secret (base58): KydbzBtk6uc7M6dXwEgTEH2sphZxSPbmDSz6kUUHi4eUpSQuhEbq * pubkey (hex): 032596957532fc37e40486b910802ff45eeaa924548c0e1c080ef804e523ec3ed3 * address (base58): 19ck9VKC6KjGxR9LJg4DNMRc45qFrJguvV -- Pieter