A Scottish hacker has been sentenced to six years in prison in the United States for stealing almost £9million in cryptocurrency.