Creating a bitcoin/litecoin miner with Javascript 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.
Why reinvent the wheel?

I think there are several simple javascript miners out there, so I won't bother telling you more than to google it (or to duckduckgo it, if you prefer).

But whilst we are at it: Would you believe people have gone far beyond it and found a way to program a javascript-based miner using GPUs, as pointed out in an answer on bitcoin.stackexchange? That project is hosted here.