The nation-state system is essentially a peace treaty. Before nations we had a system of local feudal warlords, baronies, castles, and free cities, all of whom had their own religious identities, allegiances, enforcement mechanisms, local power structures, etc. The Peace of Westphalia ended an exceptionally bloody 130 years in European history, where nearly constant warfare killed about 8 million people.
This might be instructive for what could create a system of digital citizenship. We'd have to enter another period of essential total anarchy and worldwide warfare, where the power relations of the nation-state system break down and basically everybody kills everybody else. Then a "digital country" would need an enforcement mechanism to prevent its "digital citizens" from getting killed by randos they meet on the street.
We might actually be headed there - I think the mass migrations triggered by the climate crisis, coupled with general economic shortages, might tip us over into a global scale war similar to what's happening in Syria or Yemen right now, and new technologies like drones and robots would grant sovereignty to digitally-connected people wherever they go. I could envision a future similar to Neal Stephenson's The Diamond Age, where there's a Common Economic Protocol that basically guarantees a stable currency, enforcement of contracts, economic freedom, and terms of trade. Violation of the CEP is automatically punishable by a drone (nanobot in the book) coming and vaporizing you. Everything we know of as culture - social rights and responsibilities, rituals, beliefs, values, etc. - gets relegated to autonomous "burbclaves" within each city, where citizens with a common interest ("phyles") interact accordingly to rules of their culture. Most phyles have worldwide scope, but within a city would largely keep to the local burbclave.