Update April 26, 2018: Bancor's prioritization mechanism is a non-breaking change. The token conversion process on Bancor will continue to work as it used to without requiring any change from users or developers.
Bancor prioritizes transactions in order to ensure that they are are executed in the correct and valid order. Prioritization provides protection against front-running activities and is achieved by giving different maximum gas prices to different kinds of users on the Bancor Network.
There are three levels of protection against front-running on the Bancor Network:
1. Bancor Wallet users - Receive a gas price that is higher than the rest, which gives transactions submitted from the Bancor Wallet the highest level of protection.
2. API users - API users that use Bancor outside the Bancor Wallet have the second-highest protection. Their allowed gas is below that of Bancor Wallet users, but above Blockchain users. This group includes users of Bancor via a supported third-party wallet or browser (such Trust Wallet or Cipher) or via a Web3 Wallet (such as MetaMask).
3. Blockchain users - Transactions submitted directly to the blockchain using the quickConvert function will receive the lowest gas price and will therefore have the lowest protection.
As an added layer of protection to ensure transactions are executed in the correct and valid order, Bancor hashes several values into each transaction that cannot be changed. Any change to the following hashed values will cause the transaction to fail:
- Block number — transactions are initiated with a lifespan of X blocks (at the time of writing — 12 blocks). Meaning, from the moment you create the transaction you have X amount of blocks to execute it. Executing it after the transaction lifespan will cause the transaction to fail. A specific API to query transaction lifespan on the Bancor Network will be available in the near future.
- Gas price - the gas price received is part of the transaction's hard coded values. Changing the gas price will cause the transaction to fail.
- User address - transaction is restricted to a specific user.
- Nonce - transaction is restricted to a specific nonce.
Read more about building transaction's using Bancor's Convert API.