NegotiationContract Schema
The data model for multi-party negotiation sessions between agents.
Field Reference
v2.4| Field | Type | Description |
|---|---|---|
| id | string | Unique identifier with neg- prefix |
| initiator | string | Agent ID of the party that started the negotiation |
| responder | string | Agent ID of the responding party |
| status | NegotiationStatus | Current state in the negotiation lifecycle |
| terms | NegotiationTerms | Current terms object (latest version after counters) |
| history | NegotiationEvent[] | Ordered list of state transitions and messages |
| hashChain | string | SHA-256 hash chain for tamper detection |
| createdAt | datetime | When the negotiation was initiated |
| expiresAt | datetime | Auto-expiration timestamp |
| acceptedAt | datetime | null | When accepted (null if not yet accepted) |
State Machine
Negotiation status transitions and their triggers.
pendingInitial offer made, awaiting responder action.
counteredA counter-offer has been made. Awaiting the other party.
acceptedBoth parties agreed on terms. Ready for settlement.
rejectedOne party rejected. Terminal state.
expiredNegotiation 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 hashThe 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.