summaryrefslogtreecommitdiff
path: root/bip-0173.mediawiki
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2017-08-03 12:14:43 -0700
committerPieter Wuille <pieter.wuille@gmail.com>2017-08-03 23:30:48 -0700
commit59391f1862873a66af0a15fe776cc335412cc875 (patch)
tree44b8db27000ac4630513976f41dfd770a9644969 /bip-0173.mediawiki
parent9b1e7dc8f5cba6937b95bd19c55c8b1af2fd05c5 (diff)
downloadbips-59391f1862873a66af0a15fe776cc335412cc875.tar.xz
Elaborate on the encoding of witness versions
Diffstat (limited to 'bip-0173.mediawiki')
-rw-r--r--bip-0173.mediawiki6
1 files changed, 6 insertions, 0 deletions
diff --git a/bip-0173.mediawiki b/bip-0173.mediawiki
index d9b3a03..0c911b4 100644
--- a/bip-0173.mediawiki
+++ b/bip-0173.mediawiki
@@ -227,6 +227,12 @@ program is neither 20 nor 32 bytes, the script must fail.''
As a result of the previous rules, addresses are always between 14 and 74 characters long, and their length modulo 8 cannot be 0, 3, or 5.
Version 0 witness addresses are always 42 or 62 characters, but implementations MUST allow the use of any version.
+Implementations should take special care when converting the address to a
+scriptPubkey, where witness version ''n'' is stored as ''OP_n''. OP_0 is
+encoded as 0x00, but OP_1 through OP_16 are encoded as 0x51 though 0x60
+(81 to 96 in decimal). If a bech32 address is converted to an incorrect
+scriptPubKey the result will likely be either unspendable or insecure.
+
===Compatibility===
Only new software will be able to use these addresses, and only for