Files
sonr/docs/reference/queries/query-dwn-single-vault.mdx
T

88 lines
1.9 KiB
Plaintext
Raw Normal View History

2025-10-03 14:45:52 -04:00
---
title: Query Vault Details
description: Get comprehensive information about a secure vault instance
2026-09-02 16:53:38 -04:00
seo:
title: "DWN Vault Information"
2025-10-03 14:45:52 -04:00
---
2026-09-02 16:53:38 -04:00
:::info
Vaults provide hardware-backed secure key management through WebAssembly enclaves.
:::
2025-10-03 14:45:52 -04:00
## Vault Components
### Core Information
- **vaultId**: Unique identifier
- **owner**: DID or address of owner
- **publicKey**: Public key for verification
- **createdAt**: Creation timestamp
- **lastRefreshed**: Last key rotation
### Enclave Data
- **enclaveId**: WASM enclave identifier
- **version**: Enclave version number
- **privateData**: Encrypted key material
### Security Metadata
- **encryptionMetadata**: Consensus encryption details
- **keyVersion**: Current key version
- **validatorSet**: Participating validators
## Vault Health Check
2026-09-02 16:53:38 -04:00
:::tip
Monitor vault refresh intervals to ensure keys are rotated on schedule.
:::
2025-10-03 14:45:52 -04:00
### Health Indicators
```javascript
// Check if refresh is due
const refreshDue =
(currentBlock - lastRefreshed) > minVaultRefreshInterval;
// Check key age
const keyAge =
(currentTime - lastRefreshed) / (24 * 60 * 60);
const needsRotation = keyAge > keyRotationDays;
```
## Security Features
### WebAssembly Isolation
- Sandboxed execution environment
- No direct memory access
- Deterministic operations
### Hardware Security
- TPM integration when available
- Secure enclave support
- Hardware key storage
2026-09-02 16:53:38 -04:00
:::warning
Never expose or log vault private data. It's encrypted for a reason.
:::
2025-10-03 14:45:52 -04:00
## Vault Operations
### Key Rotation Status
```bash
# Check rotation schedule
snrd query dwn vault vault_alice_123
# Compare with module params
snrd query dwn params
```
### Export/Import
```bash
# Export vault to IPFS (encrypted)
snrd tx dwn vault-export vault_alice_123
# Import from IPFS backup
snrd tx dwn vault-import <ipfs_cid>
```
2026-09-02 16:53:38 -04:00
:::note
Vault queries return public metadata only. Private keys remain encrypted in the enclave.
:::