OPEN Protocol

Working draft

OPEN v0.1

A transport-neutral object model for a verifiable exchange between independent peers. The notation describes the structure. Bindings define the encoding and verification details.

OPEN v0.1
status: WorkingDraft
model: TransportNeutral
protocolEncoding: BindingDefined
publication: ExplicitPeerChoice
retention: PeerPolicy
forwarding: RelayPolicy
discoverability: IndexPolicy

Identity and exchange

Each binding supplies the representation and proof rules. Verification uses the original signed representation. An account is a namespace for an identity, authorized by that identity or a bound key. Revision references identify published records, while content references can point to assets. Nostr and IPFS/Kubo are candidate bindings.

Peer {
  id: PeerID
  addresses: Address[]
  verifyAddress(address, peerID): Verification
  publish(localObject, binding): SignedObject
  receive(signedObject, binding): SignedObject | VerificationFailure
}

Identity {
  id: IdentityRef
  signingKey: KeyRef
  boundKeys: KeyBinding[]
}

Account {
  identity: IdentityRef
  namespace: Namespace
}

KeyBinding {
  identity: IdentityRef
  key: KeyRef
  authorization: SignedProof
}

Binding {
  encode(localObject, author): SignedObject
  verifyOriginal(signedObject, peerID): Verification
  verifyAddress(address, peerID): Verification
  verifyAccountAuthority(signedObject, account): Verification
  resolve(reference): SignedObject | Unavailable
}

LocalObject {
  version: ProtocolVersion
  type: TypeID
  account: AccountRef?
  properties: Property[]
  references: Reference[]
  extensions: ExtensionData
}

SignedObject {
  author: PeerID
  revision: RevisionRef
  original: BindingSignedRepresentation
  proof: BindingProof
}

Reference {
  role: TypeID
  target: RevisionRef | ContentRef
}

Revision {
  replaces: RevisionRef?
  withdraws: RevisionRef?
  authorizedBy: SignedProof
}

Semantics and matching

These comparison rules are draft proposals. The core separates compatibility from ranking. Missing and unsupported required conditions remain distinct from a match.

Property {
  name: NamespacedID
  function: Fact | Constraint | Attestation | Transition | Metadata
  value: TypedValue
}

TypedValue {
  type: TypeID
  value: Scalar | Reference | TypedValue[]
  unit: UnitID?
  currency: CurrencyID?
}

Constraint {
  property: NamespacedID
  operator: Equal | LessThan | AtMost | GreaterThan | AtLeast | ExtensionOperator
  operand: TypedValue
}

ConditionGroup {
  combine: All | Any
  conditions: (Constraint | ConditionGroup)[]
}

Vocabulary {
  id: NamespacedID
  version: VocabularyVersion
  mappings: Mapping[]
}

Match {
  evaluate(conditions, facts, vocabulary): Result
  compare(compatibleTypes, compatibleUnits, operator): Result
  result: Satisfied | Conflict | Missing | Unsupported
}

MatchingRules {
  equality: Exact
  repeatedProperties: EvaluateByExplicitGrouping
  missingRequiredFact: Missing
  unrecognizedOperator: Unsupported
  incompatibleUnitsOrCurrency: Unsupported
  metadata: ExcludedUnlessReferencedByConstraint
  extensionData: PreserveWithoutImplicitAuthority
  ranking: LocalPreference
}

Situations, offers and agreements

An Agreement records attestations to one version of the terms. A reply accepting an Offer alone does not create that record. Physical fulfillment, settlement, and any legal effects occur outside protocol execution.

Situation extends LocalObject {
  context: Property[]
  conditions: ConditionGroup?
}

SituationUpdate extends LocalObject {
  priorSituation: RevisionRef
}

Offer extends LocalObject {
  situation: RevisionRef?
  facts: Property[]
  eligibility: ConditionGroup?
}

AgreementTerms extends LocalObject {
  parties: IdentityRef[]
  relatedObjects: RevisionRef[]
  terms: ContentRef | RevisionRef
}

Acceptance extends LocalObject {
  party: IdentityRef
  terms: RevisionRef
}

Agreement {
  terms: RevisionRef
  acceptances: RevisionRef[]
  record(verifiedAcceptanceForEveryParty, sameTermsRevision): Agreement
  effect: RecordOfConsent
}

ExchangeRules {
  offerAcceptance: OptionalInputToTerms
  agreement: Optional
  settlement: External
  fulfillment: External
}

Optional interaction profiles

These structures are candidate extensions. Independent clients can implement the minimum exchange without adopting the full MonkeyBusiness interaction vocabulary.

Request { subject: RevisionRef; role: Counterparty | Escrow | Witness | Recordkeeper }
Conversation { subject: RevisionRef? }
Discussion { subject: RevisionRef }
Channel { membership: ProfilePolicy }
Message { context: RevisionRef; content: ContentRef }
Endorsement { subject: RevisionRef; claim: ContentRef }
Issue { subject: RevisionRef; evidence: Reference[] }
Dispute { issue: RevisionRef; parties: IdentityRef[] }
Challenge { subject: RevisionRef; grounds: ContentRef }
Resolution { dispute: RevisionRef; outcome: ContentRef; attestations: RevisionRef[] }
Engagement { deriveFrom: RevisionRef[] }
Event { time: TypedValue; subject: RevisionRef? }
Invoice { subject: RevisionRef; amount: TypedValue }
Payment { subject: RevisionRef; settlement: ExternalRef }
Receipt { subject: RevisionRef; attestation: ContentRef }
Transaction { exchange: RevisionRef[]; settlement: ExternalRef? }

Interoperability fixture

The fixtures describe the proposed acceptance test. Cross-client interoperability remains a milestone to demonstrate.

Fixture.TwoClientExchange {
  peers: [IndependentClientA, IndependentClientB]
  A.publish(Situation.bicycle)
  B.discoverAndVerify(Situation.bicycle, A.id)
  B.publish(Offer.bicycle, references: [Situation.bicycle.revision])
  A.discoverAndVerify(Offer.bicycle, B.id)
  A.evaluate(Situation.bicycle.conditions, Offer.bicycle.facts): Satisfied
  both.retainOriginals()
  both.restartAndVerifyRetainedEvidence()
  repeatWithReversedRoles()
}

Fixture.OptionalAgreement {
  A.attest(Terms.revision)
  B.attest(Terms.revision)
  expected: Agreement.record([A.acceptance, B.acceptance], Terms.revision)
}

Fixture.EdgeCases {
  zeroEqualsZero: Satisfied
  strictUpperBoundary: Conflict
  requiredFieldAbsent: Missing
  unknownRequiredOperator: Unsupported
  duplicateDelivery: SameRevision
  tamperedOriginal: VerificationFailure
  wrongPeerAddress: VerificationFailure
  unsignedOrUnauthorizedWithdrawal: VerificationFailure
  conflictingRevisions: RetainBoth
  privateDraft: LocalOnly
}