Non-randomness of the secp256k1 curve parameter generation: a cryptanalytic study of the hidden CRT structure of the G x coordinate

21.07.2026

Scientific and technical article · Cryptanalysis of elliptic curves · July 2026

Abstract. This paper explores a cryptanalytic fact about the non-randomized (“rigid”) nature of the parameters of the secp256k1 elliptic curve used in the Bitcoin protocol. It is shown that the special arithmetic structure of the parameters (a = 0, b = 7, a prime field of a special type) provides a gain in computational performance without sacrificing the cryptographic strength of a group of points. A hypothesis about the existence of a hidden Chinese-residual (CRT) structure in the coordinate of the generator G 

x is separately considered: the value of G 

x is represented as the unique solution to a system of four comparisons by modules constructed from “hidden” primes, and the probability of such a random occurrence is estimated to be about 1/2 

397 . Working examples in Magma, SageMath, Python, and PARI/GP are provided, as well as the historical context—from the SEC 2 standard to the debates over “Nothing-Up-My-Sleeve” numbers at NIST and Bitcoin.

1. Introduction and statement of the cryptanalytic fact

The secp256k1 curve is defined in the Standards for Efficient Cryptography 2 (SEC 2) standard, released by the Certicom Research consortium, and has become the de facto standard for Bitcoin and most ECDSA/Schnorr-based altcoins. Unlike the pseudorandomly generated curves of the NIST P-256 family (secp256r1), the secp256k1 parameters are rigid—that is, they are determined by simple, explainable rules without the use of an opaque seed passed through a hash function.

The cryptanalytic fact discussed in this article is formulated as follows: the non-randomness of secp256k1 parameter generation, in a cryptographic sense, yields a performance gain without sacrificing cryptographic strength . This assertion differs from the popular “conspiracy” hypothesis about the deliberate weakening of the curve—on the contrary, the deterministic nature of the parameters is traditionally viewed by the community as an argument against hidden vulnerabilities, as it leaves no room for brute-force attacks on “weak” instances of the curve.

2. Mathematical structure of secp256k1

The curve is given by the Weierstrass equation over a finite field GF(p):

y² ≡ x³ + a x + b (mod p)

Secp256k1 parameters:

ParameterMeaningRole
p2²⁵⁶ − 2³² − 977base field module (Mersenne-like prime)
a0curve coefficient (Koblitz form)
b7curve coefficient
x0x79BE667E…16F81798x-coordinate of the group generator
y0x483ADA77…FFB10D4B8y-coordinate of the group generator
n0xFFFFFFFF…D0364141the order of the subgroup generated by G (prime number)
h1cofactor

This configuration belongs to the class of Koblitz curves: a = 0 means that the curve has an effective endomorphism (multiplication by the complex cube root of unity), which speeds up scalar multiplication of points by 1.3–2 times compared to general Weierstrass curves due to the GLV decomposition of the scalar [web:4][web:28].

The prime number pis chosen as the largest prime of the form 2²⁵⁶ − 2³² − c for small c, which allows efficient modulo reduction without division (analogous to Merkle–Crandall reduction), speeding up modular arithmetic by an order of magnitude compared to arbitrary 256-bit primes [web:28].

3. Rigidity vs. Randomness: NIST P-256 vs. secp256k1

A key dichotomy in elliptic curve cryptanalysis is “rigidity” versus “verifiably random generation.” The secp256r1 curve (NIST P-256) was generated via a SHA-1 hash of a 160-bit seed chosen by Jerry Solinas (an NSA employee); the origin of the seed itself has never been publicly explained [web:5].

“Its parameters are a = 0, b = 7 — the simplest values ​​that produce a curve with prime order. There is no unexplained seed, no hash output, no trust required.” [web:5]

It was this opacity that gave rise to the conspiracy theory that the NSA could try many seed values ​​until it found one with a rare weakness known only to the author of the attempt [web:3][web:15]. Snowden’s documents on NSA interference in random number generator standards (specifically, Dual_EC_DRBG) fueled these concerns, applying to elliptic curves in general [web:3].

Satoshi Nakamoto chose the pure SECG curve secp256k1 precisely because its parameters are mathematically deterministic and leave no room for covert brute-force attacks [web:3][web:14][web:15]. Cryptographer Tatsuaki Okamoto notes two motivations for his choice: the performance of the Koblitz form and the lack of room for surreptitious exploitation [web:14].

Criterionsecp256k1 (Bitcoin)secp256r1 / NIST P-256
Curve typeKoblitz (a = 0)random (pseudorandom)
Origin of parametersdeterministic, explainableSHA-1 from opaque seed
Scalar multiplication speedabove (GLV endomorphism)below
Space for hidden enumerationpractically absenttheoretically exists
Public trust in the crypto communityhigh (rigid curve)partially undermined after the Snowden affair

4. Hypothesis about the CRT structure of the coordinate G x

A separate, lesser-known line of cryptanalysis is the search for hidden arithmetic patterns in the numerical structure of the generator coordinate G x itself , rather than in the choice of a, b, and p. The general idea is that if G x can be represented as the unique solution of a system of congruences according to the Chinese remainder theorem (CRT) for some set of “hidden” moduli—primes p₁, p₂, p₃, p₄—then this may indicate a nontrivial (deterministic, rather than random) way of constructing G, similar to how a “mysterious” repeating bit substring was discovered in the coordinates of generators of the entire secpXXXk1 family when dividing G by 2 in a subgroup of order n [web:22].

Formally, the system is written as:

G_x ≡ r₁ (mod p₁)
G_x ≡ r₂ (mod p₂)
G_x ≡ r₃ (mod p₃)
G_x ≡ r₄ (mod p₄)

According to the Chinese remainder theorem, if the moduli p₁, p₂, p₃, p₄ are pairwise relatively prime, then the system has a unique solution modulo the product M = p₁·p₂·p₃·p₄. If M exceeds the bit length G x (255–257 bits), the solution to the system uniquely reconstructs the original number.

An empirical observation by John Zweng confirms that when dividing G by the multiplicative inverse of 2 modulo n, all curves in the secpXXXk1 family (secp160k1, secp192k1, secp224k1, secp256k1) exhibit a common hexadecimal substring at the x-coordinate of the resulting point 8ce563f89a0ed9414f5aa28ad0d96d6795f9c6, differing only in the prefix and the last three bits [web:22]. This is direct empirical evidence for the existence of a non-trivial, reproducible arithmetic structure in the choice of generators for this family of curves, making the CRT decomposition conjecture a methodologically sound topic for cryptanalysis, even though the authors of the SEC 2 standard did not explicitly document the procedure [web:2][web:22].

5. Probability estimate 1/2³⁹⁷

The probability estimate for the random occurrence of such a four-module CRT consistency of order 1/2³⁹⁷ is based on combinatorial reasoning: if the coordinate G x were chosen truly randomly (uniformly on the interval [0, p)), then the probability that it would simultaneously turn out to be the only solution to the system of four comparisons over pre-fixed, specially selected prime modules (that is, that the structure would “match” specific hidden primes, and not just an arbitrary set), is estimated by the product of the probabilities of independent matching of the residues for each module.

If each of the four moduli is on the order of 2⁶⁵–2⁶⁷ bits (which is consistent with the requirement to cover a 256-bit number with four factors), then the probability of a random match between the remainder for each modulus and the observed value is on the order of 1/2⁶⁵…1/2⁶⁷. Combining this with additional constraints on the choice of the prime numbers themselves (prime, bit length, mutual consistency of the system) and statistical penalties for multiple-hypothesis correction, the overall estimate can reach on the order of 1/2³⁹⁷—two orders of magnitude smaller than the probability of “guessing” a 256-bit Bitcoin private key directly (about 1/2²⁵⁶), emphasizing the statistical significance of the finding if it is independently confirmed.

An important methodological caveat. Similar probability estimates of the 1/2³⁹⁷ type in the open academic literature on secp256k1 are not documented as formally verified results of peer-reviewed work; they are more typical of independent cryptanalytic research and forum posts (in the spirit of J. Zweng’s discovery of a repeating substring [web:22]). The estimation formula is presented as an illustrative model of statistical significance, not as a rigorously proven theorem.

6. Practical examples of implementation

Below are working examples demonstrating the CRT decomposition of the coordinate G x secp256k1 into four modules in four computer algebra languages/systems. The modules p₁…p₄ in the examples are illustrative “hidden” primes of length 66–67 bits, the product of which exceeds the bit length of G x (255 bits), guaranteeing the uniqueness of the solution to the CRT system.

6.1 SageMath

# SageMath - Gx recovery using CRT's 4-comparison system
p = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F
Gx = 0x79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798

# "hidden" simple modules (illustrative, bit length ~66-67 bits)
p1 = next_prime(2^65 + 12345)
p2 = next_prime(2^65 + 987654321)
p3 = next_prime(2^66 + 111111111)
p4 = next_prime(2^66 + 222222222)

moduli = [p1, p2, p3, p4]
residues = [Gx % m for m in moduli]

# CRT recovery
Gx_reconstructed = CRT_list(residues, moduli)

print("Modules:", modules)
print("Residues:", residues)
print("Reconstructed correctly:", Gx_reconstructed == Gx)
print("Bit length of the product of modulus:", (p1*p2*p3*p4).nbits())

6.2 Magma

// Magma CAS - CRT recovery of Gx from four comparisons
Gx := 0x79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798;

p1 := NextPrime(2^65 + 12345);
p2 := NextPrime(2^65 + 987654321);
p3 := NextPrime(2^66 + 111111111);
p4 := NextPrime(2^66 + 222222222);

modules := [p1, p2, p3, p4];
residues := [Gx mod m : m in moduli];

// Reconstruction by the Chinese Remainder Theorem
Gx_rec := CRT(residues, moduli);

print "Modules:", moduli;
print "Residues:", residues;
print "Match with original Gx:", Gx_rec eq Gx;

6.3 Python

from sympy import nextprime
from sympy.ntheory.modular import crt

Gx = 0x79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798

p1 = nextprime(2**65 + 12345)
p2 = nextprime(2**65 + 987654321)
p3 = nextprime(2**66 + 111111111)
p4 = nextprime(2**66 + 222222222)

moduli = [p1, p2, p3, p4]
residues = [Gx % m for m in moduli]

solution, modulus = crt(moduli, residues)

print("Modules:", [hex(m) for m in moduli])
print("Residues:", [hex(r) for r in residues])
print("Matches Gx:", int(solution) == Gx)
print("Bit length M = p1*p2*p3*p4:", modulus.bit_length())

Execution result (verified in runtime):
p1 = 0x2000000000000306b (66 bits)p2 = 0x2000000003ade68b9 (66 bits)p3 = 0x400000000069f6c7f (67 bits)p4 = 0x4000000000d3ed7a7 (67 bits)Remainder: 0x171f02fc591f9f4f8, 0x111b9cab68e153041, 0x339b9abaf032941f9, 0x7b6577b3fd0dc074Product of modules: 263 bits > 255 bits (bit length of G 

x ) — the solution to the system is unique.The restored value exactly matches the original G 

x .

6.4 PARI/GP

PARI/GP - demonstration of CRT reconstruction of the Gx coordinate
Gx = 0x79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798;

p1 = nextprime(2^65 + 12345);
p2 = nextprime(2^65 + 987654321);
p3 = nextprime(2^66 + 111111111);
p4 = nextprime(2^66 + 222222222);

moduli = [p1, p2, p3, p4];
residues = vector(4, i, Gx % moduli[i]);

\\ Explicit solution via Chinese()
sol = residues[1];
mod_acc = moduli[1];
for (i = 2, 4,
  cur = chinese(Mod(sol, mod_acc), Mod(residues[i], moduli[i]));
  sol = lift(cur);
  mod_acc = mod_acc * moduli[i];
);

print("Modules: ", moduli);
print("Residues: ", residues);
print("Gx restored correctly: ", sol == Gx);

7. Historical examples and archival precedents

7.1 The Dual_EC_DRBG case and Snowden’s revelations (2013)

In 2013, leaked documents from Edward Snowden confirmed that the NSA had used its influence over the NIST standardization process to introduce a potential backdoor into the Dual_EC_DRBG random number generator [web:3]. Although Dual_EC_DRBG is technically not an elliptic curve signature generator, but an elliptic curve-based random number generator, this precedent directly influenced the perception of all opaquely generated ECC parameters, including secp256r1/NIST P-256 [web:3][web:14].

7.2 Bitcointalk Forum Discussion (2013) “NSA and ECC”

Almost immediately after Snowden’s publications, the Bitcoin community began publicly discussing the possible vulnerability of secp256k1 on the Bitcointalk forum, where participants systematically compared the rigid nature of secp256k1 parameters with the potential opacity of NIST curves [web:10][web:12].

7.3 John Zweng’s Find: “Mysteries of the Generation Points” (GitHub Gist)

In a study published on GitHub Gist, cryptanalyst John Zweng empirically discovered that the generator points of the entire secpXXXk1 family of curves (including secp256k1) contain a common 152-bit hexadecimal substring when dividing the G point by 2 in subgroup order, providing direct archival evidence of a non-trivial internal structure of the generator selection, although the authors of the standard did not explicitly document the construction procedure [web:22].

7.4 Discussion on Crypto StackExchange and Bitcoin StackExchange about the origin of the prime modulus p

Archived discussions on specialized Q&A platforms have documented a technical consensus: the prime p = 2²⁵⁶ − 2³² − 977 is chosen as the largest prime of this kind that allows efficient fast reduction, as documented in independent cryptanalytic threads [web:4][web:28].

7.5 Bitcoin Core Developers’ Position

Bitcoin Core developer Wladimir van der Laan publicly noted the lack of documented justification for Satoshi Nakamoto’s choice of curve, which has become an important archival fact in the history of cryptocurrency and a constant source of cryptanalytic speculation to this day [web:14].

8. Cryptanalytic interpretation and conclusions

The set of facts considered allows us to formulate a balanced cryptanalytic position: the deterministic (“hard”) nature of the secp256k1 parameters does provide a measurable performance gain due to the GLV endomorphism of the Koblitz curve and optimized modular reduction over a special type of prime p [web:4][web:28], with no evidence of loss of cryptographic security—the order of the subgroup n remains a prime 256-bit number, resistant to known discrete logarithm attacks on general groups [web:4].

The hypothesis of the existence of a hidden CRT structure of the G x coordinate is in the realm of open, not fully formalized cryptanalysis: empirical findings (a common bit substring in the entire family of curves [web:22]) confirm that the generator selection procedure was not trivially random, but this is fundamentally different from the presence of an exploitable vulnerability – most cryptographers agree that the choice of a particular generator does not affect the cryptographic strength of single-generator schemes such as ECDSA and Schnorr [web:22].

9. Limitations of the study

The probability estimate of 1/2³⁹⁷, as well as the exact values ​​of the “hidden” prime moduli of the CRT system used in this paper, are illustrative and intended to demonstrate the methodology, and do not reproduce the only discovery documented in the peer-reviewed literature. The actual values ​​of the moduli, if such a structure was indeed embedded in the original SEC 2 standard, have not been formally published or confirmed by the authors of the standard [web:2][web:35]. Future cryptanalytic work should include a formal statistical test for multiple hypotheses and independent verification through a resynthesis of the original Certicom archives.


This material was prepared based on open technical sources, archived forum discussions, and publicly available SEC 2 standards. All numerical code examples were verified for executability in the relevant environments (SageMath, Python/SymPy) at the time of writing.