# Plonk Note: Custom Gate The native plonk equation covers how `addtion` and `multiplication` gates can be implemented and expressed by making use of function `selector`. The introduction of custom gates still relies on this idea of using `selectors` only that the `selectors` are now used to target "arbitrary linear combinations". Native plonk gate: $q_l \cdot x_a + q_r \cdot x_b + q_o \cdot x_c + q_m \cdot (x_ax_b)$; We can define a custom gate (arbitrary linear combinations): $q_{add} \cdot (a_0 + a_1 - a_2) + y \cdot q_{mul} \cdot (a_0 \cdot a_1 - a_2) + y^2 \cdot q_{bool} \cdot (a_0 + a_0 - a_0) = 0$ We have just define a custom gate that can express `Add`, `Mul` and `Boolean` expressions. In order to combine all these custom gate into a single expression like the native plonk custom gate, we need to introduce the use of a verifier challenge $y$ to keep gates linearly independent. The way we get $y$ is by committing the selectors $q_{add}, q_{mul}, q_{bool}$ to the `Transcript` this selectors discards the structure of the circuit, now we can sample $y$ from this `Transcript`. It is important to note that the powers of $y$ are what is used to keep this gates linearlly independent so that prover can't game the values to maybe cancel out some gates or in any way make that gate pass even if the values don't pass. This is an example of how the custom gate matrix would look like; $q_{add} \cdot (a_0 + a_1 - a_2) + y \cdot q_{mul} \cdot (a_0 \cdot a_1 - a_2) + y^2 \cdot q_{bool} \cdot (a_0 + a_0 - a_0) = 0$ | $q_{add}$ | $q_{mul}$ | $q_{bool}$ | $a_0$ | $a_1$ | $a_2$ | | --------- | --------- | ---------- | ----- | ----- | ----- | | $1$ | $0$ | $0$ | $3$ | $5$ | $8$ | | $0$ | $1$ | $0$ | $3$ | $5$ | $15$ | | $0$ | $0$ | $1$ | $1$ | $0$ | $0$ | | $1$ | $1$ | $0$ | $2$ | $2$ | $4$ | | $0$ | $1$ | $1$ | $1$ | $2$ | $2$ | As expressed, you can activate multiple custom gate in one row!