<p>Yes in ripple-lib the default elliptic curve is set in <a href="https://github.com/ripple/ripple-lib/blob/develop/src/js/sjcl-custom/sjcl-secp256k1.js" rel="nofollow">sjcl-custom/sjcl-secp256k1.js</a></p>

<pre><code>// Overwrite NIST-P256 with secp256k1 so we're on even footing
sjcl.ecc.curves.c256 = new sjcl.ecc.curve(...)
</code></pre>

<p>Then in <a href="https://github.com/ripple/ripple-lib/blob/develop/src/js/ripple/keypair.js" rel="nofollow">keypair.js</a> when a new key pair is instantiated its <code>_curve</code> attribute is set to secp256k1.</p>

<pre><code>function KeyPair() {
  this._curve  = sjcl.ecc.curves['c256'];
  this._secret = null;
  this._pubkey = null;
};
</code></pre>

CC BY-SA 3.0
2013-12-14T21:32:13.883Z
2013-12-14T21:32:13.883Z
Steven Zeiler
<p>The algorithm used by bitcoin to generate keys is secp256k1, is it the same for ripple? </p>

<ripple><cryptography>
What is the Elliptic Curve algorithm used in Ripple to generate public / private key pairs?
Steven Zeiler
# What is the Elliptic Curve algorithm used in Ripple to generate public / private key pairs?

(Asked by: username_0 on 2013-12-14)

The algorithm used by bitcoin to generate keys is secp256k1, is it the same for ripple?

**Tags:** ripple, cryptography


---

## 1 answers

### Answer by username_0 on 2013-12-14. Score: 2

Yes in ripple-lib the default elliptic curve is set in sjcl-custom/sjcl-secp256k1.js
// Overwrite NIST-P256 with secp256k1 so we're on even footing
sjcl.ecc.curves.c256 = new sjcl.ecc.curve(...)

Then in keypair.js when a new key pair is instantiated its _curve attribute is set to secp256k1.
function KeyPair() {
  this._curve  = sjcl.ecc.curves['c256'];
  this._secret = null;
  this._pubkey = null;
};


---

