Skip to content

Commit a26da0e

Browse files
authored
Merge pull request #3354 from o1-labs/florian/deserialise-wasm-proof
Add `deserialize` for `WasmProverProof`
2 parents 1e57024 + de01606 commit a26da0e

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
110110

111111
### [plonk_wasm](./plonk-wasm)
112112

113-
#### Changed
114-
- (No changes in current release)
113+
114+
- Add function to `deserialize` a `WasmProverProof`
115+
([#3354](https://github.com/o1-labs/proof-systems/pull/3354))
115116

116117
### [poly-commitment](./poly-commitment)
117118

plonk-wasm/src/plonk_proof.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -620,6 +620,15 @@ macro_rules! impl_proof {
620620
// Deprecated used on purpose: updating this leads to a bug in o1js
621621
base64::encode(serialized)
622622
}
623+
624+
#[wasm_bindgen]
625+
#[allow(deprecated)]
626+
pub fn deserialize(s: &str) -> WasmProverProof {
627+
let bytes = base64::decode(s).unwrap();
628+
let proof: ProverProof<$G, OpeningProof<$G>> = rmp_serde::from_slice(&bytes).unwrap();
629+
// Deprecated used on purpose: updating this leads to a bug in o1js
630+
WasmProverProof::from((proof, Vec::new()))
631+
}
623632
}
624633

625634
#[wasm_bindgen]

0 commit comments

Comments
 (0)