verify
voynich verify checks one receipt against the chain. It needs no wallet and can be run by anyone, at any time after the call settled. What a receipt is and what each check proves is told in Calls and receipts. The same from code is verify, and the checks by hand are in Verify a receipt.
voynich verify <receipt address | call address | transaction signature>Argument#
idaddress or signature, first argumentrequiredOne of three values, all base58: the Receipt's address, the address of its Call, or the signature of the transaction that settled the call.
What it checks#
The CLI reads the receipt from the API, then reads the accounts themselves through the RPC the API names and compares.
- The identifier. The receipt returned is the one asked for: its address, its call or its settling transaction equals the value given.
- The signature. The receipt's Ed25519 signature is the enclave's signing key over the call's address, the input hash and the output hash.
- The settling transaction, when a transaction signature was given. The transaction succeeded in the receipt's slot and carries the program's
CallSettledevent for this receipt, with the same call, model, enclave, hashes, signature and slot. - The accounts. The Config, the Receipt, the Enclave and the Model exist and are owned by the program. The attestation record exists and is owned by the attestation program the Config names.
- The receipt on chain. The Receipt is at the address derived from its call, and its call, model, enclave, hashes, signature, slot and payments equal the ones the API returned.
- The attestation record. The record is at the address derived from the enclave's signing key, the Enclave names it, it names that signing key, it has the Config's layout, and its measurement is one of the model's allowed measurements.
- The expiry. The record was recorded at or before the receipt's slot and expires after it.
Checks 6 and 7 use the record as it stood when the call settled. When the enclave has attested again since, the CLI reads the record's earlier state from the attestation program's RecordUpdated events in the RPC's transaction history.
What it prints#
One JSON object on stdout. The command exits with code 0 when verified is true and with code 1 when it is false, so a script reads the exit code or verified.
{
"verified": true,
"signature": true,
"record": true,
"expiry": true,
"receipt": {
"address": "D949kMCmdYwMXvjYTM6BY9WUxuhjpz6bWVmZ4FxrpGnQ",
"call": "GyLvqRCFTWcsEcEr4jt8vuHZVKDvnyVwwW3Wwcav373U",
"model": "431poxuxU5h5BE4nxazgLfxVEdg1xjipQWknyVN8ZobW",
"modelName": "sketch-32",
"enclave": "5pTHrf9HYoq7unNVbvsL4kd6zWcwWXqH4HQ7JPQi5Ft6",
"inputHash": "ee79690984ab…87b7bba43a",
"outputHash": "f159b9fd5830…49b1197cfa",
"signature": "TUUH5Iw+2yGx…sk1+5lBCA==",
"slot": "2328",
"transactionSignature": "5hDTWzCChJEN84pugp9MJFZuuY7RDpa1k63gvJVQA2tapUabBgcHkPfJto2Hsg9e9QxTzgfkSLFz1c4HWUHjkK9W",
"payments": {
"mint": null,
"total": "100000",
"owner": {
"recipient": "D2af6GLQbPYVeXJE8hsrwmsyeJrnbkbgFxha3zM6TxJx",
"amount": "70000"
},
"operator": {
"recipient": "A4rxgQ3uAJpNMCMhX4UiESkDUBgQ2dAQ828dT4h1uTcV",
"amount": "25000"
},
"protocol": {
"recipient": "BTYUmEuEigyj7dugV8KnwTXDtAEww3U1Ya4Y3CiNACFq",
"amount": "5000"
}
}
},
"fixture": false
}verifiedbooleantrue when signature, record and expiry are all true.
signaturebooleanCheck 2.
recordbooleanChecks 5 and 6.
expirybooleanCheck 7.
receiptobjectThe receipt that was checked.
reasonstringWhy the receipt is not verified. Present only when verified is false.
fixturebooleanfalse against a cluster.
The receipt#
addressaddressThe Receipt account.
calladdressThe Call it settles.
modeladdressThe model that answered.
modelNamestringThe model's name.
enclaveaddressThe enclave that answered.
inputHash64 hex charactersThe SHA-256 of the encrypted input.
outputHash64 hex charactersThe SHA-256 of the encrypted output.
signature64 bytes, base64The enclave's Ed25519 signature.
slotinteger stringThe slot the call settled in.
transactionSignaturebase58 signatureThe settling transaction.
paymentsobjectmint (an address, or null for SOL), total, and owner, operator and protocol, each with recipient and amount. Amounts are strings in base units.
Reasons#
reason | The check that failed |
|---|---|
The returned receipt does not match the requested identifier. | Check 1. signature, record and expiry are all false. |
The requested transaction did not settle this receipt. | Check 3. record and expiry are false. |
A required chain account is missing. | Check 4: one of the five accounts does not exist. |
A chain account owner does not match its program. | Check 4: the Config, the Receipt, the Enclave or the Model is not owned by the program. |
The attestation owner does not match the chain configuration. | Check 4: the record is not owned by the attestation program the Config names. |
The signature, attestation binding or expiry check failed. | Check 2, 5, 6 or 7. The three booleans say which. |
Failures#
These end the command with code 1 and one line on stderr, without printing the object.
| Message | Cause |
|---|---|
Supply receipt address, call address or transaction signature. | The argument is missing. |
RECEIPT_NOT_FOUND: This receipt was not found. | No receipt has this address, call or transaction. |
PROGRAM_MISMATCH: The API does not name the canonical Voynich program. | The API names another program than the CLI was built with. |
The RPC could not read the settlement transaction | The RPC refused the read of the transaction given. |
The RPC did not retain the settlement transaction | The RPC's history does not hold the transaction given. |
The RPC has no retained attestation history for this receipt | The record changed after the call settled and the RPC's history does not reach back to the receipt's slot. |
The RPC could not read historical attestation evidence | The RPC refused the read of an earlier attestation transaction. |
The RPC did not retain a required attestation transaction | The RPC's history does not hold an earlier attestation transaction. |