Page cover

Context Structure

Context Representation

The context in the Fair Math Computer is a JSON-like object that organizes information into the following sections:

  1. fhe Contains cryptographic data, including:

    • Public keys.

    • Rotation keys.

    • Cryptographic contexts.

  2. args Represents command-line-style arguments provided to the application during execution.

  3. vars Describes all variables used in the process. Each variable entry includes:

    • id: Unique identifier for the variable.

    • basetype: The base type of the variable (e.g., i32).

    • is_secret: A boolean indicating whether the variable is encrypted.

    • is_array: A boolean indicating whether the variable is an array.

    • storage: Specifies where the variable's value is stored (e.g., local or ipfs).

    • value: The current value of the variable, either directly or as a reference (e.g., an IPFS hash).

Example Context File

Below is an example of context file:

{
    "vars": {
        "%arg0": {
            "basetype": "",
            "is_array": false,
            "is_secret": false,
            "storage": "ipfs",
            "value": "ipfs.QmXR5FDSupU6ZKxxkU95WcywhmAvykLZbNEqtcu2P3M43a"
        },
        "%arg2": {
            "basetype": "i32",
            "is_array": true,
            "is_secret": false,
            "storage": "ipfs",
            "value": "ipfs.QmfZhqPFDZmyK4rAxwDH5FTHeQGrJjDFbRJ1WDzW4qpF1P"
        },
        "%mul_key": {
            "basetype": "CKKSMulKey",
            "is_array": false,
            "is_secret": false,
            "storage": "ipfs",
            "value": "ipfs.QmT4xPQnAkZXR6PGDySaVZ4kBPbHdkVi2TqZgUZdREhfa7"
        },
        "pk": {
            "basetype": "CKKSPublicKey",
            "is_array": false,
            "is_secret": false,
            "storage": "ipfs",
            "value": "ipfs.QmeA4jDooaoR4G2amHtnQKGpRD4eEdfVZSLjARDFF5HJq4"
        }
    }
}

This structure allows the system to organize and manage cryptographic and process-related information efficiently, ensuring seamless application execution.

Last updated