Ballots are too easily misplaced or forgotten, especially ballots sent by mail. There’s a solution that can ensure every vote is counted: blockchain technology.

Many Americans cast ballots wondering if their votes will actually count. For overseas voters from Canyon County, Idaho, in the recent midterm elections, this wasn’t merely speculation: it was a reality. Their ballots were forgotten on Election Day.

The forgotten ballots were placed in a separate box as they arrived in the days preceding the election. On Election Day—not out of malfeasance but simple oversight—the box was overlooked. Election officials discovered it when they returned the next day, but only after all precincts had reported their election results and candidates had made concession or victory speeches. The ballots were finally tabulated on November 13, one full week after Election Day.

Thankfully, these ballots were counted before the county commissioners certified the final vote tally. Yet this election incompetency is symptomatic of a major problem with the American voting system, from this rural Idaho county to Florida’s densely populated Broward County. Ballots are too easily misplaced or forgotten, especially ballots sent by mail. There’s a solution for our elections that can ensure every vote is counted: blockchain technology.

Blockchain made its public debut as the technology underlying the cryptocurrency Bitcoin. Quite simply, blockchain is an electronic means of making and storing a record whenever a transaction is made. Each transaction made on a blockchain network is stored as a block of data that every individual on the network can see and no one can change.

For Bitcoin, this means that no one can trade a token they do not own. For voting, this means that no one’s vote will be forgotten or tampered with.

There’s real-world evidence showing that it works. West Virginia just completed the first trial of a blockchain election in the United States. American citizens casting their ballot from overseas—the same group of voters whose ballots were forgotten in Canyon County—were allowed to use a blockchain application to submit their ballots in the midterm election.

Overseas voters had to verify their identity with a government ID and facial scan on their smartphone in order to receive a copy of the ballot from their home precinct. Once they submitted their ballot, it was uploaded to the blockchain network and tabulated with the rest of the votes on Election Day.

This pilot project was billed as a success by the West Virginia secretary of state’s office. Certainly, it was more secure and anonymous than the emails many now use to submit their ballots.

While this was the first time blockchain has been used in a U.S. federal election, it wasn’t the technology’s first use in voting procedures. More than 1.7 million votes have been cast for the Rock and Roll Hall of Fame using blockchain. Private enterprise has proved willing to trust blockchain with high stakes: in 2017, a NASDAQ subsidiary used blockchain to conduct shareholder voting for a $275 million international banking group. A municipality in Switzerland used blockchain for a local referendum, and in each instance, participants deemed blockchain voting a success.

Blockchain technology can protect the privacy, security, and safety of all ballots cast in an election. Votes remain private and anonymous, since only a voter can see a copy of his or her ballot using a private key or access code. The vote can be secure from tampering end-to-end. Facial ID or a thumbprint might be used when a voter casts his ballot. Once the ballot is cast, even if well before Election Day, it would be put into a sort of electronic lockbox, where it could not be viewed until it is counted.

Safety is ensured through decentralized storage of the vote tally. Any time a vote is cast, records can be backed up in multiple locations—county election offices, with state election officials, and more.

We live in an era of where many worry about Russia’s ability to hack the voter rolls and swing our elections in their favor. To prevent foreign or domestic interference, many have advocated for eliminating electronic machines from our election process, but that would be a step back in time. We should take a step forward, and use blockchain as the tool to protect us from the very real risk of hacking.

With a blockchain database, hackers would have to penetrate each and every computer on the network, rather than just a single computer. If hackers tried to make a change, there would be a permanent record of that change and every other computer would be notified of the breach.

Blockchain networks are not completely immune from hacking. Security will have to continually improve. But there is no perfect election process that guarantees total security, convenience, cost, timeliness, and anonymity. Paper ballots—the Holy Grail for many election security analysts—are prone to their own problems, such as simply being forgotten, as in Canyon County. Blockchain allows us to step into the digital realm and improve many features of our election process without compromising security, as many other digital advancements would.

This step forward is needed. During the 2016 presidential election, I was one of nearly 300,000 Americans who tried to cast my vote from overseas but was unable to do so. Submitting my ballot from the Middle East to be counted in Alaska was no easy task. I can attest that the absentee process can be a nightmare for overseas voters. Blockchain provides an opportunity to reform this cumbersome process and secure our elections against both foreign and domestic threats.