aboutsummaryrefslogtreecommitdiff
path: root/spec/rend-spec/encoding-onion-addresses.md
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2023-10-14 18:54:14 -0400
committerNick Mathewson <nickm@torproject.org>2023-10-14 18:54:41 -0400
commit45f94858fb831fd69e8c2ff0d6ae6ccd792ac7b8 (patch)
treee410e1e7322d48afada4d71f1b409a4f69788d94 /spec/rend-spec/encoding-onion-addresses.md
parent3457b0720834c8347d8318c1080ebc9486d77300 (diff)
downloadtorspec-45f94858fb831fd69e8c2ff0d6ae6ccd792ac7b8.tar.gz
torspec-45f94858fb831fd69e8c2ff0d6ae6ccd792ac7b8.zip
Rename rend-spec-v3 urls to rend-spec.
Diffstat (limited to 'spec/rend-spec/encoding-onion-addresses.md')
-rw-r--r--spec/rend-spec/encoding-onion-addresses.md27
1 files changed, 27 insertions, 0 deletions
diff --git a/spec/rend-spec/encoding-onion-addresses.md b/spec/rend-spec/encoding-onion-addresses.md
new file mode 100644
index 0000000..14b3c44
--- /dev/null
+++ b/spec/rend-spec/encoding-onion-addresses.md
@@ -0,0 +1,27 @@
+<a id="rend-spec-v3.txt-6"></a>
+
+# Encoding onion addresses \[ONIONADDRESS\]
+
+The onion address of a hidden service includes its identity public key, a
+version field and a basic checksum. All this information is then base32
+encoded as shown below:
+
+```text
+ onion_address = base32(PUBKEY | CHECKSUM | VERSION) + ".onion"
+ CHECKSUM = H(".onion checksum" | PUBKEY | VERSION)[:2]
+
+ where:
+ - PUBKEY is the 32 bytes ed25519 master pubkey of the hidden service.
+ - VERSION is a one byte version field (default value '\x03')
+ - ".onion checksum" is a constant string
+ - CHECKSUM is truncated to two bytes before inserting it in onion_address
+
+ Here are a few example addresses:
+
+ pg6mmjiyjmcrsslvykfwnntlaru7p5svn6y2ymmju6nubxndf4pscryd.onion
+ sp3k262uwy4r2k3ycr5awluarykdpag6a7y33jxop4cs2lu5uz5sseqd.onion
+ xa4r2iadxm55fbnqgwwi5mymqdcofiu3w6rpbtqn7b2dyn7mgwj64jyd.onion
+```
+
+For more information about this encoding, please see our discussion thread
+at \[ONIONADDRESS-REFS\].