2

From: ./contracts/eosiolib/transaction.h

/**
 * Gets the block number used for TAPOS on the currently executing transaction.
 *
 * @brief Gets the block number used for TAPOS on the currently executing transaction.
 * @return block number used for TAPOS on the currently executing transaction
 * Example:
 * @code
 * int tbn = tapos_block_num();
 * @endcode
 */
int tapos_block_num();
2

What is “Transaction as Proof of Stake” (TAPOS)

A mechanism where each transaction includes a partial hash from previous blocks on the same chain.

From the whitepaper:

The EOS.IO software requires every transaction to include part of the hash of a recent block header. This hash serves two purposes:

  1. prevents a replay of a transaction on forks that do not include the referenced block; and
  2. signals the network that a particular user and their stake are on a specific fork.

Over time all users end up directly confirming the blockchain which makes it difficult to forge counterfeit chains as the counterfeit would not be able to migrate transactions from the legitimate chain.

and when would a smart contract use it?

I believe its main use will come once inter-blockchain communication (IBC) is available, and it will be required to know on which chain a transaction was pushed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.