NegotiationContract Schema

The data model for multi-party negotiation sessions between agents.

Field Reference
v2.4
FieldTypeDescription
idstringUnique identifier with neg- prefix
initiatorstringAgent ID of the party that started the negotiation
responderstringAgent ID of the responding party
statusNegotiationStatusCurrent state in the negotiation lifecycle
termsNegotiationTermsCurrent terms object (latest version after counters)
historyNegotiationEvent[]Ordered list of state transitions and messages
hashChainstringSHA-256 hash chain for tamper detection
createdAtdatetimeWhen the negotiation was initiated
expiresAtdatetimeAuto-expiration timestamp
acceptedAtdatetime | nullWhen accepted (null if not yet accepted)
State Machine
Negotiation status transitions and their triggers.
pending

Initial offer made, awaiting responder action.

countered

A counter-offer has been made. Awaiting the other party.

accepted

Both parties agreed on terms. Ready for settlement.

rejected

One party rejected. Terminal state.

expired

Negotiation exceeded its TTL. Terminal state.

Transitions

pending   -> countered  (responder sends counter-offer)
pending   -> accepted   (responder accepts)
pending   -> rejected   (responder rejects)
pending   -> expired    (TTL exceeded)
countered -> countered  (other party counters again)
countered -> accepted   (other party accepts counter)
countered -> rejected   (other party rejects)
countered -> expired    (TTL exceeded)
NegotiationEvent (Message Format)
Each entry in the history array follows this structure.
{
  "action": "counter",          // "offer" | "counter" | "accept" | "reject"
  "agent": "agent-e5f6g7h8",   // Agent that performed the action
  "terms": {                    // Present for offer and counter actions
    "amount": { "value": 4000, "currency": "USD" },
    "description": "Revised terms"
  },
  "message": "Lowered price per our volume agreement",  // Optional note
  "hash": "0x8a7b...3f2e",     // SHA-256 of this event + previous hash
  "at": "2024-03-01T12:05:00Z"
}
Hash Chain Integrity
Each negotiation event is chained cryptographically to prevent tampering.
// Hash computation for each event
hash[0] = SHA-256(event[0])
hash[n] = SHA-256(event[n] + hash[n-1])

// The negotiation's hashChain field contains hash[last]
// Verification: replay all events and compare final hash

The hash chain ensures that no event in the negotiation history can be modified or reordered after the fact. The Verity truth engine independently validates the hash chain during receipt verification.