# Known limitations

What the SDK does not do, or does only within stated bounds, as of this release. Each item is checked against the code
and the tests; the [security model](security-model.md) explains the guarantees around them.

## Phone and keys

1. **Not run on a real phone.** `@umis/wallet-rn` has not run on a physical phone or in a real Expo Go. The secure
   store, the crypto module and the hardware-key module are covered by in-memory stand-ins that keep their limits, and
   by a simulation of the Expo Go start in Node.
2. **Hardware keys where the phone has them.** A development build makes keys in the Secure Enclave (iOS) or in
   StrongBox or the Trusted Execution Environment (Android). It falls back to a software key only when the hardware
   module is not installed, the device has no such hardware, no biometrics are enrolled or the module refuses to make
   the key; any other failure is `CRYPTO_UNAVAILABLE`. Call a key hardware-backed only where its signer reports
   `protection: 'hardware'`. Expo Go always uses software keys.
3. **Biometric confirmation of software keys is the app's.** For a software key, the confirmation is the `authenticate`
   hook that the app supplies; the SDK cannot prove to anyone that the person was asked.
4. **"Readable only while unlocked" is an iOS setting.** The secure store option `WHEN_UNLOCKED_THIS_DEVICE_ONLY` has
   that meaning on iOS only and is not claimed for Android.
5. **About 50 credentials per wallet namespace.** The list of credential ids is one stored value of at most 2 047
   characters, which holds about 50 UUID ids.
6. **Leftovers after a crash.** A crash at the wrong moment while a credential is stored or deleted, or while a hardware
   key is made, can leave unreferenced pieces or a hardware key without its record in the device store. None of them is
   ever read as a credential. Leftover pieces are deleted at the next store or removal of the same id, and an orphan
   hardware key when its alias is read or created again.

## Verification

7. **Signatures are malleable.** ES256 signatures are accepted with low and high S, as WebCrypto and secure hardware
   produce both, so a valid signature can be turned into another valid one. Nothing in the SDK is identified by
   signature bytes.
8. **Replay protection needs one shared store.** Single use holds only when all verifications of a deployment share one
   replay store. The in-memory store holds at most 100 000 ids that have not expired and refuses new ids while it is
   full; it learns the time from the verification calls unless it is given a clock. A store of your own must forget
   expired ids by itself.
9. **Revocation offline is as fresh as the status list.** A checkpoint that cannot refresh its status list sees a
   revocation only once the list it holds is too old: at most 24 hours in the `medium` class and 72 hours at a `low`
   door. The benchmark run confirmed both bounds to the second.
10. **Limits per period are counted per verifier.** Several offline verifiers do not add up the amounts they accepted.
11. **OpenID4VP is a strict subset.** Only `openid4vp://` requests by value of at most 16 384 characters, the
    `dc+sd-jwt` format, claim paths of one UMIS claim, unsigned requests answered by `direct_post`, and no transaction
    data. Valid requests outside the subset (by reference, signed, `direct_post.jwt`, other client identifier schemes)
    are refused.
12. **Bluetooth is exercised over an in-memory link only.** `@umis/transports` frames, chunks and sessions run over
    `createMemoryTransportPair`; a real BLE link is an adapter the app supplies. A refused request looks to the asker
    like a lost link, because the protocol has no refusal frame: the asker's `requestOverTransport` fails with
    `NETWORK` (`no answer within <timeoutMs> ms`) once its timeout is over, 10 seconds unless `timeoutMs` says otherwise.

13. **A hand-built delegation keeps the depth it is given.** `issueDelegated` copies the parent's `max_depth` into the
    child, but `issueSdJwtVc` cannot check a delegation claim that an integrator assembles by hand against the parent's
    `max_depth`, because the parent summary does not carry it; the issuer keeps whatever depth such a claim states.
    Taking the parent's `max_depth` as an input of `issueSdJwtVc` is a contract change planned for `0.1.0-alpha.2`;
    until then build delegations with `issueDelegated`, which applies the parent's bound.

## Relay

14. **The emulator asks for credentials on `Switch.Set` only.** `Switch.GetStatus` and `Shelly.GetDeviceInfo` answer
    without a signature or digest, so that the status page can poll; a real Shelly with authentication on asks for the
    digest on those calls too. The emulator's status carries two members a real device does not have, `umis_now` and
    `umis_last`.
15. **At most eight relay keys per command.** The gateway tries at most eight trusted keys for one relay command, the
    key its `kid` names first.

## Benchmarks

16. **One machine, one run.** The latency figures come from one machine in one run (30 repeats of 1 000 presentations).
    WebCrypto signatures are random, so the seed does not reproduce a WebCrypto run bit for bit.
17. **Three rows are not single decisions.** The `gateway` row leaves out connection set-up and talks to a loopback
    emulator, the `oid4vp` row times only the provider's decision, and the `mutual` row times both decisions of the
    exchange together.
18. **P95 and its interval measure different things.** The printed P95 is the percentile of all measured decisions,
    while the 95 % interval belongs to the mean of the P95 of each repeat, so the P95 can lie slightly outside its own
    interval.
