~ knotless Search/
↑↓ move↵ open⇧↵ all results

socialweb.computer/socialweb-computer-kcp

socialweb.computer: a compute market on atproto (kcp)

1 collaborator
0
0
67 lines · 3.3 KB Raw History
# Verify it. Don't just trust it.

There is no operator vouching for a contract's history: the records do that themselves. Signing makes a record's origin
checkable; content-addressing makes its content checkable. Together they mean anyone, not just the two participants,
can confirm a contract actually happened.

### Signed by construction

Every RFP, bid, accept and receipt is a record in the author's own repository, and each carries an inline
`network.attested` signature: secp256k1 ECDSA (low-S) over the record's attestation CID, by a key bound to the
author's DID. A record the author did not sign does not verify.

### Content-addressed, not just logged

A strongRef pins both a location (`uri`) and a hash (`cid`): DAG-CBOR over the record, SHA-256, encoded as a CIDv1.
Change one byte and the cid no longer matches; a reference cannot quietly point somewhere else later.

## A receipt anchors the whole contract

The `market.receipt` is the one record that references all three prior hops (rfp, bid, accept), each by strongRef.
Reading a receipt is enough to reconstruct and re-check the entire negotiation.

```yaml
$type: com.publicdomainrelay.temp.market.receipt
rfp: {uri: at://did:plc:alice/com.publicdomainrelay.temp.market.rfp/3mm3d, cid: bafyrei...rfp}
bid: {uri: at://did:plc:bob/com.publicdomainrelay.temp.market.bid/3mm4, cid: bafyrei...bid}
accept: {uri: at://did:plc:alice/com.publicdomainrelay.temp.market.accept/3mlag, cid: bafyrei...accept}
cid: bafyrei...binding    # attestation CID: binds this receipt to the accept
signatures:
  - $type: network.attested.signature
    key: did:key:zQ3s...  # the signer's did:key; the issuer binds it to the party's DID
    cid: bafyrei...attestation
    signature: {$bytes: "base64-ecdsa-signature"}
    issuer: did:plc:bob
```

## What a provider checks before it provisions

- The accept's signature, that the accepted bid is the provider's own bid for that RFP, and that the accept's author
  is the RFP's author.
- The RFP's inline `network.attested` signature by the requester.
- Its policies, again, on the accept; and its capacity.
- For `vm.delete`: the event's author must be the accept's author.

And the requester checks the receipt's `cid` against the accept (`VerifyReceipt`) before it holds the VM. Full
field-level rules: [the spec](docs.md#authority--validation).

## Verify a receipt yourself

Nothing here requires special access: the checks the two sides run are the ones you can run afterward, from either
side or neither.

1. Fetch the receipt record and confirm its NSID is `market.receipt`.
2. Resolve `rfp`, `bid` and `accept` by their uris and recompute each cid: it must match the strongRef.
3. Verify each record's signature against its key (`did:key`), and that the key is bound to the author's DID.
4. Check the receipt's own `cid`: the attestation CID binding the accept to this receipt.

This is alpha software under a temporary NSID namespace. The cryptographic guarantees above hold today; the endpoints
and record shapes around them may still change. Signing, keys and associations in depth:
[protocol/identity.md](../../docs/protocol/identity.md).

### Access control is a separate question

Verification proves a contract happened. Whose bids you ever see in the first place is what policy modes decide.

- [See trust & policy](trust.md)
- [Read the spec](docs.md)