Documents API
An EvoBin upload writes a manifest document and one or more media documents. The manifest ID is the public address.
Manifest fields
| Field | Type | Notes |
|---|---|---|
name | string | Original file name |
kind | string | file |
type | string | Broad type |
mimeType | string | application/octet-stream fallback |
fileSize | number | Original bytes |
contentHash | string | SHA-256 hex |
hashAlgorithm | string | sha256 |
hashEncoding | string | hex |
compressionScheme | string | none |
encryptionScheme | string | none |
chunkCount | number | 1–50 (one per media document) |
chunkSizeBytes | number | 20000 |
Media fields
| Field | Type | Notes |
|---|---|---|
parentId | byteArray | 32-byte manifest identifier |
chunkIndex | number | 0–49 |
totalChunks | number | 1–50 |
size | number | Payload size |
totalSize | number | Original file size |
chunkHash | string | SHA-256 hex of this chunk |
hashAlgorithm | string | sha256 |
hashEncoding | string | hex |
payload1 … payload4 | byteArray | Up to 5,120 bytes each |
Document IDs and the nonce
Dash Platform document IDs commit to the identity's contract nonce. The upload path:
- Fetches
getIdentityContractNonce(identityId, dataContractId). - The manifest uses
nonce + 1; media chunkiusesnonce + 2 + i. - Derives each document ID and creates its state transition with that same nonce.
A document built before the nonce is known carries a placeholder ID and is rejected by the network. Refresh and retry if a nonce error appears.
Payload encoding
The media payloads are Uint8Array values, which pshenmic serializes as compact
byteArray fields. A plain JavaScript number array is serialized as one encoded
value per byte and roughly doubles the transition size.
Limits
| Limit | Value |
|---|---|
| Max state transition | 20,480 bytes |
| Max field value | 5,120 bytes |
| Max media-document payload | 20,000 bytes |
| Current UI file limit | 1,000,000 bytes (up to 50 chunks) |
The writer creates one media document per 20 KB chunk (up to 50); the reader reassembles them.