Guides
Dash CoreDash PlatformDash.orgDash User DocsLog In
These docs are for v0.20.0. Click to read the latest docs for v0.25-redirect.


# Document Submission

Documents are sent to the platform by submitting the them in a document batch state transition consisting of:

FieldTypeDescription
protocolVersionintegerThe platform protocol version (currently `0`)
typeintegerState transition type (`1` for document batch)
ownerIdarray[Identity](🔗) submitting the document(s) (32 bytes)
transitionsarray of transition objectsDocument `create`, `replace`, or `delete` transitions (up to 10 objects)
signaturePublicKeyIdnumberThe `id` of the [identity public key](🔗) that signed the state transition
signaturearraySignature of state transition data (65 bytes)

Each document batch state transition must comply with this JSON-Schema definition established in [js-dpp](🔗):



## Document Base Transition

All document transitions in a document batch state transition are built on the base schema and include the following fields:

FieldTypeDescription
$idarrayThe [document ID](🔗) (32 bytes)
$typestringName of a document type found in the data contract associated with the `dataContractId`
$actionarray of integers[Action](🔗) the platform should take for the associated document
$dataContractIdarrayData contract ID [generated](🔗) from the data contract's `ownerId` and `entropy` (32 bytes)

Each document transition must comply with the document transition [base schema](🔗):



### Document id

The document `$id` is created by hashing the document's `dataContractId`, `ownerId`, `type`, and `entropy` as shown [here](🔗).



### Document Transition Action

ActionNameDescription
0CreateCreate a new document with the provided data
1ReplaceReplace an existing document with the provided data
2`RESERVED`Unused action
3DeleteDelete the referenced document

## Document Create Transition

The document create transition extends the base schema to include the following additional fields:

FieldTypeDescriptionColumn Title
$entropyarrayEntropy used in creating the [document ID](🔗). Generated as [shown here](🔗). (32 bytes)
$createdAtinteger(Optional)Time (in milliseconds) the document was created
$updatedAtinteger(Optional)Time (in milliseconds) the document was last updated

Each document create transition must comply with this JSON-Schema definition established in [js-dpp](🔗) (in addition to the document transition [base schema](🔗)) that is required for all document transitions):



**Note:** The document create transition must also include all required properties of the document as defined in the data contract.

The following example document create transition and subsequent table demonstrate how the document transition base, document create transition, and data contract document definitions are assembled into a complete transition for inclusion in a [state transition](🔗):


FieldRequired By
$actionDocument [base transition](🔗)
$dataContractIdDocument [base transition](🔗)
$idDocument [base transition](🔗)
$typeDocument [base transition](🔗)
$entropyDocument [create transition](🔗)
messageData Contract (the `message` document defined in the referenced data contract -`5wpZAEWndYcTeuwZpkmSa8s49cHXU5q2DhdibesxFSu8`)

## Document Replace Transition

The document replace transition extends the base schema to include the following additional fields:

FieldTypeDescriptionColumn Title
$revisionintegerDocument revision (=> 1)
$updatedAtinteger(Optional)Time (in milliseconds) the document was last updated

Each document replace transition must comply with this JSON-Schema definition established in [js-dpp](🔗) (in addition to the document transition [base schema](🔗)) that is required for all document transitions):



**Note:** The document create transition must also include all required properties of the document as defined in the data contract.

The following example document create transition and subsequent table demonstrate how the document transition base, document create transition, and data contract document definitions are assembled into a complete transition for inclusion in a [state transition](🔗):


FieldRequired By
$actionDocument [base transition](🔗)
$dataContractIdDocument [base transition](🔗)
$idDocument [base transition](🔗)
$typeDocument [base transition](🔗)
$revisionDocument revision
messageData Contract (the `message` document defined in the referenced data contract -`5wpZAEWndYcTeuwZpkmSa8s49cHXU5q2DhdibesxFSu8`)

## Document Delete Transition

The document delete transition only requires the fields found in the [base document transition](🔗).

## Example Document Batch State Transition



# Document Object

The document object represents the data provided by the platform in response to a query. Responses consist of an array of these objects containing the following fields as defined in the JavaScript reference client ([js-dpp](🔗)):

PropertyTypeRequiredDescription
protocolVersionintegerYesThe platform protocol version (currently `0`)
$idarrayYesThe [document ID](🔗) (32 bytes)
$typestringYesDocument type defined in the referenced contract
$revisionintegerNoDocument revision (=>1)
$dataContractIdarrayYesData contract ID [generated](🔗) from the data contract's `ownerId` and `entropy` (32 bytes)
$ownerIdarrayYes[Identity](🔗) of the user submitting the document (32 bytes)
$createdAtinteger(Optional)Time (in milliseconds) the document was created
$updatedAtinteger(Optional)Time (in milliseconds) the document was last updated

Each document object must comply with this JSON-Schema definition established in [js-dpp](🔗):



## Example Document Object