Skip to main content
Submit FHE-encrypted data to the content-addressable store.

Request

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "submitFheData",
  "params": {
    "data": "<base64-encoded-ciphertext>",
    "type": "u8"
  }
}

Parameters

ParameterTypeDescription
datastringBase64-encoded ciphertext
typestringType: “u8”, “u32”, or “u64”
userRecoveryobjectOptional user recovery data

User Recovery (Optional)

{
  "userRecovery": {
    "ciphertext": "<base64>",
    "nonce": "<base64>"
  }
}

Response

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "hash": "abc123..."
  }
}

Result

FieldTypeDescription
hashstringHex-encoded SHA256 hash

Errors

CodeMessage
-32000Invalid ciphertext
-32001Storage error

Example

const response = await fetch('http://localhost:8899', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    jsonrpc: '2.0',
    id: 1,
    method: 'submitFheData',
    params: {
      data: base64Ciphertext,
      type: 'u8'
    }
  })
});

const { result } = await response.json();
console.log('Hash:', result.hash);