President Barack Obama. Getty Images President Barack Obama considered minting the coin.

On "Pod Save America," a podcast from Crooked Media, the new media startup featuring former Obama staffers and speechwriters, Obama was asked what the "scariest moment" of his presidency was.

"I think it was the moment when it seemed that John Boehner didn't seem to generate the votes to make sure the US didn't default on our debt," Obama said, referring to the former House speaker. "We had to start drafting a speech."

Obama told the podcast that, amid the possibility of a government shutdown and default that would most likely have lowered the US's credit rating, the administration was considering numerous options to avoid the shutdown and deal with the national debt. One of the ideas floated, Obama said, was having the US Treasury mint a coin worth $1 trillion to pay off a good portion of the debt.

"We were having these conversations with Jack Lew and others about what options in fact were available, because it had never happened before," Obama said. "There were all kinds of wacky ideas about how potentially you could have this massive coin."

Obama's idea of the coin may be a bit different from what others discussed at the time. As Bloomberg's Joe Weisenthal (who we should note was fascinated by the idea while at Business Insider) noted on Twitter, you in theory could just mint any size of coin and declare it worth $1 trillion. Obama, however, said he imagined it much larger.

"It was some primitive ... it was out of the Stone Age," Obama told the hosts. "I pictured rolling in some coin."

Obama did go on to explain the technical discussion behind the coin.

"There was this theory that I had the authority to issue through the mint this massive $1 trillion coin and on that basis we could try to pay off US Treasurys," Obama said. "It was a very realistic possibility that we couldn't get the votes for that and we couldn't get those debts rolled over and we would be in a situation where were technically in default. At that point you were in uncharted territory."

Obama said the night was fraught as well because they were discussing the legality of the actions that he might take to avoid defaults and the possibility of getting sued by investors holding US bonds.

"In addition to talking to Jack Lew and my speechwriters about a speech, there were also questions about whether any actions that I took might be violations of the law," Obama said. "So we had to be talking to lawyers about potential challenges and legal actions and lawsuits from bondholders around the world. It wasn't my favorite night."

Check out the full discussion at the Crooked Media site.