I am a web developer and looking for well written technical documents about how bitcoin/litecoin works, what is the workflow, what is the algorithm and how can I write a miner from scratch by using JavaScript (or similar).
It will be a kind of hobby/portfolio project, so I am not worrying about the performance and the other possible issues.
Thanks in advance.