Deciding on a post-Brexit border between Northern Ireland and the Irish Republic is foxing the brightest brains in the UK government.

British ministers are trying to find a solution that provides a border flexible enough to protect trade and commerce between the two countries and which doesn’t undermine the spirit, or the letter, of the Good Friday Agreement settlement. It’s proving a tall order.

The British minister in charge of exiting the European Union, the veteran Conservative politician David Davis, has been suggesting there could be a ‘digital border’ – a light-touch arrangement with security cameras and pre-registered cargo as a preferred alternative to a ‘hard border,’ a return to checkpoints and watchtowers.

However, Davis’s suggestion has been scotched by the new Irish foreign minister, Simon Coveney, who says electronic solutions are ‘not going to work.’ The London Times led with a story the other day quoting Coveney that ‘any barrier or border on the island of Ireland in my view risks undermining a very hard-won peace process’ and that there is a need to ensure the ‘free movement of people and goods and services and livelihoods.’

Brexit: Coveney appears to rule out electronic tagging on Irish border https://t.co/FvQBFvhP5s

— BBC Newsline (@bbcnewsline) July 17, 2017

His boss, new Taoiseach Leo Varadkar, is now playing hardball with Theresa May’s government, bluntly stating that his government would not be ‘design[ing] a border for the Brexiteers.’ This is a major setback for the British, who had thought that dealing with the Irish border issue was the easy part of quitting the EU.

Taoiseach Leo Varadkar properly letting rip here: "We're not going to design a border for the Brexiters..." https://t.co/m4ytNapxxc

— Simon Nixon (@Simon_Nixon) July 28, 2017

This very public rebuff by the Irish matters because the EU’s chief Brexit negotiator, Michel Barnier, has made dealing with the border one of his top three priorities before discussions on trade deals can begin (the others are the amount Britain will pay the EU for its ‘divorce,’ and guarantees about the rights of EU nationals living in the UK and vice versa). Britain is desperate to move the discussion to trade so ministers are soon going to have to make-up their minds which one of four unpalatable options they are going to choose.

The first is to ignore Dublin (and just about everybody in Northern Ireland for that matter) and institute a hard border along the 310-mile demarcation between Northern Ireland and the Irish Republic. Given that the border cuts through fields, rivers and forests, it would be unenforceable without a Trump-style wall. More practically, it would devastate trade and free movement and be a powerful symbol of division and entirely contrary to the spirit of the Good Friday Agreement.

Meanwhile, the Police Federation in Northern Ireland – which represents rank and file officers – has warned it would make police officers ‘sitting ducks for terrorists.’ Furthermore, the Irish Government will never agree to this course and, with the EU in their corner, there is effectively zero chance of this happening.

The second option is to keep Northern Ireland inside the EU: offering it so-called ‘special status.’ This would avoid the difficulty of enforcing the border and even accord with the wishes of 56 percent of the Northern Irish electorate who voted to 'Remain' in the EU. Crucially, it would enable Northern Ireland to retain the £600m a year it currently receives from the EU in funding. This idea is pushed by Sinn Fein and it does make a lot of sense, but it would be a massive embarrassment for the British Government and lead to Scotland (and possibly London) demanding similar deals.

The third option is that suggested by the Irish government, namely a soft border with customs and passport controls at embarkation points on the island of Ireland, using the Irish Sea as a hard border (or certainly a wet one). Again, Unionists will be unhappy as it requires Britain to treat the island of Ireland as a single entity with border and possibly customs checks at ports and airports. There is a neat, administrative logic to it, but it means people traveling from Northern Ireland to ‘mainland’ Britain would need to show their passports, which will enrage unionists as it effectively makes them foreigners.

Unpalatable as that would be for them, the fourth option is simply to recognize that Northern Ireland is now utterly anomalous and start a proper conversation about Irish reunification as a means to address the border issue once and for all. This would see both governments acting as persuaders to try and build consent and accelerate trends to reunify the island constitutionally.

This would involve twin referendums in both Northern Ireland and the Republic (a measure allowed for in the Good Friday Agreement). Given Philip Hammond, the British Chancellor of the Exchequer, is warning that transitional arrangements for leaving the EU might last three years after Brexit in 2019, the votes would not need to be held until the early 2020s.

Demographic trends already point to a Catholic-nationalist majority in Northern Ireland by then anyway, which under the Good Friday Agreement already requires a vote on Northern Ireland’s status be held.  So, there is a golden opportunity to make ‘necessity the mother of invention’ and use Brexit to bring Northern Ireland’s position to a head and deal decisively with the matter once and for all.

It would be deeply ironic if the British Conservative party – once a redoubt of hard-line unionism – now became the midwife to Irish reunification. However, this might be the practical solution to dealing with this Brexit conundrum.

What are the solutions for the border with Northern Ireland post Brexit? pic.twitter.com/KUXIdtW6dF

— brian lucey (@brianmlucey) July 31, 2017

* Kevin Meagher is a former special adviser at the Northern Ireland Office and author of ‘A United Ireland: Why unification is inevitable and how it will come about’ published by Biteback.