Docs Core concepts
Security model
How the SDK validates origins and sources, limits waiting time and keeps keys and stored data safe.
Messages from the host
- Origin allow-listing.
PostMessageTransportaccepts messages only from the configuredhostOrigin(a single origin or a list of origins). Anything else is dropped before the payload is read. - Source check. Inside an iframe, messages must also come from
window.parent. Disable it withcheckIframeSource: falseonly in tests. - Targeted sends. Outgoing messages use the configured origin as
targetOrigin. With several origins, replies go to the origin of the last accepted message; nothing is ever posted outside the list. - No wildcard in production.
hostOrigin: '*'throws aHydraSecurityErrorunlessenv(orprocess.env.NODE_ENV) isdevelopmentortest.
Keys and signing
- No key access. In embedded mode all signing happens in the host's wallet. The app never sees private keys.
Availability
- Request timeouts. Four tiers (handshake 3 s, ping 3 s, query 15 s, signing 120 s) keep a silent host from hanging the app. Each can be overridden.
- Safe storage failure.
HostStorageRelayAdapterthrowsERR_STORAGE_UNAVAILABLEinstead of falling back to a storage where data could leak or be wiped.
Signed data
signData returns a CIP-8 signature, but the SDK never verifies it. Verification belongs to your backend.Next steps
- Transports for the origin options.
