Truebit Verify
  • Getting Started
    • 📄What is Truebit Verify?
      • How does Truebit work?
      • System Actors
    • ⏱️Get Started
    • ⚙️Architecture
      • Truebit Verify Hub
      • Truebit Verify Nodes
      • What is a transcript?
        • Transcript example
        • API Transcript example
    • Key Concepts
      • What is verification?
      • Determinism
      • WebAssembly
      • Task instrumentation
  • Developing Truebit Tasks
    • Introduction
    • Writing Function Tasks
      • Supported languages
        • Javascript
        • Python
        • Rust
    • Writing API Tasks
    • Task examples
      • Function Task examples
        • Fibonacci
        • Reverse Alphabet
        • Encrypt sha256 using bun.js
        • Encrypt sha256 using Deno
        • ECDSA signature verification
        • NumPy example
      • API Task examples
        • Pet Store CRUD
        • API-Auth examples
    • Namespace management
    • Task Authorization
    • Truebit CLI
      • secret.json
  • Executing Truebit tasks
    • Introduction
    • Task Execution API
      • Execute Function Tasks
      • Execute API Tasks
      • Get Task Status
    • Transcript API
      • Get Transcript
      • Get Invoice
  • Community
    • Truebit Unchained Protocol
    • Support
Powered by GitBook
On this page
  • Root message
  • Execution Lifecycle messages
  • task_created
  • node_outcome
  • solutions_revealed
  • execution_completed

Was this helpful?

  1. Getting Started
  2. Architecture
  3. What is a transcript?

Transcript example

PreviousWhat is a transcript?NextAPI Transcript example

Last updated 2 months ago

Was this helpful?

This example illustrates a Function Task execution transcript, where multiple responses are received from the nodes.

Function Task Transcript
{
    "executionId": "657938a7-ebf1-4899-85ea-494fbca71123",
    "transcript": [
        {
            "type": "task_created",
            "executionId": "657938a7-ebf1-4899-85ea-494fbca71123",
            "message": {
                "type": "dispatch_task",
                "taskId": "js_07265a110075ce2f627ead21ae2a6648ba4bb59be6f58cba530673978e9d3675/1.0.0",
                "executionId": "657938a7-ebf1-4899-85ea-494fbca71123",
                "msgHash": "a19c16f3cb4563f6eead87fc1cd4b40e684f26e8739ab9c3ef8575ec4e215b6f",
                "signature": {
                    "v": 28,
                    "r": "41454018ea7c31777bb2ecdf1a3efee6d096e2472e1831fdb82aee31353ed0a3",
                    "s": "6ee0d2bc666f3768e749fc34b109fb6d3601e6b217b2dbefe80b4636401630be"
                },
                "limits": {
                    "gas": "1099511627776",
                    "call": "500000",
                    "frame": "4194304",
                    "memory": "256"
                },
                "econParams": {
                    "reward": "0",
                    "requiredSolutions": 3,
                    "totalSolutions": 3,
                    "executionTimeout": 30000
                },
                "workers": {
                    "blockNumber": 285,
                    "selectionStrategy": "default",
                    "setNodes": [
                        "0x70997970C51812dc3A010C7d01b50e0d17dc79C8",
                        "0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC",
                        "0x90F79bf6EB2c4f870365E785982E1f101E93b906"
                    ]
                },
                "dispatcherTimestamp": 1717686178,
                "taskRequesterTimestamp": 1713836972,
                "ledgerName": "avalanche",
                "blockHash": "0x127cd140a2d3523c66ddd8a59a864116923bbd0d8fcb6984a8128863506ca594",
                "blockNumber": 285,
                "chainId": "31337",
                "registrationContractAddress": "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512",
                "taskRegistryContractAddress": "0xcf7ed3acca5a467e9e704c703e8d87f634fb0fc9",
                "taskRequestorAddress":	"0x6E3DC217253246e40752ec4887332F07b673EC4D",
                "taskPath": "/truebit/test_task?version=1",
                "taskVersion": 1,
                "senderAddress": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
                "input": "7"
            },
            "msgHash": "b38938bad6f593d1688b46d9d9e547b52583c23de447abad8b50072dc43861b1",
            "signature": {
                "v": 28,
                "r": "bc9e9118cd97c5880f7670f6f60efce87890c03fb7baa8c6706b29e02e08a7a7",
                "s": "51283a57f271e8ca95d5e38cdecb3f345d1ef6cba0c571e2b3e5d951a2f1b96b"
            },
            "publicKey": "048318535b54105d4a7aae60c08fc45f9687181b4fdfc625bd1a753fa7397fed753547f11ca8696646f2f3acb08e31016afac23e630c5d11f59f61fef57b0d2aa5",
            "sequencerAddress": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
            "timestamp": 1717686178761
        },
        {
            "type": "node_outcome",
            "executionId": "657938a7-ebf1-4899-85ea-494fbca71123",
            "message": {
                "executionId": "657938a7-ebf1-4899-85ea-494fbca71123",
                "senderAddress": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8",
                "encryptedSolution": {
                    "iv": "5075f5c328e2bfb7f2069109da94d795",
                    "ephemPublicKey": "04df026b6e9e7452acf840f46c0af5aae344a4434bc9b6112c55aa7b06c0498401ca3548ceff753dbb92cad094d7c4b00f3a88d4e93a3d0eda621f26dc11e80ab4",
                    "ciphertext": "ff31c6fa59e2f7962eb1086a3b0dc9d8ba5d405e40a143091535ada3bc1df92f930c4c9a4676d5bcfbc7f1f8d588dbb5235d00a0bde23a5fa66ac2d8ea962993b34fd3a045eaad0497c4be555ab6f1a6546fd9c5e36ea021b38a134b7174c83781baff9a51e4b3cfe5e13fab7ba36624d3e0f3cd7ba8aaf91502637af46fc78b107bac71a717fa76e3d61e64c43adb30f450edd66545f5c18679428443001bfed36091483adc688bdd061710375ebef3a9ba31eeca80320809f6aab254626c4273f30f08b7f6a230e59f9c99df5c62751e078e0d9b4fd16a831588263a11fb82cd4348adfd43ebc59023e51dc8563de0bbe0d3d3ac3250897855c8a6a8cc29f05685cf5017d0bbcbafb9f7b494dc8923f107a9c5326a98b82ba692e32b62ff4dd7c2412c5c75f75a801b883a166a3f53c81450eae872d539077109c7b51d51124a049796e9f3790a3bc75a069ebf97cefd028dfce0cee436f54b43b9d06e1af79719b70f0ac4aa687a1e4f3ad60304a0f11227125b6bedfb8ed2b1bb6381dda050bb76cd6fa81446d524737654e72b64a0d39b2ad6f9e31dda056956777affc9021613326f51d62016ad6aa05960fd6b676c8c5a5f11e6af777d74cc4ea86e8f4d89d261cd1f18fb8987a820df1dfbac",
                    "mac": "e2b8cc653306f9f61690816b30c5e20c2283a801099bf5a6b9d63b09076de326"
                },
                "msgHash": "a956e6f6ce8ccd31bdd8906de5a8163893ef224e36918153709fd422b9dd4181",
                "signature": {
                    "v": 27,
                    "r": "09ec545fc6248d1521013f8dccd474cb6125970cf9890f78c243ee09d146d74d",
                    "s": "415cd6c2cb210511484316a15df203d75267607340c5cf28e5c4970c34c49642"
                }
            },
            "msgHash": "ac8c9579f0bc5c4e6d6a64d1230f1f8732a5655549efc7bb285b1a67a924e206",
            "signature": {
                "v": 28,
                "r": "dc41e0d5ee981c77336e65dc3222b1c3824d8b5ba4b905e03d8a6953aa6ce285",
                "s": "0200f01da1c332d44b554f7224a47a92465e445fa99c9e455752393b5fa5c106"
            },
            "sequencerAddress": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
            "timestamp": 1717686205467
        },
        {
            "type": "node_outcome",
            "executionId": "657938a7-ebf1-4899-85ea-494fbca71123",
            "message": {
                "executionId": "657938a7-ebf1-4899-85ea-494fbca71123",
                "senderAddress": "0x90F79bf6EB2c4f870365E785982E1f101E93b906",
                "encryptedSolution": {
                    "iv": "3a7bc215404c9962377763845f347d73",
                    "ephemPublicKey": "040fe8df8ab3eef762d2db93c7cf688e0fd7e14a89405d7f8193201db7438e1b4daea38457374d156c5d2df418d73d58ed95df67bacb999a414868ef7afc67adfa",
                    "ciphertext": "562959fb867fe38636aaad149a17c2f7409f087d69b4d517da496444a52b4ab4da169fc153f550eaa756abfd04878fe34a9479dee3a18ffb0bcfaa5583b4ba129cc99f814ef963d871d785313f0b83aab66e7ee09bebcedf2b23c2505ff1432ba17289987fc393c36539ae5e6f387d52392bf9538145a89e3fb04cba9a631ab7ebb2fe0559717857fa1bb45bb3ebafbeacdf7d4f637e573f462359f67d07b1c8dff98097ca89e32f6a2059f9123c95d4b31c7bb26f7c533912a71da1bf4cca3439cf8d8f027c90bb39b6ffde5f71525d451b3d6477a67ff0077f3f6533bb2fd00c865f88699256632189b782f90e83b5b4b263bfd10062efccc1749d108f3299c141e27e91b726e4d3ea0a7cf782d025b9f48556a3eb7cf605f99f5b074dfbd955f025305f20c808bcb5e4c039b99973d94d953924a21edfc7c093a40ad198e41640e9821f9e952fc7e0b4847565917d7de5a737d8eac011485f0accc2c209d39feabed09f7f5c75a258993f08834d36a03996152901f1739f17f1a21ed2cf6170f0ef2f0c36d600bad7be78aa36e948b3a19e76a33e512826da0f9bfae0413e645b7b1b593a465ddb520e5954adbcab3e72b355ee8e214974d0fe260ec39b063d175db912d0f8a25a6984b4086f3fb9",
                    "mac": "17a6ea313aef54ceffe4bb6b18718c6dbc19ba4bb0075eebfaac5158ee1709bc"
                },
                "msgHash": "51d7241453d33946991faf4d387420c321bdd2489100b01e71a98b78fb7cdd65",
                "signature": {
                    "v": 27,
                    "r": "5908e1f0c2a773094f0008deccb24d1e508ab3b823d659482029e9b6b9659142",
                    "s": "106909136ac71f632f8d726178c4dc617c27f4c71b9c9bc2351b5acf07451f94"
                }
            },
            "msgHash": "37a49d3e38a1fda6326634690e54ccbb57e1b1b169c5b20a66aae0755784b717",
            "signature": {
                "v": 27,
                "r": "22aae4ddf18b3d58857118f6b4384c84fea6689d4fe7066777906df28c606df1",
                "s": "0cea534365b3b0850a1d29147f68191dd3984ae74e8589a9e24caf318700ce53"
            },
            "sequencerAddress": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
            "timestamp": 1717686205594
        },
        {
            "type": "node_outcome",
            "executionId": "657938a7-ebf1-4899-85ea-494fbca71123",
            "message": {
                "executionId": "657938a7-ebf1-4899-85ea-494fbca71123",
                "senderAddress": "0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC",
                "encryptedSolution": {
                    "iv": "abf4bfccb4a0b40eb00e3a0a20919000",
                    "ephemPublicKey": "0471d6cc1c87826bbe2fb12885de4dc0de471ff572c1a848f87631b600da041cd0c62f82d89127b8370250a9d25488d56bba6a7853a28bcd0d1d43d51c1811c119",
                    "ciphertext": "5df2ccbf2098e5b4c8ad84955963667625eb83f7cd8b48a82fa31ddfd19892aefcbd1d70086bb119f8505dabba2ac7202b36d9a621de27b5de7a25620b19e87b6f083253c768b26af378ce9012f73e10179f376ce4dc7c383aa0dc371c066552486803f46026d79c9a65ab949d1f170c14d97096577295f86380c5ac9ed6adb6280877910ac578abdb7cd2bbff96ad9c1206d51569d2d0250a6c8d54e9b38919faa0f4b73f3fe08887a9fcab353a9636ac3975abbae7293e110fabfd4f446c5765ea2b534b5504521f87d56e1c1824742ab3eae5d53365bd09de7ffa4d74f01bcf221ddb6a1cb387c0566fc5bb74af1b17a19b11f1a140de0f98c887288cd2512fc6d000ee2104d2f0a68af77425d96352941b32cb32e7752600b54e77873e82ce17f39de6b0c138c1c135c40e9ce81bcae1bb62f222c1a2ccd0f7c7f100c50978239668a3f32ecf8940c53c7d4c4bd10dec3e9db7b3fa8179f3552f65839d4928aca17baf46a7684335b05d6ca32786b56a1bba727289608f1e76b6797001f97509c05af1ba894b01980b85f2c79a161235168fd77db2f90482f10c897564d9f572308757dc69aece0e0b77e87c4905d3237f9ac82b0be5de256fbca30b7a797c95e8700ffd93ae17e1210ccdd5d37d",
                    "mac": "b5ad4c7f9627c4760c3cf806688bfa52c38eb80c2970730d1d49ca6fc2a90eaa"
                },
                "msgHash": "825479530f1ac744573d03c3d65d4b45629bf276a88c5c96a84e093014908c6a",
                "signature": {
                    "v": 28,
                    "r": "b797e68762cd7df235d942b349ac8020a738f94bf63c7a5d7da0e842461021e3",
                    "s": "1af6f7af901ea1526896601a9d5300247eb7e19f39604938444bca9c1e05f71c"
                }
            },
            "msgHash": "8a2881c958f06b068a0384d44a7cd911130c77c3dd692df3106c23843c2a5abd",
            "signature": {
                "v": 27,
                "r": "15e5eef9c4465bc2a948ca4d7de734c93cf9a4aad481db2b7457733ff1206ce8",
                "s": "189351ce08b39bff61bfd6cd677f6d23925d9275944677972c2f94bff0df4972"
            },
            "sequencerAddress": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
            "timestamp": 1717686205848
        },
        {
            "type": "solutions_revealed",
            "executionId": "657938a7-ebf1-4899-85ea-494fbca71123",
            "msgHash": "a8f8eca9b0f25c0e76662a9e8e0899541f785717193e9887db3b2adf1199ab30",
            "signature": {
                "v": 28,
                "r": "4fcad130489b95545d464e4dd5ee872bcfb40ba78e8d02b691bfdb509b607e10",
                "s": "5c58b407f5271a8729b224941632004df4a9884c719fc3ca4f18d1c262616693"
            },
            "clearTextSolutions": [
                {
                    "signature": {
                        "v": 27,
                        "r": "cf46300186ff01fcf90720a6475d3ca1c924abf9d348e2d6081e2cb1c38d3e16",
                        "s": "37ad0e079462cfa47a281ae490e192a1b1e23d5ae11c1ca6171364f36acfd290"
                    },
                    "clearTextSolution": {
                        "output": "13",
                        "status": "succeed",
                        "metering": {
                            "limits": {
                                "gas": 1099511627776,
                                "call": 500000,
                                "frame": 4194304,
                                "memory": 256
                            },
                            "last": {
                                "steps": 1628060352,
                                "call": 3,
                                "frame": 9
                            },
                            "peak": {
                                "call": 219,
                                "frame": 1407
                            },
                            "versions": {
                                "protocol": "1.84.1"
                            }
                        },
                        "senderAddress": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8"
                    }
                },
                {
                    "signature": {
                        "v": 28,
                        "r": "04ac644f10bbe15aaef05cb6f8b01c7af575b679d45f85eaaf0da2be8a61fcc5",
                        "s": "202f83bb698cd8541cf1f91a930514478f85e87d869237c839882aab72ca720f"
                    },
                    "clearTextSolution": {
                        "output": "13",
                        "status": "succeed",
                        "metering": {
                            "limits": {
                                "gas": 1099511627776,
                                "call": 500000,
                                "frame": 4194304,
                                "memory": 256
                            },
                            "last": {
                                "steps": 1628060352,
                                "call": 3,
                                "frame": 9
                            },
                            "peak": {
                                "call": 219,
                                "frame": 1407
                            },
                            "versions": {
                                "protocol": "1.84.1"
                            }
                        },
                        "senderAddress": "0x90F79bf6EB2c4f870365E785982E1f101E93b906"
                    }
                },
                {
                    "signature": {
                        "v": 27,
                        "r": "f9e25227fdc47f5f8440712e0800b2ea6ffd21896256eaeef8d09b6af4fe08bb",
                        "s": "78e30985d524242d1ccddffa1f687387e2657fed201102732af67e8c1ee1aa95"
                    },
                    "clearTextSolution": {
                        "output": "13",
                        "status": "succeed",
                        "metering": {
                            "limits": {
                                "gas": 1099511627776,
                                "call": 500000,
                                "frame": 4194304,
                                "memory": 256
                            },
                            "last": {
                                "steps": 1628060352,
                                "call": 3,
                                "frame": 9
                            },
                            "peak": {
                                "call": 219,
                                "frame": 1407
                            },
                            "versions": {
                                "protocol": "1.84.1"
                            }
                        },
                        "senderAddress": "0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC"
                    }
                }
            ],
            "sequencerAddress": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
            "timestamp": 1717686205894
        },
        {
            "type": "execution_completed",
            "executionId": "657938a7-ebf1-4899-85ea-494fbca71123",
            "transcriptHash": "ebc2f5fc248991e9f570c255140e1154f08962dc0bdc997ff67d5f37435e72d9",
            "status": "ReadyForInvoice",
            "signature": {
                "v": 28,
                "r": "4c12ca5b2e33d5566e3ec14742562b1df785f30f8c48a48bece1ac6eb2e762da",
                "s": "5fe6808bf5eaf948eb35ba1ed3e33f1d83174b5ce16c247a3f8f33a78f6cdeed"
            },
            "signerAddress": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
            "timestamp": 1717686205918
        }
    ],
    "timestamp": 1717686229391,
    "msgHash": "b058423ba3b27e8e75a126277ece339be9e2703f15131d5610bd1cdb08c8e279",
    "signature": {
        "v": 27,
        "r": "cb660c29b11012d0371d446f0eed9c6339eb09779b1d0f4910fe318bfda61554",
        "s": "58a1eb8d91f9c0b17f358dfdece56d266e9b20cfe857c079a6f9d1e066a47c98"
    }
}

Root message

Property
Description
Values

executionId

Current execution ID

Text

List of all the messages generated during the Function Task execution

Array

timestamp

Transcript query request timestamp. The moment when the task-requester calls the transcript query endpoint.

unixTimestamp

msgHash

Transcript Hash

Text

signature

v: Text r: Text s: Text

Execution Lifecycle messages

task_created

This message is logged into the transcript once the receives a new Function Task execution request.

Property
Description
Values

type

Message type

task_created

executionId

Current execution ID

Text

Original message received from the task-requester

msgHash

Current message hash

Text

signature

v: Text r: Text s: Text

publickey

Text

sequencerAddress

Text

timestamp

task_created message created timestamp

unixTimestamp

Task created original Message: dispatch_task

Property
Description
Values

type

Message type

dispatch_task

taskId

Function task ID

Text

executionId

Current execution ID

Text

msgHash

Current message hash

Text

signature

v: Text r: Text s: Text

limits

Function task execution limits values

  • gas: Maximum amount of steps allowed for task execution.

  • call: Amount of Nested calls allowed for task execution.

  • frame: Stack memory allocated for the Calls during the task execution.

  • memory: Amount of memory used by the task execution

econParams

Economics parameters for the function task execution.

  • reward: TBC

  • requiredSolutions: Min amount of solutions to get a validated result.

  • totalSolutions: Total amount of solutions to get a validated result.

  • executionTimeout: Amount of execution time before it gets canceled.

workers

  • blockNumber: number

  • selectionStrategy: [ "default"]

  • setNodes: Array of nodes

dispatcherTimestamp

Dispatcher timestamp at the moment of receiving a new task execution from taskRequester

unixTimestamp

taskRequesterTimestamp

Timestamp specified on the task execution request by the TaskRequester

unixTimestamp

ledgerName

Current ledger in usage

['avalanche']

blockHash

Current block hash

Text

blockNumber

Current block number

Number

chainId

Unique ID for blockchain identification

Text

nodeRegistryContractAddress

Node registration Smart contract Address

Text

taskRegistryContractAddress

Task registration Smart contract Address

Text

taskAuthorizationContractAddress

Task Authorization Contract Address

Text

taskRequesterAddress

Task Requester address. This address will pay for the task executio

Text

taskPath

Provided path for task execution. It must contain the namespace and taskname

Text

taskVersion

Provided version Task for execution

Number

senderAddress

Text

input

Function Task Input parameters

Text

node_outcome

Property
Description
Values

type

Message type

node_outcome

executionId

Current execution ID

Text

Original message received from the node

msgHash

Current message Hash

Text

signature

v: Text r: Text s: Text

sequencerAddress

Text

timestamp

Message sent timestamp

unixTimestamp

node_outcome original Message: computed_outcome

Property
Description
Values

type

Message type

computed_outcome

executionId

Current execution ID

Text

senderAddress

Text

encryptedSolution

"iv": Text

"ephemPublicKey": Text

"ciphertext": Text

"mac": Text

msgHash

Current message Hash

Text

signature

v: Text r: Text s: Text

solutions_revealed

This message is logged into the transcript after all the requested nodes (totalSolutions) have provided their solution or a timeout has occurred (whichever happens first). It includes all the solutions (in the received order) in their unencrypted form, as long as they arrived before the tiemout.

Property
Description
Values

type

Message type

solutions_revealed

executionId

Current execution ID

Text

msgHash

Current message Hash

Text

signature

v: Text r: Text s: Text

clearTextSolutions

Array of

[

  • signature: Node's signature

]

sequencerAddress

Text

timestamp

Message sent timestamp

unixTimestamp

clearTextSolutions message

This array will contain an unencrypted list of all the messages received from the nodes

Property
Description
Values

output

Unencrypted node solution

Text

status

[ "succeed", "Failed"]

Array of

  • limits

  • last

  • peak

  • versions

senderAddress

Truebit verify Node Address

Text

metering

Property
Description
Values

limits

  • gas

  • call

  • frame

  • memory

last

Actual last values consumed during execution

  • gas

  • call

  • frame

peak

Actual peak consumed during execution

  • call

  • frame

versions

Truebit protocol version

protocol: Truebit protocol version number

execution_completed

This message is logged into the transcript after all the requested nodes (totalSolutions) have provided their solution or a timeout has occurred (whichever happens first).

Property
Description
Values

type

Message type

execution_completed

executionId

Current execution ID

Text

transcriptHash

Text

status

Final execution status

["GamePending", "ReadyForInvoice", "Error"]

errorDetails

Only present if there was an error during the execution.

The details of any error thrown by the protocol or its services

signature

v: Text r: Text s: Text

signerAddress

Text

timestamp

Message sent timestamp

unixTimestamp

execution complete statuses

Status
Description

ReadyForInvoice

All the solutions match, so the protocol is ready to process the execution's invoices

GamePending

2 or more received solutions are different, so a verification game should be played to define which solution is right.

Error

There was an error during the execution. Please check the errorDetails field.

signature

signature

public key

Address

signature

List of selected to work on this function task rxecution

address

This message is logged into the transcript once the receives a new response from the containing the Task's execution result.

signature

address

address

Encrypted solution submitted by the using the public key.

signature

signature

List of all the solutions provided by the selected .

address

Limits values specified in the messages

hash.

signature

address

⚙️
Truebit Verify Hub
Truebit Verify Node
Truebit Verify Hub
Truebit Verify Nodes
Truebit Verify Hub
Truebit Verify Node
Truebit Verify Node
Truebit Verify Nodes
Truebit Verify Hub
transcript
message
message
clearTextSolution
metering
dispatch_task
Execution lifecycle messages
dispatch-service
query-service
execution-service
execution-service
dispatcher service
dispatcher service
execution-service
Truebit Verify Node
execution-service
execution-service
execution-service
execution-service