---
# System prepended metadata

title: Cloud Wallets Architecture using CosmosDB

---

# Cloud Wallets Architecture using CosmosDB

https://docs.microsoft.com/en-us/azure/cosmos-db/

## Data Scope

Provider Scope = Database
Cloud Wallet Scope = Collection+Partition (partitionKey = cloudWalletId)

Example:

```yaml
Database: https://trinsic.documents.azure.com/
Collections:
  - Wallets: https://trinsic.documents.azure.com/colls/wallets
    - AliceWallet:
      User: did:example:alice
      PartitionKey: Alice
      Documents:
        - Credential1: https://trinsic.documents.azure.com/colls/wallets/docs/cred1
        - Credential2: https://trinsic.documents.azure.com/colls/wallets/docs/cred2

    - BobWallet:
      User: did:example:bob
      PartitionKey: Bob
      Documents:
        - Credential3: https://trinsic.documents.azure.com/colls/wallets/docs/cred3
        - Credential4: https://trinsic.documents.azure.com/colls/wallets/docs/cred4
        
  - Configurations: https://trinsic.documents.azure.com/colls/configs
  - Authorization: https://trinsic.documents.azure.com/colls/auth

```

### Authorization using Resource Tokens

https://docs.microsoft.com/en-us/azure/cosmos-db/secure-access-to-data#resource-tokens-

![](https://docs.microsoft.com/en-us/azure/cosmos-db/media/secure-access-to-data/resourcekeyworkflow.png)
