Is there a limit to how many characters are allowed in the message parameter of a BIP21 URI? I tried searching on the subject, but found nothing about it.
1 Answer
There isn't a limit described by the BIP (https://github.com/bitcoin/bips/blob/master/bip-0021.mediawiki). In general, however, URIs might be encoded into QR codes, so their length should be kept as small as possible.
GET requests often have limits on the length of the encoded URLs, something like 2000 characters (https://stackoverflow.com/questions/266322/is-there-a-limit-to-the-length-of-a-get-request). This might be applicable depending on how you are using the URI.
As a guideline, however, I would say that messages in Bitcoin URIs should be fairly short. I'd probably try to stick to less than 200 characters.
-
1Good answer. Also keep in mind that most modern browsers UTF8-encode an IRI and then percent-encode the non-ASCII bytes while encoding it into a URI so when the message contains international characters its length should be even less than that.– user11221Commented Jan 13, 2015 at 4:28