# Querying¶

Assets and contracts deployed on the ledger be queried for specific information regarding their state, history of all previous states, and all participants involved in their history.

## Integrating Private State¶

The private state file contains values to use with Storage Commitment Scheme.

To check whether a private state file matches the locals in a contract:

$uplink scripts compile contracts/locals.s -s contracts/locals_state.json  To commit a private state file to the local db for a specific contract and account: $ uplink data commit contracts/locals_state.json <contract_addr> <account_addr>


Private state allows two parties to load some private values shared between them into a contract. These values can then have certain operations applied to them by a contract. After a contract is finalized, the creator of the contract can then reveal a parameter of the commitment process, which allows other parties to verify there initial values were the same.

## Querying Ledger Database¶

The uplink command line exposes two ways to get data:

Get a contract, asset, or account by address

$uplink data get <address>  Dumping all contracts, assets, accounts, and blocks $ uplink data list


## Exporting to XML¶

Exporting to XML:

\$ uplink data export backup.xml

<?xml version="1.0" encoding="UTF-8"?>
<blocks>
<block index="0">
<signatures>