V2

The current transaction calldata version for transactV2 method

The second calldata version doesn't contain tree_proof and root_after fields since the transaction finalized with the separate method by prover. Also the memo block format was changed. Now it consist of 3 subblocks: tx_specific, message and extra_data.

Field
Size (bytes)
Offset (bytes)
Description

selector

4

0

Contract method selector (0x5fd28f8c)

calldata_version

1

4

Available versions: 2 (the latest)

nullifier

32

5

out_commit

32

37

Transaction commitment (transaction subtree root in the Merkle tree)

delta.index

6

69

Merkle tree index at the time of transaction creation

delta.energy

14

75

Pool XP token delta after the transaction execution (signed integer)

delta.token

8

89

Pool balance delta after the transaction execution (signed integer, in the pool dimension)

tx_proof

256

97

zkSNARK proof for transaction

tx_type

2

353

0 - deposit

1 - transfer

2 - withdraw 3 - permit deposit

memo_size

2

355

The following memo block size in bytes

memo.spec.proxy

20

357

The native address of the operator who commits the transaction to the pool contract and receives a reward for it (proxy_fee). It's selected and set by the transaction creator

memo.spec.prover

20

377

The native address of the prover who can finalize the transaction during the grace period and claim the prover_fee reward. After the grace period, anyone can calculate the Merkle proof and finalize the transaction (claiming the prover's reward)

memo.spec.proxy_fee

8

397

The tokens amount to be transferred to the memo.proxy after the transaction commitment (the Pool contract will multiply the fee by denominator)

memo.spec.prover_fee

8

405

The tokens amount to be transferred to the prover who will publish the new Merkle tree root corresponding to the transaction.

memo.msg.size

2

413

Length of memo.msg which contains encrypted account and notes

memo.msg.ItemsNum

2

415

Number of encrypted items (leafs) in the memo block. Deposit transactions contain an account only, i.e. ItemsNum always equals 1. Stored as a little-endian number

memo.msg.encryption_type

2

417

Memo format flags: 0x0000: ECDH encryption mode 0x0001: plain text (DD) 0x0002: symmetric encryption mode

memo.msg.Hash_acc

32

419

Output account hash (with updated balance)

memo.msg.nonce

24

451

XChaCha20 nonce. Used to decrypt memo.keys_enc by transaction sender

memo.msg.keys_enc

48

475

Encrypted account encryption key

memo.msg.acc_enc

86

523

Encrypted account with an updated balance

memo.extra_data

memo_size - 252

609

Contains application-specific data attached to the transaction such as user comments

ECDSA signature (r, s)

64

357 + memo_size

The nullifier signature. Used to recover deposit spender

Total bytes: 673 (without extra data)

Last updated

Was this helpful?