# About bootstrapping parameters

**URL:** <https://openfhe.discourse.group/t/about-bootstrapping-parameters/2202>\
**Category:** Library Questions\
**Tags:** questions\
**Created:** [October 31, 2025, 5:40pm UTC](https://openfhe.discourse.group/t/about-bootstrapping-parameters/2202 "2025-10-31T17:40:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cappuccino](https://avatars.discourse-cdn.com/v4/letter/c/aeb1de/32.png) [@cappuccino](https://openfhe.discourse.group/u/cappuccino)\
**Post date:** [October 31, 2025, 5:40pm UTC](https://openfhe.discourse.group/t/about-bootstrapping-parameters/2202/1 "2025-10-31T17:40:35Z")

</div>

Hello everyone

I’m working on bootstrapping on CKKS.

I have three questions:

1. How does `levelBudget` work? What are the advantages of having a large `levelBudget` and a small `levelBudget`?

2. As above, what is `bsgsDim`? What is the difference between having a large `bsgsDim` and a small `bsgsDim`?

3. Regarding` static uint32_t GetBootstrapDepth(uint32_t approxModDepth, const std::vector<uint32_t> &levelBudget, SecretKeyDist secretKeyDist)`, I believe `approxModDepth` is the level consumed by the bootstrap. How does it work?

What can I do to improve the precision of bootstrapping?

Thank you in advance.

---

<div class="post-metadata">

**Author:** ![andreea.alexandru](https://yyz1.discourse-cdn.com/flex031/user_avatar/openfhe.discourse.group/andreea.alexandru/32/378_2.png) [@andreea.alexandru](https://openfhe.discourse.group/u/andreea.alexandru)\
**Post date:** [October 31, 2025, 6:36pm UTC](https://openfhe.discourse.group/t/about-bootstrapping-parameters/2202/2 "2025-10-31T18:36:22Z")

</div>

The OpenFHE implementation of CKKS bootstrapping uses the collapsed FFT method from [this paper](https://eprint.iacr.org/2018/1043.pdf) and the hoisting and modular approximation from [this paper](https://eprint.iacr.org/2020/1203.pdf). Please read them to enhance your understanding of the bootstrapping procedure.

The `levelBudget` (for the `CoeffsToSlots` and `SlotsToCoeffs` transformations) dictate how many levels these transformations should take; more levels imply fewer rotations, see Section 3 of the first paper above.

The `bsgsDim` is used for the “baby-step giant-step” method for linear transforms. It also affects the efficiency through the number of rotations, and the internal default logic selects it according to the cost of rotations (see the second paper referenced above).

`approxModDepth` is the number of levels consumed by the evaluation of the approximate modular reduction inside bootstrapping, which is based on evaluating a trigonometric function and then double angle formula, as in the second paper reference above. The depth of the bootstrapping also includes the depth of the linear transformations (and some scaling), as seen from the definition of the function `GetBootstrapDepth`.

Precision depends on many factors. You can get a better precision by increasing the scaling factor, by ensuring the inputs to the bootstrap are between [-1,1], or by doing multiple iterations of bootstrapping such as in the example file `iterative-ckks-bootstrapping`. There are many discussions on the discourse forum about this, please take a look.

---

<div class="post-metadata">

**Author:** ![cappuccino](https://avatars.discourse-cdn.com/v4/letter/c/aeb1de/32.png) [@cappuccino](https://openfhe.discourse.group/u/cappuccino)\
**Post date:** [October 31, 2025, 8:07pm UTC](https://openfhe.discourse.group/t/about-bootstrapping-parameters/2202/3 "2025-10-31T20:07:41Z")

</div>

Thanks for your reply.

I now have a better understanding of bootstrap.

I’ll take a look at the paper you mentioned.
