For Acki Nacki Developers
Acki Nacki docsFor DevelopersFor Validators
  • About Acki Nacki SDK
  • How to deploy a Multisig Wallet
  • Dapp ID Full Guide: creation, fees, centralized replenishment
  • Quick Starts
    • Quick Start TVM SDK JavaScript
    • GraphQL Quick Start
  • Reference
    • Core Library Reference
      • Modules
      • Module abi
      • Module boc
      • Module client
      • Module crypto
      • Module debot
      • Module net
      • Module processing
      • Module proofs
      • Module tvm
      • Module utils
    • Core Library Error API
    • Error Codes
    • TVM-CLI Reference
  • VM Instructions
    • Acki Nacki VM Instructions
    • Formal Verification
      • Acki Nacki VM Instructions Business-Level Specification
  • GraphQL
    • GraphQL API
    • Schema
    • Blockchain API
    • Query Collections: Query Language
    • Field Descriptions
    • Info API
    • Web Playground
    • Examples
  • ABI
    • ABI Specification
  • Examples
    • Client Libraries JS Examples
    • GraphQL API Examples
      • Connect to GraphQL API
      • Send message
      • Accounts
      • Blocks
      • Messages
      • Block and Transaction Pagination: Best Practice
      • Transactions
  • For Binding Developers
    • How to work with Application Objects in binding generators
    • JSON Interface to TVM Client
  • Links
    • TVM SDK repository
Powered by GitBook
On this page
  • MINTECC (C726)
  • CNVRTSHELLQ (С727)
  • MINTSHELL (С728)
  • CALCBKREWARD (С729)
  • CALCMINSTAKE (С730)
  • VERGRTH16 (С731)
  • POSEIDON (С732)
  1. VM Instructions

Acki Nacki VM Instructions

PreviousError CodesNextFormal Verification

Last updated 1 month ago

MINTECC (C726)

Mint any ECC Token

Input: ECC KEY

Can be invoked only in special contracts.

CNVRTSHELLQ (С727)

Converts SHELL to VMSHELL at a 1:1 ratio.

Input: amount of nanotokens to convert

Q in the end stands for ‘quiet’ which means that if there is not enough Shell, it will not throw an exception.

If the account balance does not have the required number of tokens, the exchange will be made for the entire available amount. That is, MIN(available_tokens, want_cnt_to_convert).

MINTSHELL (С728)

Mint some VMSHELL tokens, allowed by available credit in Dapp Config for this Dapp Id

Input: amount of nanoVMSHELL to mint

CALCBKREWARD (С729)

Calculate reward for BK after epoch ended.

Input: params of bkroot state:
    uint128 numberOfActiveBlockKeepers,
    uint128 stake,
    uint128 totalStake,
    uint128 reputationTime,
    uint128 timenetwork,
    uint128 epochDuration

CALCMINSTAKE (С730)

Calculate minstake for BK epoch start.

Input: params of bkroot state:
    uint128 epochDuration,
    uint128 timenetwork,
    uint128 numberOfActiveBlockKeepers,
    uint128 numberOfNeededActiveBlockKeeper

VERGRTH16 (С731)

Verify Groth16 zero-knowledge proof prepared based on JWT token and extra salt password to prove that the user owns some OpenId account (Google, Facebook, Kakao accounts etc). Takes as input the proof, related public input Poseidon hash and index of verification key.

Input:
    uint32 vk_index,
    bytes public_inputs, // of length = 32 bytes
    bytes proof // of length = 128 bytes
Output:
    boolean value indicating if proof is valid or not.

Note: public_inputs must be prepared using POSEIDON instruction.

POSEIDON (С732)

Calculate POSEIDON hash function. This hash function is designed for now especially for ZkLogin protocol needs. It takes as input all public ZkLogin data related to OpenId authentication (i.e. some public fields of JWT token and extra public data).

Inputs:
    string zkaddr,
    uint256 ephimeral_pub_key,
    bytes modulus,
    uint64 max_epoch,
    string iss_base_64,
    uint8 index_mod_4,
    string header_base_64
Outputs:
    Poseidon hash (32 bytes array) of input data being sequentially concatenated.

Note: There is: zkaddr = Poseidon(JWT.stable_id, JWT.iss, User salt password), where JWT.stable_id and User salt password are secrets. ephimeral_pub_key is a temporary key that will be used sign transactions (i.e. the related secret key) till Unix timestamp max_epoch (ephimeral_pub_key is embedded into JWT.nonce and JWT is a kind of TLS certificate for ephimeral_pub_key). modulus is RSA JWK public fresh modulus published by OpenId provider (the JWK is used to sign JWT tokens). iss_base_64, index_mod_4 is JWT public data describing OpenId provider. header_base_64 is JWT public data containing “kid” (key id) of JWK.

link to the opcode
link to the opcode
link to the opcode
link to the opcode
link to the opcode
link to the opcode
link to the opcode