React Token

This token represents a reaction created by a user.

The react token must not contain a content (c) field. The token must contain a parent (p) field which points to the parent object the reaction is referring to. For other constraints see the Action Tokens.

Content-Addressing

This token is content-addressed using SHA-256:

  • The entire JWT token (header + payload + signature) is hashed
  • Action ID format: a1~{base64_hash}
  • Changing any field invalidates the action_id
  • See Content-Addressing & Merkle Trees for details

Immutability: Once created, a REACT token cannot be modified without changing its action ID.

Parent Reference

The p (parent) field references the parent action:

  • Contains the parent’s action_id (a1~...)
  • Parent must exist and be verified
  • Creates immutable parent-child relationship
  • Cannot modify parent without breaking reference

Properties:

  • Parent references create an immutable chain
  • Cannot change which post you’re reacting to
  • Merkle tree ensures parent hasn’t been tampered with
  • Federation: remote instances can verify the complete chain

Database Key

The database key for a react token is [iss, "REACT", p]

Purpose: This key ensures that a user can only have one active reaction to a specific parent action. The key components are:

  • iss: Issuer identity (who is reacting)
  • "REACT": Base token type (not the subtype)
  • p: Parent ID (what they’re reacting to)

Example:

  • Alice LIKEs a post → Stored with key [alice.example.com, "REACT", a1~post123]
  • Alice changes to LOVE → New token with same key, previous LIKE is marked deleted
  • Only ONE reaction type per user per post
  • Changing reaction type creates a new action but invalidates the previous one

Example

User @someotheruser.cloudillo.net likes a post:

Field Value
iss someotheruser.cloudillo.net
aud somegroup.cloudillo.net
iat 2024-04-13T00:01:10.000Z
k 20240301
t REACT:LIKE
p NAado5PS4j5+abYtRpBELU0e5OQ+zGf/tuuWvUwQ6PA=