# Constructing constraints for Bulletproof

**URL:** <https://community.zkproof.org/t/constructing-constraints-for-bulletproof/785>\
**Category:** General Zero-Knowledge\
**Created:** [August 10, 2023, 12:52pm UTC](https://community.zkproof.org/t/constructing-constraints-for-bulletproof/785 "2023-08-10T12:52:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Foisoi](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.zkproof.org/foisoi/32/410_2.png) [@Foisoi](https://community.zkproof.org/u/Foisoi)\
**Post date:** [August 10, 2023, 12:52pm UTC](https://community.zkproof.org/t/constructing-constraints-for-bulletproof/785/1 "2023-08-10T12:52:35Z")

</div>

Need to prove that, for a given vector of Pedersen commitments, each entry is a commitment to 0, except for some i-th entry. (Neither i, nor openings to commitments are unknown to the verifier).

I am working with Bulletproofs and I don’t want to use their gadgets system, because it’ll be very cumbersome and costly to make a verification on-chain.  
Instead, I want to come up with a constraint system myself, but I need help.

So far, I came up with something like this:  
Vectors are denoted as letters in bold (E.g.: **a** , **1** , **0** , etc)

**m** is a bitmask vector, which represents the index of the non-zero element in the vector **a**  
**a** is a set where every entry is zero and one number is arbitrary (for example, x)

Step 1  
**m** = [0, 0, 1, 0]  
**a** = [0, 0, x, 0]

Step 2  
**n** = **m** - **1**

( **m** - **1** ) - **n** = **0**  
**m** `hadamard` **n** = **0**  
( **m** `inner` **1** ) - 1 = 0  
( **a** `inner` **m** ) - ( **a** `inner` **1** ) = 0
