How Bitcoin transactions work and what are their types?