vlayer docs
REST API

POST /debug/journal-decode-helper

Journal decode helper for Solidity integration (v2)

POST /api/v2.0/debug/evm/journal-decode-helper

Development Tool Only

This endpoint is for debugging and development purposes only. It provides helper information for decoding journal data in Solidity but does NOT generate verifiable ZK proofs. Use /compress-web-proof to obtain on-chain verifiable ZK proofs for production.

Returns helper data to decode journalDataAbi from the ZK Prover's /compress-web-proof response.

Authentication

Requests require header:

  • Authorization: Bearer <api-key>: Your API key

Request Body

Same as /compress-web-proof — pass the Web Proof presentation and optional extraction config. The endpoint performs a dry run (verification + extraction) and derives decode helper information.

Response Body

Success

{
  "apiVersion": "v2.0",
  "success": true,
  "data": {
    "journalTypes": ["bytes32", "string", "string", "uint256", "bytes32", "string", "string"],
    "journalValues": ["0xa7e6...", "\"GET\"", "\"https://...\"", "1234567890", "0xe27c...", "\"3500.50\"", "\"ETHUSDC\""],
    "solidityCodeSnippet": "(bytes32 notaryKeyFingerprint, ...) = abi.decode(journalData, (bytes32, ...))",
    "journalDataAbi": "0xa7e62d7f..."
  }
}
  • apiVersion: API version string
  • success: true
  • data.journalTypes: Array of Solidity type names
  • data.journalValues: Array of formatted values for display/debugging
  • data.solidityCodeSnippet: Ready-to-use Solidity abi.decode snippet
  • data.journalDataAbi: Hex-encoded ABI data (same format as returned by /compress-web-proof)

Error

{
  "apiVersion": "v2.0",
  "success": false,
  "error": {
    "code": "INVALID_REQUEST",
    "message": "..."
  }
}
  • error.code: Machine-readable error code
  • error.message: Human-readable description

Example

curl -X POST https://zk-prover.vlayer.xyz/api/v2.0/debug/evm/journal-decode-helper \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <your-api-key>" \
  -d '{
    "presentation": {
      "data": "014000000000000000ee32d73a6a70e406a31ffa683416b7376...",
      "version": "0.1.0-alpha.12",
      "meta": {
        "notaryUrl": "https://notary.vlayer.xyz/v0.1.0-alpha.12"
      }
    },
    "extraction": {
      "response.body": {
        "jmespath": ["price", "symbol"]
      }
    }
  }'
const response = await fetch('https://zk-prover.vlayer.xyz/api/v2.0/debug/evm/journal-decode-helper', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer <your-api-key>'
  },
  body: JSON.stringify({
    presentation: {
      data: "014000000000000000ee32d73a6a70e406a31ffa683416b7376...",
      version: "0.1.0-alpha.12",
      meta: {
        notaryUrl: "https://notary.vlayer.xyz/v0.1.0-alpha.12"
      }
    },
    extraction: {
      "response.body": {
        jmespath: ["price", "symbol"]
      }
    }
  })
});

const result = await response.json();
console.log(result.data.solidityCodeSnippet);

Response:

{
  "apiVersion": "v2.0",
  "success": true,
  "data": {
    "journalTypes": [
      "bytes32",
      "string",
      "string",
      "uint256",
      "bytes32",
      "string",
      "string"
    ],
    "journalValues": [
      "0xa7e62d7f17aa7a22c26bdb93b7ce9400e826ffb2c6f54e54d2ded015677499af",
      "\"GET\"",
      "\"https://data-api.binance.vision/api/v3/ticker/price?symbol=ETHUSDC\"",
      "1234567890",
      "0xe27c1b124a855f1f5c25b432559aaf91ce2bf13f95f81acfd97ab8e2c846b767",
      "\"3500.50\"",
      "\"ETHUSDC\""
    ],
    "solidityCodeSnippet": "(bytes32 notaryKeyFingerprint, string memory method, string memory url, uint256 tlsTimestamp, bytes32 extractionHash, string memory extractedValue0, string memory extractedValue1) = abi.decode(journalData, (bytes32, string, string, uint256, bytes32, string, string))",
    "journalDataAbi": "0xa7e62d7f17aa7a22c26bdb93b7ce9400e826ffb2c6f54e54d2ded015677499af..."
  }
}