What happens when you make a transaction on Metamask? For Non-Technical Folks
What actually goes on behind the scene when you click on a single button in your Metamask Wallet? This seems like a common question, but…
What actually goes on behind the scene when you click on a single button in your Metamask Wallet? This seems like a common question, but there's no real answer out there that leads to scams happening.
Note: Whatever you do on Metamask, never reveal your private key to anyone especially if they claim that they are Metamask support. There are a lot of scams like that out there happening!
TLDR
The transaction is broadcasted on the Ethereum network (or another blockchain network), it becomes available to other nodes almost immediately as a pending transaction and is added to the common queue, but it is not confirmed.
Before the block is confirmed, the order of the pending transactions is not decided. Miners sort transactions by how much they’re paid per gas (unit of computation function have to perform).
When a block confirmation hash is found by some miner (thus confirming all the transactions in that block), which tends to happen once every ~20 seconds, the transaction is confirmed.
Step 1: Logging into your Metamask and performing any transactions

When you make a transaction on Metamask, which could be sending tokens to another wallet, approving transactions, etc, what is happening is that a transaction is being sent to a pool of transactions to be verified by nodes.
What are Nodes? It is a computer that connects to a blockchain network, which maintains the blockchain and verifies if the transactions are valid before relaying the transaction to other computers (nodes) in the blockchain
As seen above, it is a form of a transaction even though it is an “Approve” button.
Step 2 : Ordering of pending transactions
Before the transactions is accepted i.e when you see your transaction still pending in Metamask, the transaction is awaiting the miners to accept the block. The transaction goes to a pool of pending transactions also known as the “Mempool”.
Before the block is confirmed, the order of the pending transactions is not decided. Miners sort transactions by how much they’re paid per gas (unit of computation function have to perform).
This can lead to the situation where even though one transaction is sent earlier, it might be confirmed later than another transaction because less gas fees are paid.
This also explains how bots might be able to front run some mints or releases, like in the case of Stargate Auction with Alameda research.
Front Run: Reordering of transactions by diferent means in the mempool such that an exploiter’s transaction can be first which allows them to extract some gains.
Step 3: Confirmation of Transaction
When a block confirmation hash is found by a validator (thus confirming all the transactions in that block), which tends to happen once every ~20 seconds, the transaction is confirmed. This transaction is then broadcasted to the entire network and that's when you will see on Etherscan, that the status will be “Success”.
Basically, the miner/validator validates the transaction that you made and a new block is being “mined” or produced in the blockchain with your transaction on the block.
And with that folks, is what happens whenever you click a button on Metamask.
Stay safe out there and do not put your private keys online or on Notion. Thank you for your time.
Join Coinmonks Telegram Channel and Youtube Channel learn about crypto trading and investing