Skip to content

Instantly share code, notes, and snippets.

@sipa
Last active March 17, 2017 09:06
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sipa/c291da162f6ef8cc770bfc7f015c6c49 to your computer and use it in GitHub Desktop.
Save sipa/c291da162f6ef8cc770bfc7f015c6c49 to your computer and use it in GitHub Desktop.
@gmaxwell
Copy link

gmaxwell commented Mar 3, 2017

Immunity to easily confused non-address sequences.

Transaction IDs or other similar encoded data may be easily confused for addresses by users. This specification provides for improved resistance to this common class of confusions beyond what is provided by the checksum.

The minimal padding requirement in this specification means that no input with length under 11, over 74, or congruent to 0, 3, or 5
mod 8 can ever be mistaken as a valid Bitcoin address. This means that no common hex sequence length (8, 16, 32, 40, or 64
characters) would be accepted by this specification.

Similarly, any string with the common base64 maximum line length of 76 characters can interpreted as an address.

A short base64 encoded string (with length 12,16,20,24,28,32,36,40,44,48,52,56,60,64,68, or 72) could potentially be misinterpreted as an address, however the probability of this happening for any uniformly selected random base-64 string is never greater than 1 : 2^60 due to the improbability of matching the prefix and partial overlap of the character sets.
.....

or something like that.

@gmaxwell
Copy link

gmaxwell commented Mar 7, 2017

I just supported someone today to was running into getting an invalid address while trying to send funds. Looks like his chat software was adding invisible characters which then the rpc was rejecting, but when sent to bc.i were just ignored. We might want to include a vector with such a character and have advice that UIs should do something useful in those cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment