hi, can anyone tell me how long it will take to mine all the coins and what will happen to the network.
It will happen by about 2140. That's pretty far away, so we don't really have to worry, but the next generations will. There is no issue when it comes to the time every bitcoin has been mined. Actually, miners are not mining bitcoins but blocks. The bitcoins they get are just rewards for finding the block. When bitcoins reach 21 million then that would mean there won't be anymore rewards to be given to the miner that finds the block. What will happen though is that the miners will still get the miner's fees. So they will work for that.