It is probable that in a few decades onchain transactions will be more expensive...
Thinking more about this, if we expect on chain transactions to replace mining reward, then would that not discourage a lot of people from actually transacting with bitcoin? Considering how much it would cost to mine, I would not want to fund that with my fee on buying a product online.
I am confident that in the coming years the system would adjust for the inevitable situation where there would be no more bitcoins to be mined, maybe through second layer solutions as you suggested, but that could potentially present a problem as well.
I always like to share this post from Hal Finney when we discuss second layer solutions:
I believe this will be the ultimate fate of Bitcoin, to be the "high-powered money" that serves as a reserve currency for banks that issue their own digital cash. Most Bitcoin transactions will occur between banks, to settle net transfers. Bitcoin transactions by private individuals will be as rare as... well, as Bitcoin based purchases are today.
As we know, Hal Finney was the receiver of the first bitcoin transaction.
He is suggesting that only big transactions would occur on chain in the future, and people will use other ways to transact (probably second layer solutions).
I agree that this is a possible distant future. We dont need to put every single transaction in the blockchain.