# Invoice Transcript

### **Overview**

This transcript serves as the official record of the computation’s cost and resource usage across the platform. Whether you are running Truebit Functions or API Tasks, it provides a verifiable breakdown of the fees and execution steps, ensuring that billing is as transparent as the computation itself.

### **Description**

<details>

<summary>Function Invoice Transcript</summary>

{% code fullWidth="true" expandable="true" %}

```json
{
    "executionId": "e7e444fa-96c5-45c9-9c65-dd9f8edfdafd",
    "taskId": "api_142456019dd5b351e82b6f679bf7b36af9e9a0fd523f30844a2c479d908b913e",
    "taskCreated_timeStamp": 1762441264136,
    "invoiceId": "4750340717624412641106",
    "byteGasPrice": 0.0002,
    "accounting_signature": {
        "v": 27,
        "r": "2cb73383f446dbaa2de9bfeec669bf159a72b7662ec15df9b391dcdf1267436b",
        "s": "3e245d19087c9c5c448fdf9a26d0a219c98eae8d9fb0fa360a63a94c252443e0"
    },
    "lineItem": [
        {
            "operation": "charge",
            "account": "0x************************************C8F7",
            "totalTransferredBytes": {
                "request": 0,
                "response": 0
            }
        }
    ]
}

```

{% endcode %}

</details>

<details>

<summary>API Invoice Transcript</summary>

{% code expandable="true" %}

```json
{
    "executionId": "e7e444fa-96c5-45c9-9c65-dd9f8edfdafd",
    "taskId": "api_142456019dd5b351e82b6f679bf7b36af9e9a0fd523f30844a2c479d908b913e",
    "taskCreated_timeStamp": 1762441264136,
    "invoiceId": "4750340717624412641106",
    "byteGasPrice": 0.0002,
    "accounting_signature": {
        "v": 27,
        "r": "2cb73383f446dbaa2de9bfeec669bf159a72b7662ec15df9b391dcdf1267436b",
        "s": "3e245d19087c9c5c448fdf9a26d0a219c98eae8d9fb0fa360a63a94c252443e0"
    },
    "lineItem": [
        {
            "operation": "charge",
            "account": "0x************************************C8F7",
            "totalTransferredBytes": {
                "request": 0,
                "response": 0
            }
        }
    ]
}
```

{% endcode %}

</details>

### Execution Lifecycle Messages

<details>

<summary>root message</summary>

The `root message` serves as the initial entry in the Function Invoice transcript. It includes critical details like the **execution ID**, **taskId**, and a list of **liteItems**, which capture all recorded operations on the invoice, such as "charge," "pay," and "penalty."

<table><thead><tr><th width="208.2890625">Property</th><th width="331.3333333333333">Description</th><th>Values</th></tr></thead><tbody><tr><td>executionId</td><td>Current execution ID</td><td>Text</td></tr><tr><td>taskId</td><td>Executed Function task</td><td>Text</td></tr><tr><td>taskCreated_timeStamp</td><td>Timestamp for task creation message</td><td>unixTimestamp</td></tr><tr><td>invoiceId</td><td>InvoiceId</td><td>Number</td></tr><tr><td>stepGasPrice / byteGasPrice</td><td><ul><li><strong>stepGasPrice</strong>: Amount of GAS paid for each execution step</li><li><strong>byteGasPrice</strong>: Amount of GAS paid for each transferred byte.</li></ul></td><td>Number</td></tr><tr><td>accounting_signature</td><td>Truebit Verify Hub</td><td>v: Text<br>r: Text<br>s: Text</td></tr><tr><td>lineItem</td><td>List of all operations generated during the task execution.</td><td>Array</td></tr></tbody></table>

</details>

***

<details>

<summary>lineItem Function Task</summary>

For each participant in the Task execution, there is a `lineItem` representing an action applied to an "address".

* **Charge**: The Task requester is billed for the execution request.
* **Pay**: The Truebit Verify node is rewarded for executing and submitting the Task result.
* **Penalty**: The Truebit Verify node is penalized for submitting an incorrect response.

<table><thead><tr><th width="195.58984375">Property</th><th width="264.2005208333333">Description</th><th>Values</th></tr></thead><tbody><tr><td>operation</td><td>Operation Type</td><td>["charge","pay","penalty"]</td></tr><tr><td>account</td><td><ul><li>If messageType is "charge", you will see the Task Requester Address</li><li>If messageType is "pay" or "penalty", you will see the Truebit Verify Address*</li></ul></td><td>Text</td></tr><tr><td>total_steps_computed</td><td>Total amount of steps executed by the Truebit Verify Node.</td><td>Text</td></tr><tr><td>peak_memory_used</td><td>Peak memory used by the Truebit Verify Node.</td><td>Text</td></tr></tbody></table>

</details>

<details>

<summary>lineItem API Task</summary>

The `lineitem` details the charge operation for the Task Requester.

<table><thead><tr><th width="195.58984375">Property</th><th width="264.2005208333333">Description</th><th>Values</th></tr></thead><tbody><tr><td>operation</td><td>Operation Type</td><td>charge</td></tr><tr><td>account</td><td>Task Requester Address</td><td>Text</td></tr><tr><td>totalTransferredBytes</td><td>Amount of bytes transferred during the API execution</td><td><ul><li><strong>request</strong></li><li><strong>response</strong></li></ul></td></tr></tbody></table>

</details>
