When NASA's Butch Wilmore and Suni Williams launched to the International Space Station in June on the first crewed test flight of Boeing's Starliner spacecraft, they were supposed to return to Earth roughly a week later, nearly five months before the US presidential election. 

But after the space agency deemed the capsule too risky to take them home — and decided Wilmore and Williams would stay in space until 2025 — the two veteran astronauts will now be floating more than 200 miles (322 kilometres) above their nearest polling place on Election Day in November.

As with so many things in the fickle world of spaceflight, NASA already had a contingency plan in place for this exact scenario. Thanks to a special Texas law, the two astronauts will still be able to perform their civic duty, voting absentee from low-Earth orbit.

"It's a very important duty that we have as citizens and I'm looking forward to being able to vote from space, which is pretty cool," Williams told reporters during a September 13 news conference from the space station.

"I sent down my request for a ballot today," Wilmore said at the news conference. "It's a very important role that we all play as citizens to be included in those elections, and NASA makes it very easy for us to do that."

American astronauts have been able to cast ballots from space ever since the Texas Legislature passed a bill in 1997, expanding the Texas Election Code to include "a person who meets the eligibility requirements of a voter… but who will be on a space flight during the early-voting period and on election day."

That year, NASA astronaut David Wolf became the first American to "vote while you float" during his four-month mission aboard Russia's Mir Space Station.

Since then, multiple astronauts have cast ballots from space, including now-retired NASA astronaut Leroy Chiao in 2004.

"When I left to go launch on my mission in October, I suddenly realized I hadn't put in for an absentee ballot and I hadn't made any arrangements. So I quickly asked NASA, 'Hey, can I vote from the station?' And they said 'Oh yeah, we have a process in place. No problem,'" Chiao told CNN. "And it turned into a great kind of public service announcement, for me to send down messages encouraging people to go out and vote."

Ballots cast in space get beamed to Earth the same way most data is transmitted between the space station and mission control — through NASA's Near Space Network, a constellation of satellites in space that communicate with antennas on our planet.

"It's actually pretty simple," Chiao said. "Basically, an encrypted word document will be sent up to their email addresses and they can then open the document with their password."

After Wilmore and Williams fill out their electronic absentee ballots, the forms "will be encrypted and uploaded into the space station's on-board computer system," according to NASA. From there, the ballots will flow through a tracking and data relay satellite to a ground antenna at the NASA White Sands Test Facility in Las Cruces, New Mexico. The space agency will then transfer the ballot to mission control in Houston and then to the county clerk responsible for processing the ballots.

Like most US astronauts, Wilmore and Williams live near NASA's Johnson Space Center in Texas' Harris County, where election officials confirmed to CNN that they are working with the space agency to send the astronauts their ballots on Saturday.

"Before sending the astronauts their ballot, a test ballot with a unique password is sent first," said Rosio Torres-Segura, a spokesperson for the Harris County clerk. "Crew member-specific credentials allow the astronauts access to a secure ballot. After a successful test, the secured ballot is sent as a fillable document so the astronauts can make their selections, save them, and send them back. Once the astronauts vote their live ballot, it is returned, printed, and processed with other ballots."

Wilmore and Williams' ballots will arrive on Earth about five months before they do. The two astronauts will hitch a ride home on SpaceX's Crew Dragon spacecraft in February 2025.