From 8a9abffe6ac2d776489c4f4c8dc783cc4c05f94d Mon Sep 17 00:00:00 2001 From: "David A. Harding" Date: Wed, 11 Jun 2014 22:23:13 -0400 Subject: [PATCH] Updates To Compressed Keys Based On Reviewer Feedback Several reviewers kindly provided feedback via IRC tonight, resulting in the following changes: * Mention that compressed keys are used in the offical secp256k1 documentation with the prefix bytes used by Bitcoin. I could not find a publicly-available officialish document defining the prefix bytes, but they're used repeatedly in the offical SECG documentation we autoxref "secp256k1" to, so I went with that. * Remove the mention that Bitcoin Core uses OpenSSL. While true, there is an effort to slowly move away from using OpenSSL for EC in Bitcoin Core. * Change the phrasing of the relative curve location for 0x02 & 0x03 to a form more correct for actuality instead of the illustrated abstraction. * Drop quotes around "uncompressed" since that's the term used in the official secp256k1 docs, not something Bitcoin-specific. --- _includes/guide_wallets.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/_includes/guide_wallets.md b/_includes/guide_wallets.md index 9455104e..af97bcf5 100644 --- a/_includes/guide_wallets.md +++ b/_includes/guide_wallets.md @@ -313,7 +313,7 @@ address utility]. {% autocrossref %} Bitcoin ECDSA public keys represent a point on a particular Elliptic -Curve (EC) defined in secp256k1. In their traditional "uncompressed" form, +Curve (EC) defined in secp256k1. In their traditional uncompressed form, public keys contain an identification byte, a 32-byte X coordinate, and a 32-byte Y coordinate. The extremely simplified illustration below shows such a point on the elliptic curve used by Bitcoin, @@ -336,8 +336,8 @@ as the "top" side or the "bottom" side. No data is lost by creating these compressed public keys---only a small amount of CPU is necessary to reconstruct the Y coordinate and access the uncompressed public key. Both uncompressed and compressed public -keys are supported by default in OpenSSL, the library Bitcoin Core and -many other Bitcoin programs use. +keys are described in official secp256k1 documentation and supported by +default in the widely-used OpenSSL library. Because they're easy to use, and because they reduce almost by half the block chain space used to store public keys for every spent output, @@ -359,7 +359,9 @@ help programs identify how keys should be used: encoding section above.) * Uncompressed public keys start with 0x04; compressed public keys begin - with 0x03 or 0x02 depending on what side of the curve they're on. + with 0x03 or 0x02 depending on whether they're greater or less than + the midpoint of the curve. These prefix bytes are all used in + official secp256k1 documentation. {% endautocrossref %}