[tor-commits] [torspec/main] address-spec: Add v3 onion address spec

dgoulet at torproject.org dgoulet at torproject.org
Tue Jun 29 15:09:18 UTC 2021


commit 38bf60c0760af146f3bdd13a4cb3e111a2e38c51
Author: David Goulet <dgoulet at torproject.org>
Date:   Tue Jun 29 11:07:57 2021 -0400

    address-spec: Add v3 onion address spec
    
    Closes #51
    
    Signed-off-by: David Goulet <dgoulet at torproject.org>
---
 address-spec.txt | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/address-spec.txt b/address-spec.txt
index 30965ec..2a6f7db 100644
--- a/address-spec.txt
+++ b/address-spec.txt
@@ -51,11 +51,23 @@
   SYNTAX:  [digest].onion
            [ignored].[digest].onion
 
-  The digest is the first eighty bits of a SHA1 hash of the identity key for
-  a hidden service, encoded in base32.
+  Version 2 addresses (deprecated since 0.4.6.1-alpha), the digest is the first
+  eighty bits of a SHA1 hash of the identity key for a hidden service, encoded
+  in base32.
+
+  Version 3 addresses, the digest is defined as:
+
+     onion_address = base32(PUBKEY | CHECKSUM | VERSION)
+     CHECKSUM = H(".onion checksum" | PUBKEY | VERSION)[:2]
+
+     where:
+       - PUBKEY is the 32 bytes ed25519 master pubkey of the onion 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
 
   When Tor sees an address in this format, it tries to look up and connect to
-  the specified hidden service.  See rend-spec.txt for full details.
+  the specified onion service. See rend-spec-v3.txt for full details.
 
   The "ignored" portion of the address is intended for use in vhosting, and
   is supported in Tor 0.2.4.10-alpha and later.



More information about the tor-commits mailing list