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. Like every action token it is content-addressed — see Content Addressing.

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

REACT uses sub rather than p so reactions do not create visible threading — see Parent vs Subject.

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}, so a user can hold only one active reaction of each type to a given action — see Database Keys.

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

Gating

A reaction is rejected if the subject action has reactions disabled. The REACT definition sets gated_by_subject_flag: 'R', so a subject carrying the lowercase r flag (reactions off) blocks new reactions.

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 a1~8kR3mN9pQ2vL6xWpYzT4BjN…

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