When you walk past rows of residential housing, you probably don’t see each front door as a potential home for thousands of shell companies, funnelling money from kleptocrats and despots abroad. That is, until you delve into the murky world of money laundering.

It’s not just the odd bung to a dodgy minister that’s being facilitated by UK-based shell companies. Three years ago, the poorest country in Europe was nearly bankrupted after an estimated $1bn – an eighth of Moldova's GDP – was stolen from three of its banks.

Secretive Scottish companies were found to be at the heart of the vast scam, and since then the stories have piled up – the same type of shell firm being implicated in organised crime, money laundering, and most recently, KGB investigations into Belarussian corruption. The lurid details of the dealings stand in contrast to the addresses where the companies are registered – nondescript tenements and ex-council flats across Scotland.

It’s a bizarre situation, partly explained by the fact that a UK address – say, in Edinburgh or London – gives a veneer of respectability. Your legal “partner” can be registered offshore, thereby avoiding tax liability in the UK – and with it, scrutiny.

You can name your company after some Scottish island, or a prestigious Mayfair street, and cover up the fact that it’s just one of many off-the-shelf firms, barely answerable to anyone and providing the ideal vehicle for those who want their dealings to remain hidden. Hundreds, if not thousands, of such companies could be registered at a given address; sometimes the tenants aren't even aware.

The problem exists across the UK, particularly in London – but due to an odd quirk of law, two-thirds of all of the opaque corporate entities in the UK are Scottish Limited Partnerships (SLPs), which do not have to disclose their accounts or name the people who control them. This, quite obviously, makes them an attractive set-up for all manner of fraudsters, money-launderers and criminals – though of course, they are used by many legitimate businesses, too.

Since 2008, the number of SLPs has exploded, trebling between 2012/13 and 2015/16. Company creation agencies were found to be advertising SLPs across Eastern Europe as “zero tax” vehicles in an “offshore zone”. Green MSP Andy Wightman spoke of Scotland’s “shameful reputation as a place to launder money” in a 2016 parliamentary debate; Labour’s Hugh Henry had warned of the danger early in 2015. The slow wheels of reform began to grind into action.

Company formation law is reserved to the UK parliament in Westminster, so the task of pursuing this reform fell to MPs. One in particular, the SNP’s Roger Mullin, had only been in the job a few weeks when the Moldova story broke. Over the next two years, working closely with journalists and campaigners, Mullin raised the issue repeatedly, getting the attention of the Home Office, Treasury, and the Department for Business, Energy and Industrial Strategy (BEIS). He has since lost his Kirkcaldy and Cowdenbeath seat, but in two short years managed to shift the government on the issue. A review is forthcoming from BEIS, and emergency legislation was recently enacted to force some 30,000 SLPs to disclose their real owners.

Asked what pushed him to work so relentlessly on the issue, Mullin says it dates back to a job as academic adviser to the Scottish Police College. “I became aware that they were pursuing low-level crime, but the really big stuff was difficult to make headway on,” he explains.

“When I realised these vehicles [SLPs] were being used for criminal purposes, in large numbers, by very powerful criminal elements – well, I thought it was utterly astonishing that it hadn’t been pursued in parliament from any quarter”.

Pursuing the issue laid bare some of the ideological tensions in the government, Mullin says. While some ministers were shocked by the evidence put forward – the links between SLPs and the arms trade, child pornography, corrupt dictators and all manner of organised crime – and wanted to take action, others were “more concerned about deregulation than about stopping financial wrongdoing”.

This new evidence came largely from investigations in the Scottish Herald newspaper by David Leask. Off-the-shelf companies registered in Scotland were identified not just in the Panama Papers expose, but in the Global Laundromat too – one of the biggest criminal conspiracies in recent history.

Somewhere between $20bn and $80bn was stolen from Russia and laundered through a vast network of shell companies – and SLPs were implicated in $5bn of that. This great heist, just like the Moldovan one, was essentially theft from ordinary taxpayers, with serious consequences.

Mullin warns that the new law brought forward by the UK government is unlikely to be watertight. “People will be looking for loopholes right now, looking for ways to avoid revealing the owners’ identities”, he predicts.

Ian Fraser, journalist behind the Moldova-Scotland story, agrees, but adds: “It’s encouraging that they’re doing anything at all. For a while, under [David] Cameron, they were turning a blind eye. However, when these sorts of vehicles are freely available to all and sundry, and Companies House remains toothless in terms of regulation, it basically means Britain is aiding and abetting crime, fraud and money laundering, on a massive scale – and it’s impoverishing countries like Moldova.”

For people like Fraser and Mullin who research this murky world, the hypocrisy of UK leaders like Cameron seems bottomless. “We’ve got the leaders of some fantastically corrupt countries coming to Britain,” the former prime minister famously remarked to the Queen ahead of a world summit. He could have looked a little closer to home for examples.