EverstoneBTC

Attorney API Documentation

Use the EverstoneBTC Timestamp API to securely anchor document hashes to the Bitcoin blockchain, providing immutable proof of existence.

Authentication

All API requests require an API key for authentication. Include your key in the Authorization header as a Bearer token.

Authorization: Bearer <your-api-key>

Admin operations (like creating API keys) require an additional header with an admin secret.

x-admin-secret: <your-admin-secret>

Endpoints

Create Timestamp Request

POST /api/attorney/timestamp

Submit a document hash to be anchored to the Bitcoin blockchain.

Request Body

{
  "documentHash": "string", // SHA-256 hash of the document (hex format)
  "label": "string" // Optional label for reference
}

Response (201 Created)

{
  "id": "string", // Unique identifier for the request
  "documentHash": "string",
  "status": "PENDING", // Initial status
  "createdAt": "ISODateString"
}

Example (curl)

curl -X POST   https://everstonebtc.com/api/attorney/timestamp   -H "Authorization: Bearer &lt;your-api-key&gt;"   -H "Content-Type: application/json"   -d '{"documentHash": "a948904f2f0f479b8f8197694b30184b0d2ed1c1cd2a1ec0fb85d299a192a447", "label": "Contract Q1"}'

Get Timestamp Request

GET /api/attorney/timestamp/{id}

Retrieve the status and details of a specific timestamp request.

Response (200 OK)

{
  "id": "string",
  "documentHash": "string",
  "label": "string|null",
  "txid": "string|null", // Bitcoin transaction ID once anchored
  "blockHeight": "number|null", // Block height once anchored
  "status": "PENDING|ANCHORED",
  "createdAt": "ISODateString",
  "updatedAt": "ISODateString"
}

Get Timestamp Proof

GET /api/attorney/timestamp/{id}/proof

Retrieve a proof object for a timestamp request that has been anchored.

Response (200 OK)

{
  "documentHash": "string",
  "txid": "string",
  "blockHeight": "number",
  "anchoredAt": "ISODateString",
  "bitcoinExplorerUrl": "string" // Link to view transaction on mempool.space
}

Create API Key (Admin)

POST /api/attorney/keys

Generate a new API key for timestamp requests. Requires admin secret.

Request Body

{
  "name": "string" // Descriptive name for the key
}

Response (201 Created)

{
  "id": "string",
  "name": "string",
  "key": "string", // Plaintext API key (only shown once during creation)
  "createdAt": "ISODateString"
}

List API Keys (Admin)

GET /api/attorney/keys

Retrieve a list of all API keys. Requires admin secret. Does not return plaintext keys.

Response (200 OK)

[
  {
    "id": "string",
    "name": "string",
    "lastUsed": "ISODateString|null",
    "createdAt": "ISODateString",
    "active": "boolean"
  },
  // ... more keys
]

Error Handling

Errors are returned with an appropriate HTTP status code and a JSON object containing an error message.

{
  "error": "string" // Description of the error
}

Common error codes:

  • 400 Bad Request: Invalid input data or parameters.
  • 401 Unauthorized: Missing or invalid API key or admin secret.
  • 403 Forbidden: No access to the requested resource.
  • 404 Not Found: Resource does not exist.
  • 500 Internal Server Error: Unexpected server-side issue.

Need assistance or custom integration? Contact our team.

Back to Attorney Services