The mastermind of a $1.8 million cryptocurrency heist admitted to the robbery Wednesday in exchange for a decade in prison.

Louis Meza, 35, copped to first-degree grand larceny and second-degree kidnapping in Manhattan Supreme Court and is expected to be sentenced on Sept. 27 to 10 years behind bars and five years of post-release supervision.

“Louis Meza orchestrated a 21st-century stick-up,” said Manhattan District Attorney Cyrus Vance Jr. in statement. “Then 21st-century investigators brought him swiftly to justice, securing a landmark conviction in an undeveloped area of the law.”

Meza — along with the help of three co-defendants whose cases are still pending — hatched the Nov. 4, 2017, scheme.

The men held the unnamed victim captive in a van for two hours while they stole his memory stick and used it to move the Ether currency into an account they controlled.

The cyber crooks allegedly pointed a BB gun at the victim and covered his head with a hood, but the shaken man broke free and was able to call 911, according to prosecutors.

The funds were fully recovered and returned to the victim, authorities said.