Skip to main content
Every map a TEE contract reads or writes must exist before the contract runs — the vault map in the walkthrough, or a secrets map holding a third-party API key. Create each with the TenantClient; the example below creates secrets. The tail is the per-map local name; the host stores it as z:<tid>:<tail>.
readers must be set explicitly — the KV governor defaults to deny, so leaving it off makes the contract’s own reads fail with AccessDenied. Creating a map that already exists throws map already exists. When you re-deploy, catch that and call tenant.maps.update(tail, { readers, writers }) with the new contractId instead, so the map follows the new registration. Map visibility quick reference:
  • "private" — only your contracts can access this map (default, use it for everything sensitive).
  • "public" — world-readable via /api/dev/public-kv/<tid>/<tail>. Map tail must start with public:. Never put PII in a public map.
writers/readers restrict your contracts — including ones you deploy yourself — not you. As the map’s owner you can always write its entries directly via the control plane (tenant.executeControl("map-entry-set", …)), even on a writers: { only: [contractId] } map, or add a contract to writers via tenant.maps.update if you’d rather it write directly — that’s how seeding the API key works. A contract-only map is not tamper-proof against its owner; see Storage Namespaces → Access model.