Events

The program emits an event for every change of state. There are 11.

EventEmitted bySaysDiscriminator
ConfigChangedinitialize, set_configThe Config was created or changed.93195662624d4ec0
ModelCreatedcreate_modelA model was created in Uploading.e9f49d99d3fc4c18
WeightsWrittenwrite_weightsCiphertext bytes were written.e7301788eab9562d
ModelSealedseal_modelA model's hash was fixed.0fd7ee0fb84bb7eb
ModelPriceChangedset_priceA model's price, mint or operator share changed.75239d6d3b3e2323
ModelStatusChangedgrant_by_owner, retire_modelA model became Live or Retired.eaf662525af01335
EnclaveChangedregister_enclave, refresh_enclaveAn enclave was registered or refreshed.acde9d6e2520f224
GrantChangedgrant_by_owner, grant_by_enclave, revoke_grantA grant was written or revoked.f93e2aae3432e2a1
CallOpenedopen_callA call opened with its escrow.506153da2e718033
CallSettledsettle_callA call settled and its receipt was written.f0c936c5842196d5
CallRefundedrefund_callA call's escrow returned to the caller.fb870e47620e2437

How an event is carried#

Events are emitted with Anchor's event CPI: the program calls itself, and the event is the data of that inner instruction. They are not in the transaction's log messages, so a full or truncated log never hides one.

To read the events of a transaction:

  1. Take the transaction's inner instructions whose program is the voynich program.
  2. Keep those whose data starts with the 8 bytes e445a52e51cb9a1d. Their only account is the event authority, the PDA ["__event_authority"], as a signer.
  3. The next 8 bytes are the event's discriminator from the table above.
  4. The rest is the event's fields in order, Borsh-encoded.

Addresses are 32 bytes, integers are little-endian, a string or bytes or Vec starts with its length as a u32, and ModelStatus and CallStatus are one byte with the values in Accounts.

The API reads the same events and serves them as a stream: see HTTP API: Overview.

ConfigChanged#

FieldType
adminpubkey
configConfigArgs

ConfigArgs is attestation_program: pubkey, record_layout_version: u8, fee_recipient: pubkey, protocol_share_bps: u16, call_deadline_slots: u64, in that order.

ModelCreated#

FieldType
modelpubkey
ownerpubkey
namestring
manifestbytes
weightsVec<pubkey>
size_bytesu64
cipherstring
nonce_prefix[u8; 16]
allowed_measurementsVec<[u8; 48]>
priceu64
price_mintpubkey
operator_share_bpsu16
upload_keypubkey
slotu64

WeightsWritten#

FieldType
modelpubkey
weightspubkey
offsetu32
lengthu32
written_bytesu32

offset and length describe the write. written_bytes is the account's total after it.

ModelSealed#

FieldType
modelpubkey
ciphertext_sha256[u8; 32]
slotu64

ModelPriceChanged#

FieldType
modelpubkey
priceu64
price_mintpubkey
operator_share_bpsu16

ModelStatusChanged#

FieldType
modelpubkey
statusModelStatus

EnclaveChanged#

FieldType
enclavepubkey
signing_keypubkey
encryption_key[u8; 32]
operatorpubkey
endpointstring
recordpubkey
hardware_typeu8
measurement[u8; 48]
recorded_slotu64
expires_at_slotu64

GrantChanged#

FieldType
grantpubkey
modelpubkey
enclavepubkey
wrapped_keybytes
granted_bypubkey
slotu64
revokedbool

slot is the slot of this change. revoked is false for a grant written and true for a grant revoked.

CallOpened#

FieldType
callpubkey
callerpubkey
modelpubkey
enclavepubkey
nonceu64
input_hash[u8; 32]
priceu64
price_mintpubkey
ownerpubkey
operatorpubkey
fee_recipientpubkey
operator_share_bpsu16
protocol_share_bpsu16
opened_slotu64
deadline_slotu64

CallSettled#

FieldType
callpubkey
receiptpubkey
modelpubkey
enclavepubkey
input_hash[u8; 32]
output_hash[u8; 32]
signature[u8; 64]
slotu64
price_mintpubkey
totalu64
ownerpubkey
operatorpubkey
fee_recipientpubkey
owner_amountu64
operator_amountu64
protocol_amountu64

The fields are the Receipt's, with the Receipt's address as receipt.

CallRefunded#

FieldType
callpubkey
callerpubkey
price_mintpubkey
amountu64
slotu64
statusCallStatus