# Bootstrapping AutomorphismKey keys exceeds maximum protobuf size of 2GB

**URL:** <https://openfhe.discourse.group/t/bootstrapping-automorphismkey-keys-exceeds-maximum-protobuf-size-of-2gb/505>\
**Category:** Library Questions\
**Created:** [April 29, 2023, 7:10pm UTC](https://openfhe.discourse.group/t/bootstrapping-automorphismkey-keys-exceeds-maximum-protobuf-size-of-2gb/505 "2023-04-29T19:10:38Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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 29, 2023, 7:23pm UTC](https://openfhe.discourse.group/t/bootstrapping-automorphismkey-keys-exceeds-maximum-protobuf-size-of-2gb/505/2 "2023-04-29T19:23:17Z")

</div>

First, I want to confirm. Are you serializing each automorphism key separately or you are trying to serialize the full map (all keys) at once? You would need to use the former approach.

One automorphism key requires roughly 16 \ell d\_{num} N\left(1 + \frac{1}{d\_{num}}\right) bytes, where \ell is the number of RNS limbs (close to multiplicative depth), d\_{num} is the number of digits in hybrid key switching (by default set to 3), and N is the ring dimension (using 2^{16} or 2^{17}). You can estimate the size of each key for your setting from this. It should not be higher than 1GB for all practically reasonable settings.

If you need more granular serialization, you could serialize each `DCRTPoly` separately (size is reduced by 2 \ell \left(1 + \frac{1}{d\_{num}}\right)). You would need your custom serialization logic for this.

---

_[View the full topic](https://openfhe.discourse.group/t/bootstrapping-automorphismkey-keys-exceeds-maximum-protobuf-size-of-2gb/505)._
