Though it is legal in some countries and over 1,100 cryptocurrenies are in practice, its trading is punishable under the Nepal Rastra Bank Act.
Bitcoin is based on Blockchain technology.
Bitcoin was created as a decentralized alternative to banking system. This means that the system can operate and transfer funds from one account to the other without any central authority. With central authority transferring money is easy: Just tell the bank you want to remove Rs 500 from your account and add it to someone else's account. In this case, the bank has all the powers. Since the bank is the only one who is allowed to update the ledger that holds the balances of everyone in the system. But how do you create a system that has a decentralized ledger? How do you give someone the ability to update the ledger without giving them so much power that they will become corrupt or negligent in their work?
Well the rule of the Bitcoin system, know as the protocol solves this in a very creative way. Anyone who wants to participate in updating the ledger of Bitcoin transactions, known as the Blockchain can do so.
All you need to do is guess a random number that solves the equation generated by the system. This guessing is all done by the computer. The more powerful computer you have, the more guesses you can make per seconds, thus increasing your chances of winning this game. If you managed to guess right you earn Bitcoins and get to write the "next page" of Bitcoin transactions on the blockchain.
Once your mining computer comes up with the right guess, your mining program determines which of the currently pending transactions will be grouped together into the next block of transactions. Compiling this block represents your moment of glory as you have now become the temporary banker of Bitcoin who gets to update the Bitcoin transaction ledger known as the blockchain. The block you have created, along with your solution is sent to the whole network so other computers can validate it. Each computer that validate your solution updates its copy of the Bitcoin transaction ledger with the transactions that you chose to include in the next block.
As you can imagine, since mining is based on a form of guessing; for each block, a different miner will guess the number and be granted the right to update the blockchain. Of course the miners with more computing power will succeed more often, but due to the laws of statistical probability, it is highly unlikely that the same miner will do so every time.
After this stage is complete the system generates the system generates a fixed amount of Bitcoins and rewards them to you as a compensation for the time and energy you spent in solving the math problem. Additionally, you get paid any transaction fees that were attached to the transactions you inserted into this block. So that's bitcoin mining in a nutshell.