A Scots computer hacker who used the 'dark web' to sell drugs has been ordered to pay £17,000 in compensation and carry out 200 hours of unpaid work.

David Trail set up and administered the Topix2 website, an online black market site which he used to buy and sell drugs including Diazepam from his home in Edinburgh's Fountain Park area.

Using some of the most sophisticated computer systems ever seen by Scottish police, the 26-year-old IT specialist also hacked into the computer system of his former employer, Scotweb, and accessed information and credit card details of a number of their customers.

His crimes only came to light after the FBI passed information to German police relating to a variety of concealed servers not easily accessible to normal users, which were linked to online drug marketplaces.

The Narcotics Squad of Police in Hesse, Germany, linked the Topix2 site to an individual in Scotland and contacted Police Scotland who, after further investigation, raided Trail's Edinburgh property on November 6, 2014.

A quantity of Diazepam was recovered along with evidence that Trail had been selling drugs to customers throughout Europe.

Speaking following his sentencing at Edinburgh Sheriff Court on Thursday, Andrew Richardson, Procurator Fiscal for Edinburgh, and COPFS Cybercrime Lead, said: "David Trail thought that using his extensive technical expertise he could carry out illegal activities and avoid detection, he was wrong.

"Criminals such as this should be aware that law enforcement agencies here in Scotland and throughout the world have state of the art forensic systems analysis at their disposal to identify and trace those seeking to stay below the radar when using the “dark web” for criminality.

"In addition to the vast technical resources available, sharing information across continents enables the capture and prosecution of individuals wherever they may commit their crimes."

The court heard that the computer used by Trail had a blank keyboard and had been customised in a bid to prevent access to the evidence it contained.

Prosecutors also claimed the Topix2 site, which has now been closed, was "a criminal eBay of the dark web".

Trail also only accepted payment for his drug deals in Bitcoin, a digital currency which has become popular among criminals.

The currency can be exchanged for some goods and services in the real world.