DAT
DAT, which stands for DOT Authentication Token, draws an analogy from the mathematical concept of the dot product.
Yet, DAT goes beyond by incorporating advanced cryptographic techniques like PublicKey Cryptography, Multi-party Compute to ensure decentralization, and Blockchain for maintaining statefulness. It adopts the JWT syntax, featuring a three-component structure for enhanced interpretability. This perspective allows us to perceive DAT as a Web3 JWT.
Syntax
<HEADER>.<BODY>.<SIGNATURE>
HEADER
{
ver?: number; // Optional: "Version" of the token
typ: DatTokenType; // "Type" of the DAT token
sig?: SigAlgoWithCurve; // Optional: "Signing algorithm" along with curve been used
"#"?: HashAlgorithm; // Optional: "Hashing algorithm" used being signing the actual payload
}
SESSION
, BASIC
and CHALLENGE
BODY
{
exp: number; // * Time of token expiry
sfn?: boolean; // Optional: Determines whether stateful or stateless authentication
msg?: string // Optional: Custom message used for signing
}
SIGNATURE
{
dig: string; // Hex string of the signature digest
}