> For the complete documentation index, see [llms.txt](https://nocturne-xyz.gitbook.io/nocturne/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://nocturne-xyz.gitbook.io/nocturne/protocol-details/algebraic-primitives-and-notation.md).

# Algebraic Primitives & Notation

### Algebraic Primitives

Unless otherwise specified, all values are assumed to be elements of the Scalar field of BN254 as defined in [EIP-197](https://eips.ethereum.org/EIPS/eip-197). We will refer to this field as the "BN254 Scalar field" or $$\mathbb{F}\_p$$ for short. We will use $$p$$ to refer to the order of the BN254 scalar field.

For all elliptic curve cryptography, including our addressing and signature schemes, we use the Baby Jubjub curve, the curve whose *base* field is $$\mathbb{F\_p}$$ as defined in [EIP-2494](https://eips.ethereum.org/EIPS/eip-2494). All operations are performed in Baby Jubjub's prime-order subgroup, which we will refer to as "Baby Jubjub", or $$\mathbb{G}$$ (blackboard "G" as opposed to regular "G") for short.

We will use $$r$$ to refer to the order of Baby Jubjub's scalar field (again, the prime-order subgroup, not the curve group), and we will refer that scalar field as "Baby Jubjub Scalar field", or $$\mathbb{F}\_r$$ for short.

We will use additive notation. More specifically, we use:

* "$$+$$" to denote curve addition or field addition depending on whether we are adding curve elements or field elements
* "$$\cdot$$" or juxtaposition to denote field multiplication
* "$$\times$$" to denote scalar multiplication, in order to clearly distinguish it from field multiplication

Additionally, for byte arrays, we will use "slice" notation to specify "sub-arrays" - $$\text{bytes}\[K:N]$$ means "from the $$K$$th byte up to, but not including the $$N$$th byte".

Furthermore, we will use all-capital letters for curve elements and all-lowercase lettrs for field elements.

### Hashing

We use the Poseidon hash function defined over the $$\mathbb{F}\_p$$, the BN254 scalar field, instantiated using the [parameters set in `circomlib`'s implementation](https://github.com/iden3/circomlib/blob/master/circuits/poseidon_constants.circom). We will denote this function $$H$$.&#x20;


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://nocturne-xyz.gitbook.io/nocturne/protocol-details/algebraic-primitives-and-notation.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
