1AM Tests Midnight Proof Generation on the iPhone GPU

A developer demonstrated local proving on a physical iPhone. In a separate test on an M4 Max Mac, GPU acceleration cut the time to prove a shielded spend by 29%.

By SongMarketCap

Updated:

Midnight News - 1AM Tests Midnight Proof Generation on the iPhone GPU

On November 20, developer Seungheon Oh showed an iPhone generating a Midnight zero-knowledge proof on the network’s Preprod test environment. Hours later, 1AM announced that it had added GPU proving to a development branch of its mobile wallet software. The demonstration and the benchmark answer two different questions for wallet developers: the software ran on a phone, and on a Mac, the team measured how much time the GPU saved.

What the iPhone Does Before a Transfer

For someone sending a shielded token, generating the proof is one step between tapping the wallet screen and submitting the transaction. The wallet uses private information to establish that the spend meets the protocol’s rules. Once the proof is ready, the network can check it without seeing the private inputs used to produce it. A wallet that generates the proof locally can keep those inputs on the phone throughout the calculation.

Webisoft, which builds 1AM, already documents local proving on iOS and Android in its experimental mobile package. Oh’s adaptation uses Metal, Apple’s interface for running calculations on its graphics processors. It gives the phone’s GPU part of the mathematical work involved in constructing a proof. Oh described support for shielded transfers and smart contract operations. Charles Hoskinson shared the demonstration later that evening.

The mobile package also describes what happens outside the prover. The application supplies the circuit files and parameters needed to generate the proof, and the prover reads them from the device. The wallet can still use a remote service to submit the completed transaction and check its status. A shorter proving time reduces the wait before submission. The network then has to process and confirm the transaction.

Where the GPU Saved Nearly Half a Second

The benchmark notes accompanying commit ec703a7 identify the hardware behind 1AM’s announcement. The prover ran with four threads on a Mac with an M4 Max chip. For a shielded spend, enabling the GPU brought proving time down from 1.60 seconds to 1.14 seconds. That saved 0.46 seconds on a single proof. Generating a shielded output took 0.85 seconds, down from 1.10 seconds, a reduction of about 23%.

The notes also record a run in the iOS simulator, where proving time fell from 1.52 seconds to 1.27 seconds. The simulator uses the host computer’s hardware. Oh’s video demonstrates execution on a physical phone, but it gives no model number or side-by-side timings with acceleration enabled and disabled. How much time the feature saves on a particular iPhone remains unmeasured in the published benchmarks.

Tests on a different machine illustrate why the type of proof matters. In the discussion on Hoskinson’s proposed changes to Midnight’s proving library, a contributor using the name mmahut reported 154 confirmed contract-call transactions across nine Compact circuits on Midnight Preview. On an NVIDIA GB10, one larger circuit took 2.97 seconds to prove, down from 7.67 seconds on the CPU. For the smallest circuit, the CPU finished five milliseconds ahead of the GPU.

[NEWSBREAK]

From a Development Branch to a Wallet Release

Wallet developers already have another option for workloads that are expensive to run on a phone. The Midnight Foundation and BCW Group worked with Google Cloud on a service that generates proofs in a protected cloud environment. Google Cloud identified Lace as a wallet integration for which verifying the software running in that environment helped meet a security requirement. Local GPU proving gives a developer the option to keep that calculation on the user’s device.

Hoskinson’s proposal in midnight-zk includes CUDA support for NVIDIA hardware and a Metal implementation for macOS. It remains a draft, with an independent audit underway.

Webisoft’s iPhone implementation is in the separate feat/ios-metal-prover branch and requires iOS 18 or later. As of November 21, the feature was available in development code. 1AM described its arrival in the wallet app as “coming soon” and gave no release date.