proveTransaction

open suspend override fun proveTransaction(unprovenTxHex: String): String

Prove an unproven transaction.

Process:

  1. Deserialize binary unproven transaction

  2. Compute zero-knowledge proofs for all proof obligations

  3. Seal Pedersen commitments to PureGeneratorPedersen (Schnorr form)

  4. Serialize proven transaction

Input: Unproven transaction (serialized as SCALE binary)

  • Type: Transaction<Signature, ProofPreimageMarker, Pedersen>

  • Tag: midnight:transaction[v6](signature[v1],proof-preimage,pedersen[v1])

Output: Proven transaction (serialized as SCALE binary)

  • Type: Transaction<Signature, Proof, PureGeneratorPedersen>

  • Tag: midnight:transaction[v6](signature[v1],proof,pedersen-schnorr[v1])

Performance:

  • Simple unshielded transfer: 2-10 seconds (typically fast)

  • Complex shielded transaction: 30 seconds - 5 minutes (can be slow)

  • Server overload: May timeout or return 502-504

Return

Hex-encoded proven transaction (without "0x" prefix)

Parameters

unprovenTxHex

Hex-encoded unproven transaction (without "0x" prefix)

Throws

if network connectivity fails

if HTTP request fails

if request times out (> 5 minutes)

if proof server returns error

if proof generation fails

if response is malformed