Skip to content

feat(taip-9)!: ConfirmRelationship body matches the spec Agent payload - #7

Merged
thomasjsk merged 1 commit into
mainfrom
feature/confirm-relationship-owner
Jun 12, 2026
Merged

feat(taip-9)!: ConfirmRelationship body matches the spec Agent payload#7
thomasjsk merged 1 commit into
mainfrom
feature/confirm-relationship-owner

Conversation

@thomasjsk

@thomasjsk thomasjsk commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

What

Reshapes the ConfirmRelationship message body to match the TAIP-9 specification.

Per TAIP-9, the confirmation payload matches the Agent payload — a flat object:

  • @contexthttps://tap.rsvp/schema/1.0
  • @typehttps://tap.rsvp/schema/1.0#Agent
  • @id — REQUIRED, the DID of the confirmed agent/address
  • for — REQUIRED, the DID of the entity the agent acts on behalf of (single DID or array, per TAIP-5)
  • role — OPTIONAL, the agent's role in the transaction

Canonical spec example:

{
  "@context": "https://tap.rsvp/schema/1.0",
  "@type": "https://tap.rsvp/schema/1.0#Agent",
  "@id": "did:pkh:eip155:1:0x1234a96D359eC26a11e2C2b3d8f8B8942d5Bfcdb",
  "for": "did:web:beneficiary.vasp",
  "role": "SettlementAddress"
}

The previous body used a non-spec { relationship: { parties: [...] }, status } wrapper, which does not appear anywhere in TAIP-9.

Changes

  • ConfirmRelationshipBody is now the flat Agent payload (@id, for, role); the relationship/status wrapper fields are removed.
  • NewConfirmRelationshipMessage validates @id and for (both required) and emits body @type = #Agent (the #ConfirmRelationship IRI remains the envelope/message type).
  • The now-dead Relationship struct is removed (Party is retained — still used by other message types).
  • Tests rewritten against the two TAIP-9 spec examples; assert exact JSON field names, single/array for, optional role, and required-field validation.

BREAKING CHANGE

The wire shape of ConfirmRelationship changed. Consumers must:

  • Read the confirmed agent/address from body.ID (@id) — not body.Relationship.Parties[0].ID.
  • Read the owner from body.For (for).
  • Read the optional role from body.Role (role).
  • Stop using body.Relationship / body.Status (removed).
  • Provide @id and for when constructing (now required).

BREAKING CHANGE: ConfirmRelationship's body is now the flat TAIP-9 Agent payload
(@context, @type=#Agent, @id, for, role) instead of the non-spec {relationship,
status} wrapper. @id is the confirmed agent/address; for (required) is the entity
it acts on behalf of; role is optional. Removes the now-dead Relationship struct.

Consumers read body.ID / body.For / body.Role; the @id and for fields are required
by NewConfirmRelationshipMessage.
@thomasjsk
thomasjsk force-pushed the feature/confirm-relationship-owner branch from 3df8b58 to a8a8137 Compare June 12, 2026 14:00
@thomasjsk
thomasjsk merged commit 97ab378 into main Jun 12, 2026
2 of 3 checks passed
@thomasjsk thomasjsk mentioned this pull request Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant