# Serialize the bootstrap key

**URL:** <https://openfhe.discourse.group/t/serialize-the-bootstrap-key/433>\
**Category:** Library Questions\
**Created:** [March 27, 2023, 12:55pm UTC](https://openfhe.discourse.group/t/serialize-the-bootstrap-key/433 "2023-03-27T12:55:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Florent](https://avatars.discourse-cdn.com/v4/letter/f/e19b73/32.png) [@Florent](https://openfhe.discourse.group/u/Florent)\
**Post date:** [March 27, 2023, 12:55pm UTC](https://openfhe.discourse.group/t/serialize-the-bootstrap-key/433/1 "2023-03-27T12:55:51Z")

</div>

Hi,

The OpenFHE repository has great examples for serializing the keys used in leveled mode for [CKKS](https://github.com/openfheorg/openfhe-development/blob/main/src/pke/examples/simple-real-numbers-serial.cpp), [BGV](https://github.com/openfheorg/openfhe-development/blob/main/src/pke/examples/simple-integers-serial-bgvrns.cpp), and [B/FV](https://github.com/openfheorg/openfhe-development/blob/main/src/pke/examples/simple-integers-serial.cpp), which are super useful for separating the client and server side of an application.

Is it possible to do the same for the bootstrap keys (like those generated in [this example](https://github.com/openfheorg/openfhe-development/blob/main/src/pke/examples/simple-ckks-bootstrapping.cpp), line 125)?

Thanks!

---

<div class="post-metadata">

**Author:** ![saroja](https://avatars.discourse-cdn.com/v4/letter/s/eada6e/32.png) [@saroja](https://openfhe.discourse.group/u/saroja)\
**Post date:** [April 4, 2023, 4:31pm UTC](https://openfhe.discourse.group/t/serialize-the-bootstrap-key/433/2 "2023-04-04T16:31:40Z")

</div>

We don’t currently have an API to serialize bootstrap keys. We’ve added an issue: [Add API for serializing bootstrapping keys · Issue #353 · openfheorg/openfhe-development · GitHub](https://github.com/openfheorg/openfhe-development/issues/353)

---

<div class="post-metadata">

**Author:** ![ypolyakov](https://yyz1.discourse-cdn.com/flex031/user_avatar/openfhe.discourse.group/ypolyakov/32/47_2.png) [@ypolyakov](https://openfhe.discourse.group/u/ypolyakov)\
**Post date:** [April 6, 2023, 3:46pm UTC](https://openfhe.discourse.group/t/serialize-the-bootstrap-key/433/3 "2023-04-06T15:46:14Z")

</div>

The “bootstrapping key” can already be serialized by serializing the `EvalMult` and `EvalAutomorphism` keys (see [openfhe-development/simple-real-numbers-serial.cpp at main · openfheorg/openfhe-development · GitHub](https://github.com/openfheorg/openfhe-development/blob/main/src/pke/examples/simple-real-numbers-serial.cpp) for an example). But a more convenient way would be to do it using a single API call, as @saroja suggested.

---

<div class="post-metadata">

**Author:** ![Florent](https://avatars.discourse-cdn.com/v4/letter/f/e19b73/32.png) [@Florent](https://openfhe.discourse.group/u/Florent)\
**Post date:** [April 6, 2023, 4:11pm UTC](https://openfhe.discourse.group/t/serialize-the-bootstrap-key/433/4 "2023-04-06T16:11:36Z")

</div>

Great! Thanks @saroja and @ypolyakov for having looked at that!
