I’m in a van with three pirates, and we’re pillaging snacks from all the major political parties in Iceland. It’s 27 April, election day in Reykjavík, and the months of campaigning are over. The parliamentary candidates of the Pirate Party have nothing to do except drive around the various party headquarters appropriating cake and crisps. They prefer to call it “challenging the antagonism of the current political climate”. By dropping in on rival parties. And taking their food.

“This is taxpayer-funded, so actually it’s already my food,” says Kristjan, a huge, jolly, bearded technologist who is running as a candidate in Reykjavík. He slips a choc ice into his pocket as we say goodbye to the centrist Progressive Party, with its impressive spread of smoked-tongue pavlova. Next, we’re off to see the Social Democrats, who may or may not have coffee. There are 15 parties running in what may be the oddest national election Europe has seen in decades, so we’re unlikely to go hungry.

Iceland is a little human crucible bubbling away in the middle of the north Atlantic, and an experiment in how to build and run a modern democracy. For most of the past 30 years, it embraced aggressive free-market capitalism. Then its banks failed, its population lost faith in conventional politics, and it began to be an experiment in something else entirely. Desperate people across the eurozone cling to the fairy tale of Iceland as a plucky country holding out against austerity – but Icelanders see things differently.

In this election, the main choice seems to be between the centre-right parties that led the country into economic disaster and the leftgreen coalition that failed to lead it out again. Now fringe parties and protest groups are appearing to fill the ideas vacuum. Of these newcomers, the Pirates – a disparate group of hackers, anarchists and digital rights campaigners – are by far the most interesting. Elsewhere in the world, internet activists such as the hacker Andrew “Weev” Auernheimer, the late Reddit co-founder Aaron Swartz and many others have been prosecuted and imprisoned for fighting for freedom of information, but these ones are about to get into parliament.

“I’ve been disillusioned with politics for a long time, and I didn’t really feel anything would change,” says Bjarni Einarsson, a Pirate Party candidate who has the thick glasses and wacky hairstyle of trendy geeks from here to Hackney. Einarsson, like almost everyone I meet, no longer believes in party politics.

So why is he running for parliament? “Because I believe in the issues,” he says, “and I know now that if we have just one or two people in parliament they can sponsor bills and propose changes, make improvements.”

The first thing you have to understand about Iceland is that it’s tiny. The population is just over 320,000, which is about the same as Reading’s, and two-thirds of them live in the capital, Reykjavík, which is about the size of Southend. Before the banking crisis, American investment, exploitation of natural resources and the expansion of the financial sector had transformed Iceland from one of the poorest nations in Europe to one of the richest in the space of 50 years. It’s small enough that the best way to meet and interview a member of parliament is to hang around in a trendy bar in downtown Reykjavík and wait for one to turn up at the next table. It’s small enough that this happened to me twice during a four-day trip. Oh, and about 0.3 per cent of Icelanders are personally running for parliament this year.

Iceland has always been a land self-authored in myth and legend. Its lava fields and glacial plains are supposedly populated by elves, trolls and huldufólk – hidden folk – in whom 80 per cent of the population believes. At least, that’s what the PR for Icelandair wants you to think, because that’s what’s written on the useless napkins handed out in economy class on the red-eye to Reykjavík. In fact, it turns out that only 30 per cent of the population believes that fairies exist, although that third is prepared to agitate for roads to be diverted around their supposed homes. This is remarkable enough that one wonders why the tourist board bothered to exaggerate.

The story of Iceland’s curious political situation is another folk tale that was already fascinating before it was blown out of all proportion. What most of the world appears to believe is that, some time between 2008 and 2009, the country refused to bail out its banks when the global economy crashed and that instead it jailed all of its bankers, overthrew the government, wrote a new constitution on the internet and elected a lesbian prime minister who solved all the nation’s problems with a flick of her magic wand. In this global era of enforced austerity, people want to believe this so much that they get angry when friends who live in Iceland disabuse them of the fantasy.

Johanna Sigurdardottir at her election in 2009. Photo: Getty

Here’s what actually happened. Although it is true that the three largest banks –Glitnir, Kaupthing and Landsbanki – were allowed to go bust in 2008, this was hardly a political choice: Iceland could do nothing else, because their debts were ten times the size of its GDP. It is also true that popular protest brought about a change in power. Demonstrations over the government’s handling of the crisis, particularly its promises to the IMF to repay the financial sector’s enormous debts to countries such as the UK and the Netherlands, started in 2008. On 20 January 2009, the usually reserved Icelandic people turned out on to the streets in their thousands, bashed kitchen utensils and threw fruit and yoghurt at the Althingi, the parliament building. They were demanding a change of government.

They got one. Referendums were promptly held on whether to repay foreign debts, and the state began to draw up a new constitution in consultations with the public that included garnering responses on Facebook. But then, the new administration tried to side with the IMF over the debts of the online bank Icesave and refused, in effect, to implement the constitution Icelanders had been promised. So much for the socialist utopia.

Nor are all the bankers in jail: at least one of them is running for parliament. Thrinn Guð - jónsson of the Dawn party, a small left-ofcentre splinter group, did “risk management at Icebank” before the financial crash. Guð - jónsson’s job “was actually to confirm that there was no risk to us, to the bank. In retrospect, I should have thought more about whether or not there was a risk to the nation,” he says. Standing as a political candidate for a tiny party with little hope of election seems, for Guðjónsson, to be a way of voicing his exasperation with his old way of thinking, which he has abandoned along with his old job: “Now I have a bed and breakfast and I grow organic vegetables.”

I meet him on election day, driving around with the Pirates trying to blag dinner. The Dawn party has given away almost all of its cake, so we head to the next party headquarters. There we meet Thorsteinn Magnusson, a candidate for the centrist Progressive Party, one of those likely to be back in government before the end of the day. The Progressives rely on the farming and fishing population for their support, and are glad now that their base has abandoned its brief dalliance with the centre left, even though that is as much a symptom of fear as anything else.

Instead of bailing out its leading banks, Iceland devalued the króna and instituted capital controls, and the economy did indeed contract: real wages dropped and unemployment went from 1.6 per cent before the crash to a peak of 9.3 per cent. But it has now come down to roughly 5 per cent and the economy is slowly growing again.

Where Iceland did break the rules, however, was in choosing to force the banks’ losses on to their creditors, including billions owed to Britain and the Netherlands. The IMF attempted to force Iceland to repay this debt, and the new, nominally left-wing government agreed. But the people of Iceland rejected any such deal.

The message that most of the country took away from this was that the parliamentary left, just like the parliamentary right, could not be trusted not to kowtow to the banks. The share of the vote for the left-green coalition that took over during the country’s supposed revolution has disintegrated. Half of Iceland now wants the old centre-right parties back in power, which, according to Anna Andersen of the English-language magazine Reykjavík Grapevine, is a purely nostalgic vote – like voting for the year 1997. The rest have their pick of the newer, smaller parties.

What Iceland is experiencing is a version in miniature of the democratic crisis that has been felt around the world in the years following the 2008 banking collapse. It is a sense that representative democracy is not working. But the Pirate Party is the only one running on the basis that the entire system is buggered. Its solution is a system of digitally facilitated “direct democracy”, which aims to replace representative, parliamentary demo - cracy with something fairer.

That’s part of the reason I’m following the Pirates around. Another reason is that one of its candidates happens to have offered me a mattress on his floor to sleep on, in a room that smells precisely as you’d expect the bedroom of a 29-year-old hacker who’s running for parliament to smell – a heady mix of pizza boxes, adrenaline and feet.

Smári McCarthy is a digital rights campaigner and ex-member of WikiLeaks. He cofounded the Icelandic Pirate Party because, he says, “the price of criticism is an alternative”. He is one of a number of technological and political innovators who have been active in Iceland for years – this is one of the most digitally connected countries in the world and it was a hub for WikiLeaks in its heyday. There’s an app or a hack for everything here, including a handy iPhone download to stop you from accidentally sleeping with your close cousin (Iceland is such a small place that almost no two people are unrelated within eight generations). McCarthy’s precise words, on hearing that the polls suggest he may be an MP by the following day, are: “Oh, shit. Well, I suppose this was always a possibility.”

McCarthy does politics like a programmer: he amasses piles of relevant information and bombards his opponents with it in a manner that is technically impressive and a little annoying, especially when he’s on television. The Pirates' total dedication to transparency, honesty and evidence-based policymaking is the reason that so many young Europeans find them inspiring, but it's also the reason they might lose this election: telling a lie or compressing a truth to handy slogan-length to win voters would be against their nature, not because they're nice people, but because they're nerds, and nerds are allergic to inaccuracy.

The Pirate Party was built in Sweden in 2006 by hackers and freespeech activists hoping to fight the flood of online censorship bills being enacted in the name of preventing “piracy”. It is now a global movement, with branches in 60 countries and 250 elected representatives, including two members of the European Parliament. Its demographic is young, educated and precariously employed, mostly in programming, with a taste for lots of black clothing. The gender balance at meetings is skewed towards men, although the women the party does have are over-represented in critical roles. Rather than electing official leaders, the Pirates believe in what one campaigner, Alla Ámundadóttir, calls “rough consensus and running code”. It’s all a little bit Occupy Wall Street. If they manage to get elected in Iceland, they’ll have the movement’s first MPs in a national government.

“I’m a Pirate in my heart,” says Jón Thór Ólafsson, 36, one of the movement’s leading candidates. “The Pirates are for freedom and direct democracy. That means that people have the right to participate in decisions that affect them. It changes the rules of the game, and those who have been benefiting from playing the game aren’t very happy about changing the rules.” For someone running against the political mainstream, Ólafsson is a born politician, with a charisma and gift for rhetoric that some of the other Pirates lack – they would far rather build a website than kiss a baby, and that might be to their credit.

“The demand today is for more influence of the people to make decisions that affect them. You see that all around you.” I ask Ólafsson what he means. “Look at the Arab spring. We had revolutions where the demand was for more decision-making in the hands of the people. And in the United States, with the Occupy movement.”

Nearly everybody you meet in Iceland looks like they’re part of the cast of a teenage vampire film, with unearthly good looks and ghostly skin, but Ólafsson in particular could have been grown in a lab set up to produce telegenic politicians and horror-movie heart-throbs. Speaking to him gives you the distinct sensation he’s about to go for your neck. I have no doubt he will be elected.

Democracy, for the Pirates, is something you can build and make better on your computer – something you can hack. “Yesterday we launched a new tool,” Ólafsson says. “We hack the web page of parliament and present their data in an accessible form, so you can see who isn’t showing up for work, who’s skipping class, how they’re voting.” Not everyone is a fan of this strategy. “It sometimes feels like they want to run the whole country like a Ted talk,” says Robert Cluness, a journalist at the Grapevine.

The Pirates have no campaign headquarters, just a favourite downtown café with a cool factor, happy hour, enough ratty sofas to fit ten people with computers and madly expensive bottled beer (alcohol tax was excruciatingly high in Iceland even before the crash). It’s a crowd united by the sense of doing something clever that pisses off the government. Unfortunately, that doesn’t automatically translate into votes. “We have to appeal to farmers about why they should care about the internet, and that’s a tough sell,” says Jason, a strategist for the party.

Ámundadóttir reminds me that what distinguishes the Pirates from other parties is that “we aren’t trying to impress everyone. I’m not afraid to make people angry if I have the right cause. I cannot say something against my heart just to impress the majority.” The Pirates, in other words, are punks – but in a tiny country like Iceland, punks can punch above their weight. In Reykjavík City Hall on election day, hundreds of sleek wooden ballot boxes stand ready to be delivered. Their tops are flipped open so they look like an army of hungry mouths. It’s a numbers game: under Iceland’s proportional system, every party needs 5 per cent of the popular vote to win any seats at all.

The Pirates have been expecting just over that number, which would give them three or four seats out of 63 in the Althingi. They gather at restaurant in town to watch their best-known spokesperson, Birgitta Jónsdóttir, on television, and make use of the free bar to diffuse the tension.

By 3am, the Pirate Party has 4.8 per cent of the popular vote, then 4.85 per cent, then 4.9 per cent. By 4am the tension is unbearable, and drunk rappers and local eccentrics who turn out to be the booked entertainment are running around with tambourines and drums. Smári McCarthy jumps on a chair to direct the Pirates towards a club called Harlem before everyone flips out. Here, it becomes apparent that these people are still 90 per cent Viking; I’ve not been on a more joyfully bloodthirsty dance floor since I was a teenage raver. I end up in the corner watching political candidates fling themselves about to techno. At 9am, the fix is in, and so are the Pirates. Just. The final count is 5.1 per cent.

Three Pirate MPs have been elected to the Althingi. They include Jón Thór Ólafsson and Birgitta Jónsdóttir – the leader the Pirates would have if they went in for that sort of thing. Nobody is in much of a mood for celebration, and that’s not only because everyone has a screaming headache.

Along with the Pirates, large numbers of MPs from the Independence and Progressive parties, the right-wing old guard, were returned to parliament. They will play the leading roles in whatever coalition cabinet is eventually selected, under the stewardship of the Progressive leader, Sigmundur Davið Gunnlaugsson, whose share of the vote almost doubled.

The fairy tale of Iceland as the plucky little anti-austerity utopia is over.

A new generation of politicians is going to have to work out what comes next – not just in Iceland, but all over the world. For the Pirates, that means keeping the grass roots strong, and pushing for more “direct democracy” and for the government to accept the new constitution, which includes safeguards for internet rights.

“We’ll do what we can, and try to have an influence,” says McCarthy, insisting that the Pirates will carry on as before, “working on issues of transparency, access to information, and freedom of speech. That’s not going to change – the only thing that’s changing is the venue, and who pays the bill.”