Serialize and Deserialize between wasm and python

Hello,

I comprehend that the WebAssembly (openfhe-Wasm) library is still under development and may not be fully stable. In my usage, I employed the Wasm library to serialize ciphertext, but encountered an error when attempting to deserialize it using a openfhe-Python library. The specific error message reads:

RuntimeError: Error while trying to deserialize a polymorphic pointer. Could not find type id 169877536.

Could you kindly assist me in comprehending the root cause of this issue and resolving it? Your assistance would be greatly appreciated.

Thank you in advance.

Thanks. The wasm bindings are not fully functional yet. So it is possible there is an issue with serialization.

Something to check. Are you using the same OpenFHE version for both Python and WASM bindings? Are you using the same format, i.e., JSON or binary? The error seems to imply that the serialization formats are different (maybe a different version of OpenFHE is used?).

The problem occurred during serialization because I inadvertently passed “BINARY” as a string instead of using the correct format, which should have been something like “module.sertype.BINARY”. Additionally, I ensured that both instances of the openfhe library were the same version to avoid compatibility issues.

Thank you