interledgerjs / five-bells-condition

JavaScript implementation of Crypto Conditions validation and fulfillment
https://github.com/rfcs/crypto-conditions
Other
31 stars 21 forks source link

Specify padding for base64URL encoded values #44

Open gip opened 8 years ago

gip commented 8 years ago

We may want to specify the padding for base64URL encoding in https://interledger.org/five-bells-condition/spec.html.

From rfc4648 :

In some circumstances, the use of padding ("=") in base-encoded data
   is not required or used.  In the general case, when assumptions about
   the size of transported data cannot be made, padding is required to
   yield correct decoded data.

   Implementations MUST include appropriate pad characters at the end of
   encoded data unless the specification referring to this document
   explicitly states otherwise.

It looks like some implementation (like the one in this directory) drops padding. Implementations in other languages may not (for instance in Java and Haskell), creating inconsistencies. Comparing conditions becomes more complex in case of optional padding.

justmoon commented 8 years ago

Good point! Our decision is to use no padding. If padding appears, the condition should be considered invalid.