Skip to main content

Health Records

Who owns your health data — you, or the institutions that hold it?

In the current system, health records live in hospital databases, insurance systems, and clinic EMRs. The patient is the subject of the data but rarely the controller. Sharing requires faxes, portals, and authorizations that expire, get lost, or get ignored. The patient cannot revoke access. The institution cannot prove they haven't shared.

Blockchain changes the ownership question, not the storage question. The data still needs to live somewhere reliable. The question is who holds the key.

The Architecture

Four Sui components, each solving a different piece:

LayerComponentJob
Identityidentity Move modulePatient's verifiable identity — who are you?
StorageWalrusWhere does the data live? (encrypted blobs, epoch-based)
Access controlSealWho can decrypt it? (on-chain policy, IBE)
ComputationNautilus TEEWho can compute on it without seeing it?

The key property: the hospital never holds the decryption key. They hold ciphertext only. Seal releases keys directly to authorized parties based on on-chain policy — the app server is not in the key distribution path.

Data Flow

1. Patient creates Identity object
identity module → unique patient_id on-chain

2. Provider uploads health record
Encrypted with patient's Seal public key before upload
Walrus stores ciphertext → returns blob_id (permanent reference)
blob_id recorded on-chain linked to patient_id

3. Patient creates access policy
Seal policy object: "DoctorCap issued by patient → can request key"
Only the patient can issue, modify, or revoke this capability

4. Doctor requests access
Presents DoctorCap + patient identity
Seal verifies on-chain policy
Seal releases decryption key directly to doctor
Move event logged — access permanently recorded on-chain

5. Doctor decrypts locally
Plaintext never touches app server
Record viewed in authorized client only

6. For computation (diagnosis, risk modeling)
Nautilus TEE receives encrypted blob
Computes inside secure enclave — plaintext never exposed to system
Posts AttestationObject on-chain proving the computation ran correctly

Access Policy Types

Seal supports multiple policy models for different clinical contexts:

ContextPolicy typeHow it works
Primary careCapability (DoctorCap)Patient issues cap to named provider
Emergency accessTime-limitedDecrypt allowed until clock::timestamp_ms > expiry
Research (de-identified)ThresholdM-of-N consent holders required
Insurance reviewTime-limited + capabilityInsurer holds cap valid for 30-day review window
Family consentMulti-addressMultiple guardians must approve

The patient controls which policy applies. They can issue new capabilities, revoke existing ones, and set time limits — all via Move transactions.

Walrus Storage

Walrus uses Red Stuff erasure coding — the same family as RAID but distributed across a network of storage nodes. Data survives up to 2/3 node failure. Epoch-based availability: set the epoch length at upload time. For health records, long epochs (52+ weeks) are appropriate.

Record typeTypical sizeEpoch recommendation
Structured record (JSON)1 KB – 100 KB52+ epochs (patient lifetime)
Lab results, imaging reports100 KB – 1 MB52+ epochs
DICOM imaging (MRI, CT)10 MB – 500 MB52+ epochs — cost is significant
Wearable telemetry batches1 KB – 10 MB per batch4–12 epochs (operational window)

Cost scales with data volume × epoch length. A structured record at 52 weeks is negligible. DICOM imaging at patient-lifetime epochs requires a meaningful cost model upfront.

Regulatory Alignment

This architecture addresses specific HIPAA-equivalent requirements:

RequirementHow this architecture satisfies it
Data encrypted at restWalrus stores ciphertext only — Seal encrypts before upload
Access audit trailMove events record every Seal key request permanently
Minimum necessary accessPolicy scopes — time-limited and capability-bound access
Patient right to revokePatient revokes DoctorCap via Move transaction
Computation integrityNautilus TEE attestation proves correct computation

What this architecture does not provide: compliance certification, legal advice, or guarantee against regulatory interpretation. Architecture satisfies technical requirements — legal review is separate.

The Key Question

Does the patient ever need to trust the app server to protect their data?

If yes — the Seal policy is wrong. The architecture should work correctly even if the app server is compromised. Seal enforces access at the cryptographic layer. No key management on the server side means no breach vector from server compromise.

This is the design test for any health data architecture on this stack: when the server goes down, or gets hacked, or gets a government subpoena — does the patient's data remain private? With Seal, the answer is yes. The server never held the key.

Context

Questions

If the patient controls access via a capability object, what happens when the patient loses access to their wallet — and is that better or worse than the current system?

  • At what point does the cost of Walrus storage at patient-lifetime epochs become a design constraint rather than a negligible line item?
  • If Nautilus proves a computation was correct without revealing the input, can that attestation serve as evidence in a legal dispute?
  • Who pays gas for a patient issuing and revoking access capabilities — and does that fee structure create access barriers?