<p>I wanted to put this as a short comment, but it get’s unreadable. I also don’t go into segwit.</p>
<p>I am not clear on your question: are you looking how to use the OpenSSL library for iOS (then this might not be the right forum - review of parameters to an OpenSSL library is not bitcoin specific...), or more at the conceptual steps to come to an address? Then read on:-)</p>
<p>Searching for OpenSSL and keys in the forum reveals lots of hints on how to use OpenSSL at the command line. I put here some links, that I find useful for creation and conversion of keys:</p>
<p><a href="https://bitcoin.stackexchange.com/questions/19597/bitcoin-address-generation?rq=1">Bitcoin Address generation</a></p>
<p><a href="https://bitcoin.stackexchange.com/questions/14013/what-are-steps-4-9-in-bitcoin-address-generation-for?rq=1">What are steps 4-9 in bitcoin address generation for?</a></p>
<p>Then you‘ll have to go some additional steps, as described in <a href="https://en.bitcoin.it/wiki/Technical_background_of_version_1_Bitcoin_addresses" rel="nofollow noreferrer">bitcoin wiki.</a></p>
<p>And finally, if you want to check the addresses, this is a useful page:</p>
<p><a href="http://gobittest.appspot.com/Address" rel="nofollow noreferrer">http://gobittest.appspot.com/Address</a></p>
<p>Let us know how it goes, and see where we can bring you to your goal!</p>

CC BY-SA 4.0
2018-03-09T07:25:47.617Z
2020-08-19T13:31:58.307Z
2020-08-19T13:31:58.307Z
pebwindkraft
<p>I have an iOS app which can generate Bitcoin private keys in either a hexadecimal or base64 output.  I'd like take the resulting private key and generate the Bitcoin address from it.  I've included the openssl library in my project but am confused as to which methods I should use and how to reference opaque pointers that come along with openssL methods when using them in swift.</p>

CC BY-SA 3.0
2018-03-09T06:40:45.703Z
Maybe use a iOS compatible bitcoin library like https://github.com/libbtc/libbtc?
Jonas Schnelli
CC BY-SA 3.0
2018-03-09T07:59:53.153Z
I would love to get this to work in my iOS project but I'm not keen enough to understand how I can create a framework to include this library in iOS
Andrew Searson
<address><ios><openssl>
How to generate a bitcoin address from a hexadecimal private key using openssl in swift
Andrew Searson
# How to generate a bitcoin address from a hexadecimal private key using openssl in swift

(Asked by: username_0 on 2018-03-09)

I have an iOS app which can generate Bitcoin private keys in either a hexadecimal or base64 output. I'd like take the resulting private key and generate the Bitcoin address from it. I've included the openssl library in my project but am confused as to which methods I should use and how to reference opaque pointers that come along with openssL methods when using them in swift.

**Tags:** address, ios, openssl

> **Comments:**
> **username_1**: Maybe use a iOS compatible bitcoin library like https://github.com/libbtc/libbtc?  
> **username_0**: I would love to get this to work in my iOS project but I'm not keen enough to understand how I can create a framework to include this library in iOS  

---

## 1 answers

### Answer by username_2 on 2018-03-09. Score: 1

I wanted to put this as a short comment, but it get’s unreadable. I also don’t go into segwit.

I am not clear on your question: are you looking how to use the OpenSSL library for iOS (then this might not be the right forum - review of parameters to an OpenSSL library is not bitcoin specific...), or more at the conceptual steps to come to an address? Then read on:-)

Searching for OpenSSL and keys in the forum reveals lots of hints on how to use OpenSSL at the command line. I put here some links, that I find useful for creation and conversion of keys:

[Bitcoin Address generation](https://bitcoin.stackexchange.com/questions/19597/bitcoin-address-generation?rq=1)

[What are steps 4-9 in bitcoin address generation for?](https://bitcoin.stackexchange.com/questions/14013/what-are-steps-4-9-in-bitcoin-address-generation-for?rq=1)

Then you‘ll have to go some additional steps, as described in [bitcoin wiki.](https://en.bitcoin.it/wiki/Technical_background_of_version_1_Bitcoin_addresses)

And finally, if you want to check the addresses, this is a useful page:

<http://gobittest.appspot.com/Address>

Let us know how it goes, and see where we can bring you to your goal!


---

