# tibet-iddrop

**Identity Drop and Acceptance Protocol — Rust implementation of [`draft-vandemeent-iddrop-00`](../../standards/ietf/draft-vandemeent-iddrop-00.md).**

[![crates.io](https://img.shields.io/badge/crates.io-tibet--iddrop-orange.svg)](https://crates.io/crates/tibet-iddrop)
[![Spec](https://img.shields.io/badge/IETF-draft--00-blue.svg)](../../standards/ietf/draft-vandemeent-iddrop-00.md)
[![License](https://img.shields.io/badge/license-MIT%2FApache--2.0-blue.svg)]()

iddrop is the protocol layer that lets identity claims, capability grants
and verifiable credentials move between agents — **only on explicit
consent**, never as a "drop" you have to defend against after the fact.

## Two initiation modes, one protocol-engine

| | offer-first (§6) | request-first (§7) |
|---|---|---|
| Intent | humaan / proximity / NFC / QR | autonoom / cap-bus / wire |
| Initiator | sender opens an offer | receiver issues a request |
| Nonce source | JIT at contact (proximity event) | receiver pre-emits over wire |
| Consent shape | "wil je deze identity aannemen?" | "geef antwoord op deze vraag" |
| Same core | sealed + identity-bound + AINS-verified | idem |

## Six validation rules (§8)

The receiver MUST run all six before any identity-claim is materialised:

1. **Carrier Truth** — TBZ v2 envelope is verified (AEAD + Ed25519)
2. **Semantic Class** — `PayloadClass::Identity` is explicit
3. **Receiver Binding** — `receiver_pubkey` matches local identity
4. **Claim Provenance** — AINS / JIS lookup confirms `sender_pubkey`
5. **Causal Binding** — `request_id` + `challenge_nonce` (or offer session)
6. **Commitment Discipline** — validation is the precondition, not the action

## Layers

```
L3: iddrop protocol            (= this crate)
L2: SSM / semantic typing      (= PayloadClass::Identity in TBZ v2.2+)
L1: TBZ v2 sealed bytes        (= tibet-zip-core 2.2.0)
```

## Use case #1 — trust-kernel handoff

The Android KIT app already carries a trust-kernel (AES-256-GCM + TIBET
tokens + eSIM trust). `tibet-iddrop` is the protocol that lets one
trust-kernel instance hand a sub-identity to another instance — parent →
child device, friend → friend introduction, employer → contractor
capability grant.

## Quick start (v0.1 skeleton)

```bash
# Print spec reference
iddrop spec

# Open a proximity offer (offer-first)
iddrop offer \
  --identity jasper.aint \
  --sender-pubkey <hex-64> \
  --display-name "Jasper" \
  --ttl 60

# Emit a wire request (request-first)
iddrop request \
  --identity jasper.aint \
  --receiver-pubkey <hex-64> \
  --ttl 300

# Inspect a response JSON without accepting
iddrop inspect ./response.json

# Run the six validator rules
iddrop validate ./response.json \
  --local-pubkey <hex-64> \
  --request-id <id> \
  --challenge-nonce <hex-32> \
  --mode request-first

# Accept (materialise) — stub in v0.1
iddrop accept ./response.json
```

## Status

- **v0.1 (= now)** — skeleton crate: types match draft Appendix A, six-rule
  validator with 8 passing tests, CLI surface for offer / request /
  inspect / validate / accept, HTTP wire transport stub, NFC/QR proximity
  placeholders.
- **v0.2** — couple validator to live AINS resolver + brain-api iddrop
  endpoints (`/api/iddrop/inbox/...`). Wire i-poll adapter.
- **v0.3** — KIT app trust-kernel coupling (Android JNI / Kotlin bridge).
  Real NFC/QR proximity transports.

## Cross-references

- **Spec**: [`draft-vandemeent-iddrop-00`](../../standards/ietf/draft-vandemeent-iddrop-00.md)
- **L2 substrate**: [`tibet-zip-core` 2.2.0](https://crates.io/crates/tibet-zip-core) — `PayloadClass::Identity`
- **L1 carrier**: TBZ v2 sealed envelopes
- **Trust-kernel**: Android KIT app (AES-256-GCM + TIBET tokens + eSIM trust)

## Author

**Jasper van de Meent** — [Humotica](https://humotica.com)

## License

MIT / Apache-2.0

## Enterprise

For private hub hosting, SLA support, custom integrations, or compliance guidance:

| | |
|---|---|
| **Enterprise** | enterprise@humotica.com |
| **Support** | support@humotica.com |
| **Security** | security@humotica.com |

## Credits

Designed by [Jasper van de Meent](https://github.com/jaspertvdm). Built by Jasper and [Root AI](https://humotica.com) as part of [HumoticaOS](https://humotica.com).

