diff --git a/rfc/0004_ws2p_v1.md b/rfc/0004_ws2p_v1.md index cf2a647657b1e3d7d5cdcd1c80c8a12eea3bc720..425b43705cf0175fdba91ca8f1c77c391afb2f81 100644 --- a/rfc/0004_ws2p_v1.md +++ b/rfc/0004_ws2p_v1.md @@ -34,10 +34,11 @@ WS2P is exclusively based on websocket technology. ### Endpoint format -In the peer card : `WS2P uuid host port path` +In the peer card : `API uuid host port path` Resolved in* : `ws://host:port/path` *If the port is `443`, the `wss://` protocol will be used. +api := Field indicating api type. The only two types are `WS2P` and `WS2PTOR`. uuid := Random sequence of 8 hexadecimal characters. (This uuid, coupled with the public key, makes it possible to identify a Duniter node in a unique way.) host := Domain name or ipv4 or ipv6 (it is not possible to declare both an ipv4 and an ipv6, for this it is necessary to use a domain name.) port := Mandatory. Must be an integer. (_By convention, port 20900 is used for currency g1-test and port 20901 for currency g1._) @@ -243,16 +244,16 @@ Accepted since duniter-ts **v1.6.9**, relayed fully since duniter-ts **v1.6.15** _Nodes with versions lower than 1.6.15 bounce a degraded version of the head, only `message` and `sig` fields are relayed._ { - message : "WS2P:HEAD:1:PUBKEY:BLOCKSTAMP:WS2PID:SOFTWARE:SOFT_VERSION:POW_PREFIX, + message : "API:HEAD:1:PUBKEY:BLOCKSTAMP:WS2PID:SOFTWARE:SOFT_VERSION:POW_PREFIX, sig : "TPh2A3NS8cHj8yrJk1Yeldx2H6bPEp46cFAGZXKfxJcNgXL2sWrlirhIOlp8pkUFSrwDawWY1zO1jlgUqMvlAg==", - messageV2: "WS2P:HEAD:2:PUBKEY:BLOCKSTAMP:WS2PID:SOFTWARE:SOFT_VERSION:POW_PREFIX:FREE_MEMBER_ROOM:FREE_MIRROR_ROOM", + messageV2: "API:HEAD:2:PUBKEY:BLOCKSTAMP:WS2PID:SOFTWARE:SOFT_VERSION:POW_PREFIX:FREE_MEMBER_ROOM:FREE_MIRROR_ROOM", sigV2: "ta1lRrWsjGcYHcLdS75JgEW5B8ByRetFVUVVpakKNJBirhRe8HcYUHEOM7xj/+gUQGGOit6Gm5Q/lsvfsngWAQ==", step: 0 } #### message & messageV2 fields -API = `WS2P` +API := field indicating the network layer type and giving some information about the Network configuration. (See section "API field" for details) MESSAGE_TYPE = `HEAD` PUBKEY := public key of the issuer node of this head BLOCKSTAMP = `blockNumber-Hash` @@ -263,6 +264,24 @@ POW_PREFIX := nonce prefix for proof of work (manually fixed by the user) FREE_MEMBER_ROOM := Number of incoming connection requests that can still be accepted from member nodes (FREE_MIROR_ROOM - Number of incoming connections established by non-priority mirror nodes). FREE_MIROR_ROOM := An integer indicating the number of incoming connections that the node can still receive. +##### API field + +general scheme : `WS2P[PrivateConf][PublicConf]` + +We have 4 types of WS2P Private: +OCA : clear all +OTM : tor mixed +OTA : tor all +OTS : tor strict + +And two types of WS2P Public : +IC clear endpoint +IT tor endpoint + +The WS2P Private conf is prefixed with an O and the ws2p public conf with an I, so the classic nodes will be of type `WS2POCAIC`. + +If WS2P Public is disabled, the [PublicConf] part is absent : `WS2POCA` + #### sig & sigv2 fields sig: ed25519 signature of the message field in base64.