submitProof
Create a proof for a version of the database and pin it to the blockchain
Definition
The submitProof command submits a proof to the blockchain for the specified version and will return a receipt.
The submitProof command has the following form:
{
"submitProof" : <number>,
"collections": <array>,
"filter":<document>,
"anchorType":<ETH|ETH_MAINNET|BTC|BTC_MAINNET|HEDERA|HEDERA_MAINNET|CHP>
}
The command accepts the following arguments:
Field | Type | Mandatory | Description |
---|---|---|---|
submitProof | number | yes | The version number to be proved. |
collections | array | no | An array of collection names as strings . If omitted then all collections are proven. |
filter | document | no | A MongoDB-compatible filter that selects the specific documents within a collection that will be proved |
anchorType | string | no | Determines the blockchain that will be used to anchor the proof. Default is ETH_MAINNET |
nChecks | number | no | Determines the number of times ProvenDB will recalculate the proof hash. These sanity checks protect against any inconsistencies generated by the underlying MongoDB database |
Anchor Types
We currently support the following anchor types:
Anchor Type | Description |
---|---|
ETH | Post proof to the Ethereum Testnet |
ETH_MAINNET | Post proof to the Etheruem Mainnet |
BTC | Post proof to the Bitcoin Testnet |
BTC_MAINNET | Post proof to the Bitcoin Mainnet |
HEDERA | Post proof to the Hedera Testnet |
HEDERA_MAINNET | Post proof to the Hedera Mainnet |
CHP | Post proof to the legacy Chainpoint network (not recommended) |
Output
The returned document contains a subset of the following fields:
Field | Type | Description |
---|---|---|
ok | number | status of the command. |
version | number | The version the proof was submitted for. |
dateTime | date | The date of the request. |
hash | string | The hash value for the version. |
proofId | string | The unique proof identifier in Chainpoint format. |
status | string | The status of the request (will initially be Pending). |
Example
The following command will submit a proof for all collections in version 10100:
> db.runCommand({submitProof:10100})
{
"ok" : 1,
"version" : NumberLong(10100),
"dateTime" : ISODate("2019-02-22T06:41:29Z"),
"hash" : "873954bcbb302192b77212b5e4ba492621b249a14b459a76bdfbf50cde501805",
"proofId" : "e2626d60-366c-11e9-b4b3-017096a8589e",
"status" : "Pending"
}
In the following example, we submit a proof for the collections accounts and auditLog only:
> db.runCommand({submitProof:5104,collections:['accounts','auditLog']})
{
"ok" : 1,
"version" : NumberLong(5104),
"dateTime" : ISODate("2019-05-27T06:16:13Z"),
"hash" : "f891a5271d51dd39b6c32038e70dc0e80d506d672f58384ada4129e4e56a6662",
"proofId" : "ed7d2ae0-8046-11e9-a57b-01b1df67102a",
"status" : "Pending"
}```
# Notes
See the concepts manual [Concepts](doc:concepts) for details about provenDB proofs. In short, a provenDB proof is a hash of the logical documents which make up a database version which is anchored to the blockchain.
Updated over 3 years ago
What’s Next