warning! the bar for Reasonably Capable Shared Hosting, might be set too high.
FaviDiD is a Brand New way to Decentralized Identify you. using some cryptography Math you can identify yourself using a Private Key to sign your Requests and a Public Key for the service to verify it is from you.
to use FaviDiD you can use This Specification to insure interoperability. If you do not Like where this is going please fork.
this document written on is Semantic version 0.3.0. this document is self-published independently.
i am still Figuring things out. this is not final design and might be vague, impossible, or otherwise not implementable. im still seeking to bring this closer to my vision.
use the Ed25519 and create a Private-Key and a Public-Key, store them securely.
To create a Decentralized id, MUST follow these steps
did:favidid:.
ed25519:.
This produces a standard did:key identifier using the exact same raw 32-byte Ed25519 public key. It
is fully equivalent for signing and encryption purposes in this suite.
0xed (multicodec prefix for Ed25519 public
key).
z (multibase prefix for base58-btc).
did:key:.authentication happens as follows in order.
/Favicond_/favidid/auth to the Planet. with F-FaviDiD: set
to the user's FaviDiD. if the Edge possesses a non-expired PlanetaryCode for this Planet, the Edge SHOULD
send Authorization: PlanetaryCode <PlanetaryCode>
Authorization corrosponding to a valid user in the Planet's data, the Planet MUST respond
with 401 and
WWW-Authenticate with a FaviDiD challenge. FaviDiD challenge is
described below. a Planet MAY add other FaviDiD Challenges but FaviDiD0-3 MUST be present for this specification.
F-FaviDiD:.
/Favicond_/favidid/auth with one of the following
in the Authorization Header (concatenated),
{"typ":"JWT","alg":"EdDSA","proto":"FaviDiD-Auth"}
and then a dot (which is eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsInByb3RvIjoiRmF2aURpRC1BdXRoIn0. ) which is the JWT Header.
alg
isnt EdDSA the Planet MUST skip to authentication
Failure.
aud claim is equal to the Domain.
iss and sub are equal and are equal to the FaviDiD
associated with the Nonce.
nbf and exp. ignore
iat.
nonce claim is correct.
Perform either one the following
planets MUST respond with Status Code 200
Content-Type: application/json and with the following
| Name | Value | Where |
|---|---|---|
proto
| MUST be set to FaviDiD-Auth.
| Body |
success
| MUST be set to the JSON value true.
| Body |
PlanetaryCode
| MUST be a Cryptographically Secure Session token of Planet-Defined
generation. the cookie expiration advertised MUST be when the session token expires.
MUST set the Secure flag, SHOULD set the HttpOnly flag.
|
Set-Cookie
|
nonce
| MUST be set with the actual Nonce used for verification above, exactly. | Body |
planets MUST respond with Status Code 401
Content-Type: application/json
{
"proto": "FaviDiD-Auth",
"success": false
}
The HTTP Retry-After Header SHOULD be set (MUST be either an integer number of seconds (e.g.
300) or an HTTP-date string (RFC 7231).) Indicating how long an Edge SHOULD wait before retrying.
if the value signals a date after 1 hour compared to the HTTP Date Header the Edge MUST
abort automatic Retries, and SHOULD honor the Request, only retrying at User Request. if not
set Edges SHOULD interpret Retry-After: 15
Content-Type is not application/json
a FaviDiD WWW-Authenticate Challenge or FaviDiD challenge is a string as Follows
FaviDiD.
FaviDiD.
Realm param.
Nonce param.
Valid ones include
FaviDiD0-2 Realm="My Realm" Nonce="2XPKHzVg52jDEiaaBt2Y5BAT"
FaviDiD0-72 Realm="My Other Realm" Nonce="31wKW5ctCqfXyWgjj7cHpivv"
FaviDiD35 Realm="antRequest.nl" Nonce="332JGNeGUaa3gSwYdqLekFUa"
FaviDiD1 Nonce="34DgnzKxSTm7uYrh4smyyGsx" Realm="index.php"
invalid ones include
FaviDiD0-2 Nonce="nbD8axZqv5Z97d9Cu8gwab" (omits Realm)
FaviDiD0-2 Realm="My Other Realm" (omits Nonce)
FaviDiD1.3 Nonce="2VnLaWqgpTQPVA7QuGapN733" Realm="index.php" (uses dot instead of minus)
FaviDiD.3 Nonce="bhjE5sfhnRyEwiAA5XzaWX7" Realm="index.php" (no major version)
the Payload MUST or MUST NOT have the following claims.
| Claim Name | Claim Value |
|---|---|
exp
| SHOULD be set 300 integers higher than iat.
|
iat
| MUST be set to the current time utc since the epoch of .
|
aud
| MUST be set to the Planet's Domain (it is assumed to be HTTPS as Edges and Planets MUST NOT use plain HTTP. |
iss
| MUST be set to your did (FaviDiD). |
sub
| MUST be set to your did (FaviDiD). |
nbf
| SHOULD be set 50 integers lower than iat.
|
jti
| MUST be set to an uuid (is ignored in this specification, Planets MAY use this in a Planet-Defined way). |
nonce
| MUST be set to the Nonce given by the Planet. |
FaviDiD Overview: FaviDiD uses two resolution paths — a restricted
profile of did:key (Ed25519-only) and a new lightweight method
did:favidid:ed25519:... optimized for raw key operations.
The Did Resolution (Full) Algorithm only applies to Decentralized id (W3C did:key way) DiDs. for Decentralized id (FaviDiD way) DiDs use Did Resolution (Basic)
To resolve a did:key (did-key), Decode did-key using https://w3c-ccg.github.io/did-key-spec/
and Store the result in did-doc. check conformance with the following RuleSet
0xed).
If everything succeeds Return the raw bytes of the Public Key.
If everything succeeds, an Implementation MAY choose to return the DID Document produced by the spec's algorithm.
The Did Resolution (Basic) Algorithm only applies to Decentralized id (FaviDiD way) DiDs. for Decentralized id (W3C did:key way) DiDs use Did Resolution (Full)
To resolve a did:favidid (did-favidid), SHOULD follow these steps
/^did:favidid:ed25519:(.+)$/
null.
null.
null.
This specification assumes the Planet is hosted on a Reasonably Capable Shared Hosting Server as defined in Foundation 0.2.0.
This specification assumes attackers can:
The following are OUT OF SCOPE:
The protocol design addresses the following threats:
| Risk | Mitigation | Spec Reference |
|---|---|---|
| Replay attacks | Single-use nonces with 300s expiry | § Nonce Generation |
| Signature forgery | Ed25519 signatures (cryptographically secure) | § Key Generation |
| Nonce prediction | CSPRNG requirement, ≥128 bits entropy | § Nonce Requirements |
| Session hijacking | HttpOnly, Secure cookies for PlanetaryCode | § Successful Auth |
| Algorithm confusion | Explicit "alg": "EdDSA" check, rejection of others |
§ Verification Steps |
Even with all mitigations applied, the following risks remain:
429,
implementations MAY send a HTTP Retry-After. Implementations are encouraged to look for rate limiting resources
elsewhere as defining it is out of scope. the exact details of Rate-Limits are Planet-defined.