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 subject (sub) field which points to the action being reacted 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.

Subject Reference

The sub (subject) field references the action being reacted to:

  • Contains the target action’s action_id (a1~...)
  • Target action must exist and be verified
  • Creates a non-hierarchical reference (reactions don’t create visible threading)
  • Cannot modify subject without breaking reference

Why Subject Instead of Parent:

  • parent (p) is used for hierarchical threading (comments create visible child hierarchy)
  • subject (sub) is used for non-hierarchical references (reactions reference without creating hierarchy)
  • Reactions don’t create visible child actions in the timeline
  • This semantic distinction keeps threading clean

Properties:

  • Subject references are immutable
  • Cannot change which post you’re reacting to
  • Merkle tree ensures subject hasn’t been tampered with
  • Federation: remote instances can verify the complete reference

Database Key

The database key for a react token is {type}:{sub}:{iss}

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

  • {type}: Full type including subtype (e.g., “REACT:LIKE”)
  • {sub}: Subject ID (what they’re reacting to)
  • {iss}: Issuer identity (who is reacting)

Example:

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

Audience Resolution

The aud (audience) field is automatically resolved from the subject action:

  • Set to the issuer of the subject action (the post owner)
  • Ensures the reaction notification reaches the content creator
  • Does not need to be explicitly provided when creating the reaction

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
sub NAado5PS4j5+abYtRpBELU0e5OQ+zGf/tuuWvUwQ6PA=

Subtypes

REACT tokens use subtypes to indicate the reaction type:

Subtype Description
REACT:LIKE Standard like reaction
REACT:LOVE Love/heart reaction
REACT:LAUGH Laughing reaction
REACT:WOW Surprised/amazed reaction
REACT:SAD Sad reaction
REACT:ANGRY Angry reaction
REACT:DEL Delete/remove the reaction

See Also