Aleo

Aleo is a blockchain platform built around privacy-preserving smart contracts. Unlike traditional blockchains where transaction data is publicly visible, Aleo uses zero-knowledge proofs (zk-SNARKs) to let users prove the correctness of a transaction — such as a token transfer or a contract execution — without revealing the underlying inputs.

Every Aleo transaction is accompanied by one of these proofs. Because generating a proof is a complex operation, Aleo is designed to allow delegation: a user can authorize a transaction and hand off the heavy proof-generation work to a third-party prover, without giving that prover access to their private key.

This delegation is what shapes the signing interface described below. Signing an Aleo transaction is not just a matter of producing a signature over a message — the signer must also compute certain values (such as input identifiers and a transition view key) that are needed by the prover to construct a valid proof.

Signing Interface

Two signing methods are supported: account signatures and delegated signing. Both accept a JSON request body and return a JSON response.

For full cryptographic detail, refer to the Aleo signature specification.


Input format

Both signing methods share the same top-level input structure:

FieldTypeRequiredDescription
inputsarrayYesOne or more inputs to sign (see below)
functionIdstringDelegated onlyField element identifying the function being called
isRootbooleanDelegated onlyWhether this is a root-level call
checksumstringDelegated only(*)Integrity checksum of the function. Omitted for older programs.

(*) Present only for programs that include a checksum.

Input types

Each entry in inputs has a type field and a data array of field elements (as decimal strings).

TypeUsed inDescription
accountAccount sigArbitrary message fields for account-level signing
publicDelegatedPublicly visible function input
privateDelegatedEncrypted function input
recordDelegatedA record commitment being consumed
externalRecordDelegatedA record from an external program
dynamicRecordDelegatedA dynamically referenced record

Examples

Account signature request

{
  "inputs": [
    {
      "type": "account",
      "data": [
        "6716502009016430053183507170699594817265084671791777241413633239014382669047",
        "1099471864310681484047468615352474858081227942590554598086745066318936376057"
      ]
    }
  ]
}

Delegated signing request

{
  "functionId": "7997765759116436245054600309458180601753471573319679234621276897246672782660",
  "isRoot": true,
  "checksum": "1503530553220993152536984095177360228202084361422343390783285383306871595686",
  "inputs": [
    {
      "type": "record",
      "data": [
        "3620054965614225011843835598412969685728959723873203421423497665637723824061",
        "4723421622337407625451130429846704556698341853293634966801114008038334673712"
      ]
    },
    {
      "type": "private",
      "data": [
        "2854583002587711767714127780974314920905498857787333885876654043294119228416",
        "166688728"
      ]
    },
    {
      "type": "private",
      "data": [
        "1237940039285380281610076208"
      ]
    }
  ]
}

Output format

All field element values are returned as decimal strings.

FieldTypePresent inDescription
signaturestringBothBech32m-encoded Schnorr signature (sign1…)
tvkstringDelegated onlyTransition view key (field element)
tcmstringDelegated onlyTransition commitment (field element)
gammasarray of stringsDelegated onlyOne gamma value per record-type input, in order

Account signature response

{
  "signature": "sign1g03t2q98yh7kets29s05en3ljp90umlhf5kwzhecsaalcxpffvqmnafyspdnmu42qjgj905f964yxl2ph7mz70dqy503xxyjj4rwxqur22qjwn4zc0pzv87twjygsz9m7ekljmuw4jpzf68rwuq99r0tp735vs6220q7tp60nr7llkwstcvu49wdhydx5x2s3sftjskzawhqvh8arjf"
}

Delegated signing response

{
  "signature": "sign1g03t2q98yh7kets29s05en3ljp90umlhf5kwzhecsaalcxpffvqmnafyspdnmu42qjgj905f964yxl2ph7mz70dqy503xxyjj4rwxqur22qjwn4zc0pzv87twjygsz9m7ekljmuw4jpzf68rwuq99r0tp735vs6220q7tp60nr7llkwstcvu49wdhydx5x2s3sftjskzawhqvh8arjf",
  "tvk": "6839744283125714768219049408772295603189719087890464618622056790088127041542",
  "tcm": "36661113237169170635146585844811003819221318715282919854177900780199067452",
  "gammas": [
    "4875506682083978504504607329729976086652196269888800393640799801065716748965"
  ]
}

The gammas array contains one entry per recordtype input, in the same order they appear in inputs. In the example above there is one record input, so gammas has one element.