Cranking

What is 'Cranking' and Why is it Required?

The blockchain does not have the concept of 'scheduling', and requires an external 'crank' to trigger actions.

Due to the nature of blockchain, events cannot be triggered following certain conditions. Instead, some form of cranker needs to watch to see when these conditions are met and then take appropriate action.

For that reason, certain steps require a 'nudge' or a 'crank' from off-chain observers to monitor on-chain data for certain conditions to arise, and to trigger a program to process this.

A well design cranker and cranked process will:

(a) Validate that the condition has indeed occurred (now that the cranker has made it aware of it!);

(b) Be entirely deterministic - i.e. there is no way that a malicious cranker should be able to alter the outcome of something based on pointing the program to a particular occurrence before another one;

(c) Be unable to 'miss' or 'skip' something which needs to be processed.

Set out below the processes within the Aver program which require cranking, and how they can be considered to be secure.

It's important to note that nothing a cranker does (arguments, parameters, timing, delaying or otherwise) could impact on the resulting settlement or process. It is simply a step to 'nudge' the process along.

Anyone can run a cranker and perform the cranking process. It's also possible to include a 'crank' step in your own trading scripts to ensure settlement is performed immediately (in practice, you will observe that crankers tend to pick up events and settle them within 3-10 seconds).

Settlement of the 'Maker' Side of a Trade

Matching is an entirely decentralized process and occurs 100% on-chain. Settlement is also entirely decentralized, on-chain and executed via smart-contract. The process is deterministic and cannot be tampered with.

However, the process requires off-chain monitoring to identify that a match has occurred and to determine and provide the accounts which are involved in the settlement.

A cranker sends an instruction to the blockchain - nudging it to settle the matched order. However, if the instruction does not seek to execute the very next event on the queue, the process will fail (i.e. - the program will only permit the next event to be cranked, preserving a deterministic path).

All of the parameters and values required to perform the settlement of the match live on-chain and are validated by the program itself - it does not rely on any information provided to it from off-chain.

Settlement of Market Payouts or Refunds on Resolution or Voiding

It is possible for a user to trigger their own settlement of winnings or refunds from a voided market, however, to improve participant experience, this process has been made 'crankable'.

Anyone can run a cranker to identify resolved or voided markets on-chain, and to send 'batched' settle instructions to the program providing it with the wallets which have UserMarkets within this Market.

The order in which wallets are paid out does not impact on the resulting event, and so no order needs to be respected in this cranking process. All values and accounts to be settled are available and are validated 100% on-chain by the program (i.e. it does not rely on any external information from the cranker - it just needs the nudge to execute it).

Last updated