Full Service API
  • Welcome!
  • Overview
  • API Endpoints
    • v2
      • Account
        • Account
          • Create Account
          • Import Account
          • Import Account Legacy
          • Get Accounts
          • Get Account Status
          • Get Balance
          • Update Account Name
          • Set Require Spend Subaddress
          • Remove Account
        • Account Secrets
          • Export Account Secrets
        • Address
          • Assign Address For Account
          • Get Address For Account
          • Get Addresses
          • Get Address Status
          • Verify Address
        • View Only Account
          • Import View Only Account
          • Create View Only Account Import Request
          • Create View Only Account Sync Request
          • Sync View Only Account
      • Transaction
        • Transaction
          • Build Transaction
          • Submit Transaction
          • Build And Submit Transaction
          • Build Burn Transaction
          • Build Unsigned Transaction
          • Build Unsigned Burn Transaction
        • Transaction Output TXO
          • Memo
            • Validate Sender Memo
          • Get TXO
          • Get TXOs
          • Get MobileCoin Protocol TXO
          • Get TXO Membership Proofs
          • Sample Mixins
          • Get TXO Block Index
        • Confirmation
          • Get Confirmations
          • Validate Confirmations
        • Receiver Receipt
          • Check Receiver Receipt Status
          • Create Receiver Receipts
        • Transaction Log
          • Get Transaction Log
          • Get Transaction Logs
          • Get MobileCoin Protocol Transaction
        • Payment Request
          • Create Payment Request
          • Check B58 Type
      • Block
        • Get Block
        • Get Blocks
        • Get Recent Blocks
        • Search Ledger
      • Network Status
        • Get Network Status
      • Wallet Status
        • Get Wallet Status
      • Version
        • Get Version
    • v1 (deprecated)
      • Account
        • Account
          • Create Account
          • Import Account
          • Import Account Legacy
          • Get Account
          • Get All Accounts
          • Get Account Status
          • Update Account Name
          • Remove Account
        • Account Secrets
          • Export Account Secrets
        • Address
          • Assign Address For Account
          • Get Addresses For Account
          • Verify Address
        • Balance
          • Get Balance For Account
          • Get Balance For Address
      • Transaction
        • Transaction
          • Build Transaction
          • Submit Transaction
          • Build And Submit Transaction
          • Build Split Txo Transaction
        • Transaction Output TXO
          • Get TXO
          • Get MobileCoin Protocol TXO
          • Get TXOs For Account
          • Get TXOs For View Only Account
          • Get All TXOs For Address
        • Confirmation
          • Get Confirmations
          • Validate Confirmations
        • Receiver Receipt
          • Check Receiver Receipt Status
          • Create Receiver Receipts
        • Transaction Log
          • Get Transaction Object
          • Get Transaction Log
          • Get Transaction Logs For Account
          • Get All Transaction Logs For Block
          • Get All Transaction Logs Ordered By Block
          • Get MobileCoin Protocol Transaction
        • Payment Request
          • Create Payment Request
          • Check B58 Type
      • Gift Code
        • Build Gift Code
        • Submit Gift Code
        • Get Gift Code
        • Get All Gift Codes
        • Check Gift Code Status
        • Claim Gift Code
        • Remove Gift Code
      • Block
        • Get Block
      • Network Status
        • Get Network Status
      • Wallet Status
        • Get Wallet Status
      • Version
        • Get Version
    • Signer Service
      • Create Account
      • Get Account
      • Sign Transaction
      • Sync Txos
  • Usage
    • Getting Started
      • Running Full Service
      • Create an Account
      • Receiving MobileCoin
      • Sending MobileCoin
      • Next Steps
    • Full Service Network Diagram
    • Supported Token Metadata
    • Database Usage
    • API Key
    • View Only Account
      • Signer
      • Signer Service
    • No Wallet Mode
    • Validator Service
      • Running
      • Running With TLS
    • Mirror Service
      • Running
      • Running With TLS
      • Running With Encryption
    • Logging
      • Text Logs (syslog style)
      • Crash Reports
    • T3
    • Sender Memos
  • FAQ
    • Resolving Disputes
    • How do I check if Full-Service is operational?
    • Where are logs stored?
    • How do I speed up account import?
    • What is the precision of MOB?
  • Glossary
    • Account
    • Block
    • Blockchain
    • Consensus Protocol
    • Fog
    • Full Service
    • Key Image
    • Ledger
    • MOB
    • Public Address
    • Secure Enclave
    • Subaddress
    • Transaction
    • Transaction Proposal
    • Validator Node
    • Validator Service
Powered by GitBook
On this page
  • Database Encryption
  • Setting and changing the password
  • Encrypting an unencrypted database

Was this helpful?

  1. Usage

Database Usage

The MobileCoin wallet service stores its data in two places:

  • The first database is the ledger database, which is an append-only data store, recording the state of the public ledger. This contains no readable secret information, because all transaction outputs are stored on the ledger in an encrypted format. Its location is specified with the command line option --ledger-db.

  • The second database is the wallet database, which stores the private keys and private transaction information for the accounts in the wallet. It should be encrypted using our password features, or stored on an encrypted partition. Its location is specified with --wallet-db.

Database Encryption

The wallet database can be encrypted using SQLCipher, an open source plugin for encrypting SQLite databases.

Please keep in mind that there is no way to recover the contents of an encrypted database without the password. Always backup your database password and the recovery mnemonic of your accounts in a secure location.

Setting and changing the password

In order to enable encryption, set the password for the database with the environment variable MC_PASSWORD. In order to re-encrypt the database with a new password, also set the environment variable MC_CHANGE_PASSWORD.

To manually set an environment variable without writing it to the shell history, you can do the following:

$ read -rs MC_PASSWORD
$ export MC_PASSWORD

Encrypting an unencrypted database

When migrating an existing plain-text wallet database to the encrypted format, there is a manual process using the SQLCipher command line tool. The following commands open the unencrypted database in sqlcipher, export an encrypted copy of the database, then replace the original database with the encrypted copy.

$ cp wallet.db wallet.db.backup
$ sqlcipher wallet.db
sqlite> ATTACH DATABASE 'encrypted.db' AS encrypted KEY '<your password here>';
sqlite> SELECT sqlcipher_export('encrypted');
sqlite> DETACH DATABASE encrypted;
sqlite> .exit
$ mv encrypted.db wallet.db

Once you have verified that you can access the encrypted database, then you can safely delete the unencrypted backup wallet.db.backup.

PreviousSupported Token MetadataNextAPI Key

Last updated 2 years ago

Was this helpful?

For more information, look at the about this process.

SQLCipher documentation