! 
Series: Zcash site na First Principles . **Article 1 . Audience: newcomers. We assume only ordinary school arithmetic (adding, multiplying, dividing). No prior cryptography or higher mathematics. What you'll leave with: an intuitive and correct understanding of finite fields, why cryptographers use them, and where they show up inside Zcash.
Na Nkeji edemede 0 we met five characters: the note, the commitment, the note commitment tree, the nullifier, and the zero-knowledge proof. We left a loose end hanging: where do all the keys and secret recipes actually come from? They come from numbers. But not the ordinary numbers you grew up with. They come from a special, self-contained number system called a finite field, and almost every piece of cryptography in Zcash is built on top of it.
Isiokwu a na-enweta echiche ahụ nwayọ nwayọ. Dị ka ekwere na nkwa, nghọta mbụ. Enweghị usoro ruo mgbe ha na-akwụ ụgwọ maka onwe ha.
Nọmba nkịtị nwere nsogbu maka cryptography: e nwere ọtụtụ n'ime ha, ha na-agbakwa ozi.
Chee echiche ihe ga-eme mgbe ọnụọgụgụ na-ebuwanye ibu. 8,142,067, you already know quite a lot: it's a seven-digit number, it's odd, it's "fairly large." Size is a clue. And clues are exactly what a privacy system cannot afford to give away.
Cryptography chọrọ usoro ọnụọgụ ebe:
Ndepụta ọchịchọ ahụ nwere aha. Ọ bụ ** ubi a na-ejedebe **. Ka anyị wuo ihe omimi maka otu tupu anyị ede otu akara.
Ị na-ejikarị ebe a na-agwụ agwụ eme ihe kwa ụbọchị. Ọ bụ elekere dị na mgbidi gị.
On a 12-hour clock, numbers wrap around. Start at 10 o'clock, add 5 hours, and you don't land on "15 o'clock," you land on 3 o'clock. The clock has only twelve positions, and counting past the top simply loops back to the start.
! 
Ihe atọ mere n'oge na-adịbeghị anya bụ isi ihe dị n'isiokwu a:
Nke a wrap-gburugburu mgbakọ na mwepụ nwere a ukara aha: ** modular mgbakọ na eze **. The elekere ọrụ "modulo 12," dere ** mod 12 **. Mathematicians ahọrọ ịgụ ọnọdụ malite na 0, otú a "elekere mod 12" n'ezie nwere ọnọdụ 0, 1, 2, ..., 11Oge elekere mod 7 ga-enwe ọnọdụ 0 site na 6.
Otu iwu: iji gbakọọ ihe ọ bụla "mod p", mee mgbakọ na mwepụ nkịtị, wee kewaa site
pma debe naanị ihe fọdụrụnụ. Ihe Nlereanya mod 7:5 + 4 = 9, na9akwụkwọ ndụ akwụkwọ ndụ fọdụrụ2mgbe ekewara site7, so5 + 4 = 2 (mod 7).
Oge elekere na-eme ka anyị gbakwunye. A ** ubi ** bụ nkwalite: usoro ọnụọgụ ebe arụmọrụ anọ niile na-akpa agwa, gụnyere nke ahụ dị mgbagwoju anya, nkewa.
Informally, a field is any collection of "numbers" where you can add, subtract, multiply, and divide (by anything except zero), and all the familiar rules still hold: order doesn't matter for addition or multiplication, brackets can be regrouped, there's a 0 na a 1, na ọnụọgụ ọ bụla nwere ihe na-adịghị mma na (ma e wezụga 0) nke na-eme ka mmadụ abụọ ahụ nwee mmekọrịta.
Nọmba ndị nwere ezi uche bụ mpaghara. Ọnụ ọgụgụ ndị dị adị bụ mpaghara ihe anyị chọrọ bụ * njedebe *.
Nke a bụ isi ihe si na ya pụta, ọ dịkwa mma:
** Were nọmba ndị ahụ dum
0, 1, ..., p-1ma na-eme ihe niile arithmetic modp. Ifpbụ nọmba mbụ, nsonaazụ ya bụ mpaghara nwere njedebe.** Anyị na-ede yaF_p(gụọ "F sub p").
So F_7 = {0, 1, 2, 3, 4, 5, 6} site na usoro elekere-ụdị mgbakọ na mwepụ mod 7 bụ ezigbo ubi nwere njedebe. Ka anyị hụ ya ka ọ na-eku ume.
Ntinye ọ bụla bụ (row x column) mod 7:
| x | 0 | 1 | 2 | 3 | 4 | 5 | 6 |
|---|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 1 | 0 | 1 | 2 | 3 | 4 | 5 | 6 |
| 2 | 0 | 2 | 4 | 6 | 1 | 3 | 5 |
| 3 | 0 | 3 | 6 | 2 | 5 | 1 | 4 |
| 4 | 0 | 4 | 1 | 5 | 2 | 6 | 3 |
| 5 | 0 | 5 | 3 | 1 | 6 |
Lelee ahịrị ndị ahụ maka 1 site na 6: onye ọ bụla nwere uru ọ bụla na-abụghị efu 1..6 Ọdịdị ahụ "enweghị ikwugharị, ọ dịghị ihe na-efu" bụ akara mkpịsị aka a na-ahụ anya nke ubi.
Nkewa bụ naanị "mmụba site na reciprocal". F_7, nke a na-akpọ reciprocal (ma ọ bụ inverse) nke ọnụọgụ a bụ uru a^(-1) maka nke a x a^(-1) = 1. Ịgụ ha ozugbo site na tebụl:
a | 1 | 2 | 3 | 4 | 5 | 6 |
|---|---|---|---|---|---|---|
a⁻¹ | 1 | 4 | 5 | 2 | 3 | 6 |
Lelee nke mbụ: 2 x 4 = 8 = 1 (mod 7)Ya mere "kewaa site na 2" n'ime F_7 pụtara "mmụba site na 4." Onye ọ bụla na-abụghị efu nwere onye òtù ọlụlụ. ** Nke ahụ bụ ihe na-eme ka F_7 ubi.**
Nke a bụ echiche kachasị mkpa n'isiokwu a, yabụ ka anyị mee ka ọ bụrụ ihe doro anya kama ịkọwapụta ya.
Lelee ihe na-agbaji ma ọ bụrụ na anyị na-agbalị iji wuru a "ubi" mod 6 (na 6 bụ ọ bụghị isi):
È nwere nke ọ bụla
xna2 x x = 1 (mod 6)? Na-enyocha ha niile:2x0=0, 2x1=2, 2x2=4, 2x3=0, 2x4=2, 2x5=4. ** Azịza ya1ọ dịghị mgbe ọ na-apụta.** Ya mere2enweghị mmeghachi omume mod 6. njọ,2 x 3 = 6 = 0 (mod 6): ọnụọgụ abụọ na-abụghị efu mụbara iji nye efu.
That second sentence is a catastrophe for arithmetic. Two nonzero things multiplying to zero (called a zero divisor) means division is broken, and a system with broken division is not a field. It happens precisely because 6 ihe ndị dị ka 2 x 3.
A prime, by definition, has no such factors. So mod a prime, no zero divisors can appear, every nonzero element gets a clean reciprocal, and the structure is a proper field.
! 
** Otu-liner reusable maka isiokwu gị: ** * prime modulus n'ime, ọcha nkewa si.*
Anyị na-agụ inverse si a table maka F_7, ma Zcash's prime nwere ọtụtụ narị digits; enweghị tebụl ga-ekwe omume. Enwere ụzọ mkpirisi kpochapụla, ọ bụkwa naanị usoro dị n'isiokwu a.
Fermat's Little Theorem na-ekwu na maka prime p na ihe ọ bụla na-abụghị efu a:
a^(p-1) = 1 (mod p)
Gbanwee ya (wepụ otu ihe nke a) ị ga-enwetakwa ihe dị iche n'efu:
a^(-1) = a^(p-2) (mod p)
Nnwale na F_7 (p = 7, so p - 2 = 5): ihe inverse nke 2 kwesịrị ịbụ 2^5 = 32 = 4 (mod 7)N'ezie , tebụl anyị kwuru 2^(-1) = 4Kọmputa na-ebute nnukwu ike ngwa ngwa, yabụ nke a na-eme ka "chọta ihe dị iche" n'ime ngụkọta ọsọ ọsọ, nke ziri ezi ọbụna maka ọnụ ọgụgụ ndị buru ibu.
Ịkwesighi iburu nke a n'isi. Ịkwesịrị ịma na ** nkewa n'ọhịa nwere njedebe bụ ngwa ngwa, arụmọrụ zuru oke **, nke bụ kpọmkwem ihe mere ndị na-emepụta ihe nzuzo ji enwe obi ụtọ iwulite ya.
N'ịchịkọta ihe ọmụma ahụ, lee ihe ndekọ ahụ dum n'otu peeji.
Ihe onwunwe nke F_p | Ihe kpatara sistemụ nzuzo ji chọọ ya |
|---|---|
| Ngwụcha | Kọmputa na-echekwa ihe ọ bụla kpọmkwem; ọ dịghị agba gburugburu, ọ dịghị mmiri juru eju, ọ dịghịkwa ihe na-ese n'elu mmiri |
| Gbaa gburugburu | Na-ehichapụ "nha," yabụ uru anaghị ekpughe ihe ọ bụla gbasara otu esi emepụta ya |
| Ọrụ anọ niile na-arụ ọrụ | Ntụziaka maka ihe odide nzuzo (igodo, nkwa, ihe akaebe) chọrọ ezigbo algebra, ọ bụghị naanị ịgụta ọnụ |
| Nha a ga-ahọrọ | Họrọ 255-bit ma ọ bụ 381-bit praịm, ebe ahụ nwere ọtụtụ ihe karịa atọm dị na mbara igwe a na-ahụ anya; ịkọ nkọ enweghị olileanya |
| Kpọmkwem na nke doro anya | Ndị otu abụọ na-eme ihe n'eziokwu na-agbakọ otu ihe na-enweta otu nsonaazụ mgbe niile, nke ihe akaebe dabere na ya |
A finite field is, in one phrase, a perfectly closed, perfectly exact, perfectly huge playground for arithmetic. Everything else in Zcash is built by playing inside it.
Ikwesighi iwere "Zcash na-eji ubi ndị nwere njedebe" na okwukwe. Nke a bụ map ahụ (igwe dị omimi bụ maka isiokwu ndị ọzọ; nke a bụ naanị igosi na mkpịsị aka dị adị).
! 
So the answer to Article 0's open question, "where do the secret recipes come from?", begins here: everything starts as arithmetic in a finite field. In the next article we'll take that field and build the actual objects, points on an elliptic curve, that become keys and commitments.
Iji nọrọ ọhụrụ-enyi na enyi anyị simplified a ole na ole ezi ihe. F_p I nwekwara ike iji ya rụọ ubi. p^n elements (called extension fields), and those matter for the "pairings" that Sapling's proof system relies on. We also skipped the full list of field axioms and glossed over how primes of this size are chosen and validated. None of that changes the intuition you now hold; it refines it. We'll add the precision back, with flags, when a later article needs it.
0..p-1 mod a prime p na-enye ezigbo ubi F_p, ebe ị nwekwara ike kewaa n'ihi na ọ bụla na-abụghị efu mmewere nwere ihe inverse.2 x 3 = 0 mod 6) ma mebie nkewa.a^(-1) = a^(p-2)).| Oge okwu | Nkọwa Bekee dị mfe |
|---|---|
| Modular arithmetic | Mgbakọ na mwepụ nke na-agbakọta mgbe o ruru uru a kapịrị ọnụ, dị ka elekere |
| mod p | "Kewaa site na p ma debe ihe fọdụrụ" |
| Field | Sistemụ ọnụọgụgụ ebe ịtinye, wepụ, mụbaa, ma kewaa ọrụ niile |
Finite field F_p | Ọnụọgụ ndị ahụ 0..p-1 na mgbakọ na mwepụ emee mod a praịm p |
| Inverse (reciprocal) | Ihe ahụ a^(-1) na a x a^(-1) = 1"na-ekewa site na a"pụtara ịmụba site na ya |
| Zero divisor | Uru abụọ na-abụghị efu nke ngwaahịa ha bụ efu; ihe na-emebi modulu mejupụtara |
| Prime | Ọnụọgụgụ dum karịrị 1 na-enweghị ihe ọ bụla ma e wezụga 1 na onwe ya |
Gịnị mere na ọ bụghị naanị iji integers nkịtị ma ọ bụ decimals? Decimals round and drift; integers grow without bound and leak size. Finite fields are exact, bounded, and size-blind, which cryptography requires.
"Wrap around" ọ na-efunahụ ozi? N'ebumnuche, ee. Ihichapụ nha nke ụkpụrụ dị n'etiti bụ atụmatụ, ọ bụghị ahụhụ, maka nzuzo.
Ọ bụ na ọ bụrụ na ọnụọgụgụ buru ibu karịa nke mbụ, ọ ga-adị nchebe karịa? Loosely, a bigger field means more possible values and harder guessing, but security depends on the whole construction, not the field size alone. Later articles make this precise.
Gịnị kpatara ọnụọgụ ndị a akọwapụtara (255-bit, 381-bit) na Zcash? A na-ahọrọ ha ka usoro ndị e wuru n'elu ha nwee usoro ziri ezi na arụmọrụ maka usoro ihe akaebe. "Nhazi ziri ezi" ahụ bụ isiokwu nke isiokwu abụọ na-esonụ.
In F_7, ihe bụ 5 - 6(Cheta: nọrọ n'ime ụlọ {0,...,6} site n'ịtụgharị ya.) (Zaa ajụjụ dị n'okpuru.)
5 - 6 = -1, na -1 a fụchiri n'ime F_7 is 6 (n'ihi na 6 + 1 = 7 = 0). So 5 - 6 = 6 (mod 7)Nwepu anaghị ahapụ ubi ahụ; ọ na-agbanye n'ụzọ ọzọ.
Article 2 . Elliptic curves: we take the finite field we just built and use it to draw a strange kind of curve whose points can be "added" together. Those points become Zcash's keys and commitments, and they hide a one-way trapdoor that makes the whole privacy system possible. Intuition first, as always.
| 4 |
| 2 |
| 6 | 0 | 6 | 5 | 4 | 3 | 2 | 1 |