title: How to generate an Ethereum public key from a private key using rust-secp256k1?
body: <p>I found <a href="https://github.com/paritytech/rust-secp256k1" rel="nofollow noreferrer">rust-secp256k1</a> and it seems to be what I need, but there are no examples in the documentation.</p>
  
  <p>I tried to use this crate in my code:</p>
  
  <pre><code>extern crate secp256k1;
  
  use secp256k1::key::SecretKey;
  
  fn main() {
      let context = secp256k1::Secp256k1::without_caps();
  
      let private_key: String = String::from("d500266f7d37f0957564e4ce1a1dcc8bb3408383634774a2f4a94a35f4bc53e0");
  
      let secret_key = SecretKey::new(&amp;context, &amp;mut private_key);
  
      println!("{:?}", secret_key);
  }
  </code></pre>
  
  <p>I got an error:</p>
  
  <pre class="lang-none prettyprint-override"><code>error[E0277]: the trait bound `std::string::String: secp256k1::rand::Rng` is not satisfied
    --&gt; src/main.rs:10:22
     |
  10 |     let secret_key = SecretKey::new(&amp;context, &amp;mut private_key);
     |                      ^^^^^^^^^^^^^^ the trait `secp256k1::rand::Rng` is not implemented for `std::string::String`
     |
     = note: required by `secp256k1::key::SecretKey::new`
  </code></pre>