Bitcoin Forum
September 12, 2025, 04:59:16 AM
Welcome,
Guest
. Please
login
or
register
.
News
: Latest Bitcoin Core release:
29.0
[
Torrent
]
Home
Help
Search
Login
Register
More
Bitcoin Forum
>
Bitcoin
>
Development & Technical Discussion
>
[PHP] How to get the address from a private key?
Pages: [
1
]
« previous topic
next topic »
Print
Author
Topic: [PHP] How to get the address from a private key? (Read 1276 times)
alex1s
(OP)
Newbie
Offline
Activity: 1
Merit: 0
[PHP] How to get the address from a private key?
April 07, 2015, 11:03:50 AM
#1
How can I calculate the public address if I only have the private key with PHP only?
For example I have
5K2YUVmWfxbmvsNxCsfvArXdGXm7d5DC9pn4yD75k2UaSYgkXTh
and want
1HKqKTMpBTZZ8H5zcqYEWYBaaWELrDEXeE
Does anyone have a working PHP code without using bitcoind or any other API/tools?
defcon23
Legendary
Offline
Activity: 1120
Merit: 1002
Re: [PHP] How to get the address from a private key?
April 07, 2015, 11:13:02 AM
#2
Quote from: alex1s on April 07, 2015, 11:03:50 AM
How can I calculate the public address if I only have the private key with PHP only?
For example I have
5K2YUVmWfxbmvsNxCsfvArXdGXm7d5DC9pn4yD75k2UaSYgkXTh
and want
1HKqKTMpBTZZ8H5zcqYEWYBaaWELrDEXeE
Does anyone have a working PHP code without using bitcoind or any other API/tools?
just import the private key into your wallet , and you've got the public key.
cr1776
Legendary
Offline
Activity: 4508
Merit: 1357
Re: [PHP] How to get the address from a private key?
April 07, 2015, 11:20:39 AM
#3
It really depends on what you are asking, but this may be useful:
https://bitcointalk.org/index.php?topic=1008030.0
abyrnes81
Hero Member
Offline
Activity: 714
Merit: 500
Re: [PHP] How to get the address from a private key?
April 07, 2015, 11:21:32 AM
#4
Quote from: alex1s on April 07, 2015, 11:03:50 AM
How can I calculate the public address if I only have the private key with PHP only?
For example I have
5K2YUVmWfxbmvsNxCsfvArXdGXm7d5DC9pn4yD75k2UaSYgkXTh
and want
1HKqKTMpBTZZ8H5zcqYEWYBaaWELrDEXeE
Does anyone have a working PHP code without using bitcoind or any other API/tools?
Maybe try this source on gitHub:
https://github.com/RobKohr/PHP-Bitcoin-Address-Creator
or
http://gobittest.appspot.com/Address
coinableS
Legendary
Offline
Activity: 1442
Merit: 1191
Re: [PHP] How to get the address from a private key?
April 07, 2015, 01:04:20 PM
Merited
by
ABCbits
(2)
#5
A lot will depend on what PHP extensions you have installed on your server. If you're on shared hosting (like many are) your hosting provider controls what version of PHP is ran and which extensions. Echo out phpinfo(); to see what you have installed. Ones that I have seen you'll need bcrypt, bmath, and an ECC library as well. So I usually just end up using a 3rd party API to do key generation.
Maybe give this one a try, it doesn't have many requirements.
https://github.com/BitcoinPHP/BitcoinECDSA.php
Building Bitcoin Websites
CHECK OUT MY BOOK
| A BEGINNER'S BITCOIN WEB-DEV GUIDE | AVAILABLE ON
AMAZON
Amph
Legendary
Offline
Activity: 3276
Merit: 1072
Re: [PHP] How to get the address from a private key?
April 07, 2015, 01:55:02 PM
#6
wiki is your friend here
https://en.bitcoin.it/wiki/Technical_background_of_Bitcoin_addresses
also, for more in depth knowledge about ecdsa creation
http://en.wikipedia.org/wiki/Elliptic_Curve_Digital_Signature_Algorithm
frogCorporation
Full Member
Offline
Activity: 124
Merit: 100
Re: [PHP] How to get the address from a private key?
April 07, 2015, 04:05:41 PM
#7
Hello, alex1s,
We had almost the same issue and we used the following answer on stackoverflow
http://stackoverflow.com/questions/19233053/hashing-from-a-public-key-to-a-bitcoin-address-in-php
However we do not know its behaviour in a case of multiple senders. For example if you need to retrieve the addresses of those, who sent you some coins, f.ex using walletnotify.
Bitcoin_BOy$
Hero Member
Offline
Activity: 854
Merit: 503
|| Web developer ||
Re: [PHP] How to get the address from a private key?
April 10, 2015, 03:28:44 PM
#8
Well you can use a ready PHP library to do this , I didn't ever saw how it work and how Bitcoin address are hashed !
You can check this library and you will probably understand how it work and make your own ` easy code ` .
https://github.com/Bit-Wasp/bitcoin-lib-php
Kind Of Respect ,
Bitcoin Boy .
dabura667
Sr. Member
Offline
Activity: 475
Merit: 301
Re: [PHP] How to get the address from a private key?
April 10, 2015, 04:29:01 PM
#9
Quote from: alex1s on April 07, 2015, 11:03:50 AM
How can I calculate the public address if I only have the private key with PHP only?
For example I have
5K2YUVmWfxbmvsNxCsfvArXdGXm7d5DC9pn4yD75k2UaSYgkXTh
and want
1HKqKTMpBTZZ8H5zcqYEWYBaaWELrDEXeE
Does anyone have a working PHP code without using bitcoind or any other API/tools?
5K2YUVmWfxbmvsNxCsfvArXdGXm7d5DC9pn4yD75k2UaSYgkXTh
vvvvvvvvvvvvv
https://github.com/Bit-Wasp/bitcoin-lib-php/blob/master/src/BitcoinLib.php#L568
vvvvvvvvvvvvv
https://github.com/Bit-Wasp/bitcoin-lib-php/blob/master/src/BitcoinLib.php#L430
vvvvvvvvvvvvv
https://github.com/Bit-Wasp/bitcoin-lib-php/blob/master/src/BitcoinLib.php#L389
vvvvvvvvvvvvv
1HKqKTMpBTZZ8H5zcqYEWYBaaWELrDEXeE
My Tip Address:
1DXcHTJS2DJ3xDoxw22wCt11FeAsgfzdBU
NyeFe
Hero Member
Offline
Activity: 699
Merit: 501
Re: [PHP] How to get the address from a private key?
April 12, 2015, 02:28:00 PM
#10
This is a lengthy instruction on the process:
http://bitcoin.stackexchange.com/questions/25024/how-do-you-get-a-bitcoin-public-key-from-a-private-key-this-is-a-new-question
But it works accordingly.
MicroDApp.com—Smart Contract developers. Lets build a decentralized future!
Pages: [
1
]
Print
Bitcoin Forum
>
Bitcoin
>
Development & Technical Discussion
>
[PHP] How to get the address from a private key?
« previous topic
next topic »
Jump to:
Please select a destination:
-----------------------------
Bitcoin
-----------------------------
=> Bitcoin Discussion
===> Legal
===> Press
===> Meetups
===> Important Announcements
=> Development & Technical Discussion
===> Wallet software
=====> Electrum
=====> Bitcoin Wallet for Android
=====> BitcoinJ
=====> Armory
=====> Mycelium
=====> Hardware wallets
=> Mining
===> Mining support
===> Pools
===> Mining software (miners)
===> Hardware
=====> Group buys
===> Mining speculation
=> Bitcoin Technical Support
=> Project Development
-----------------------------
Economy
-----------------------------
=> Economics
===> Speculation
=> Marketplace
===> Goods
=====> Computer hardware
=====> Digital goods
=======> Invites & Accounts
=====> Collectibles
===> Services
===> Currency exchange
===> Gambling
=====> Games and rounds
=====> Investor-based games
=====> Gambling discussion
===> Lending
=====> Long-term offers
===> Securities
===> Auctions
===> Service Announcements
=====> Micro Earnings
===> Service Discussion
=====> Web Wallets
=====> Exchanges
=> Trading Discussion
===> Scam Accusations
===> Reputation
-----------------------------
Other
-----------------------------
=> Meta
===> Bitcoin Wiki
=> Politics & Society
=> Beginners & Help
=> Off-topic
=> Serious discussion
===> Ivory Tower
=> Archival
===> New forum software
===> Корзина
===> CPU/GPU Bitcoin mining hardware
===> Chinese students
===> Obsolete (buying)
===> Obsolete (selling)
===> MultiBit
-----------------------------
Alternate cryptocurrencies
-----------------------------
=> Altcoin Discussion
=> Announcements (Altcoins)
===> Tokens (Altcoins)
=> Mining (Altcoins)
===> Pools (Altcoins)
=> Marketplace (Altcoins)
===> Service Announcements (Altcoins)
===> Service Discussion (Altcoins)
===> Bounties (Altcoins)
=> Speculation (Altcoins)
-----------------------------
Local
-----------------------------
=> العربية (Arabic)
===> العملات البديلة (Altcoins)
=====> النقاشات
===> إستفسارات و أسئلة المبتدئين
===> التعدين
===> النقاشات الأخرى
===> منصات التبادل
=> Bahasa Indonesia (Indonesian)
===> Marketplace (Bahasa Indonesia)
===> Mining (Bahasa Indonesia)
===> Altcoins (Bahasa Indonesia)
===> Trading dan Spekulasi
===> Ekonomi, Politik, dan Budaya
===> Topik Lainnya
=> Español (Spanish)
===> Mercado y Economía
=====> Servicios
=====> Trading y especulación
===> Hardware y Minería
===> Esquina Libre
===> Mercadillo
=====> Mexico
=====> Argentina
=====> España
=====> Centroamerica y Caribe
===> Primeros pasos y ayuda
===> Altcoins (criptomonedas alternativas)
=====> Minería de altcoins
=====> Servicios
=====> Tokens (Español)
=> 中文 (Chinese)
===> 跳蚤市场
===> 山寨币
===> 媒体
===> 挖矿
===> 离题万里
=> Hrvatski (Croatian)
===> Trgovina
===> Altcoins (Hrvatski)
=====> Announcements (Hrvatski)
===> Off-topic (Hrvatski)
=> Deutsch (German)
===> Anfänger und Hilfe
===> Mining (Deutsch)
===> Trading und Spekulation
===> Projektentwicklung
===> Off-Topic (Deutsch)
===> Treffen
===> Presse
===> Altcoins (Deutsch)
=====> Announcements (Deutsch)
===> Marktplatz
=====> Auktionen
=====> Suche
=====> Biete
=> Ελληνικά (Greek)
===> Αγορά
===> Mining Discussion (Ελληνικά)
===> Altcoins (Ελληνικά)
=====> Altcoin Announcements (Ελληνικά)
=====> Altcoin Mining (Ελληνικά)
=> עברית (Hebrew)
=> Français
===> Actualité et News
===> Débutants
===> Discussions générales et utilisation du Bitcoin
===> Mining et Hardware
===> Économie et spéculation
===> Place de marché
=====> Échanges
=====> Produits et services
=====> Petites annonces
===> Le Bitcoin et la loi
===> Wiki, documentation et traduction
===> Développement et technique
===> Vos sites et projets
===> Hors-sujet
===> Altcoins (Français)
=====> Annonces
=> India
===> Mining (India)
===> Marketplace (India)
===> Regional Languages (India)
===> Press & News from India
===> Alt Coins (India)
===> Buyer/ Seller Reputations (India)
===> Off-Topic (India)
=> Italiano (Italian)
===> Guide (Italiano)
===> Progetti
===> Discussioni avanzate e sviluppo
===> Trading, analisi e speculazione
===> Mercato
=====> Mercato valute
=====> Beni
=====> Servizi
=====> Esercizi commerciali
=====> Hardware/Mining (Italiano)
=====> Gambling (Italiano)
===> Accuse scam/truffe
===> Mining (Italiano)
===> Alt-Currencies (Italiano)
=====> Annunci
===> Raduni/Meeting (Italiano)
===> Crittografia e decentralizzazione
===> Off-Topic (Italiano)
=> 日本語 (Japanese)
===> アルトコイン
=> Nederlands (Dutch)
===> Markt
===> Gokken/lotterijen
===> Mining (Nederlands)
===> Beurzen
===> Alt Coins (Nederlands)
===> Off-topic (Nederlands)
===> Meetings (Nederlands)
=> Nigeria (Naija)
===> Politics and society (Naija)
===> Off-topic (Naija)
=> 한국어 (Korean)
===> 대체코인 Alt Coins (한국어)
=> Pilipinas
===> Altcoins (Pilipinas)
=====> Altcoin Announcements (Pilipinas)
===> Pamilihan
===> Others (Pilipinas)
=> Polski
===> Tablica ogłoszeń
===> Alternatywne kryptowaluty
=====> Nowe kryptowaluty i tokeny
=====> Tablica ogłoszeń (altcoiny)
=> Português (Portuguese)
===> Primeiros Passos (Iniciantes)
===> Economia & Mercado
===> Mineração em Geral
===> Desenvolvimento & Discussões Técnicas
===> Criptomoedas Alternativas
===> Brasil
===> Portugal
=> Русский (Russian)
===> Новички
===> Бизнес
=====> Барахолка
=====> Обменники
===> Идеи
===> Кодеры
===> Майнеры
===> Политика
===> Трейдеры
===> Альтернативные криптовалюты
=====> Токены
=====> Бayнти и aиpдpoпы
===> Хайпы
===> Работа
===> Разное
===> Oбcyждeниe Bitcoin
=====> Новости
=====> Юристы
=> Română (Romanian)
===> Anunturi importante
===> Offtopic
===> Market
=====> Discutii Servicii
===> Minerit
===> Tutoriale
===> Bine ai venit!
===> Presa
===> Altcoins (Monede Alternative)
=====> Anunturi Monede Alternative
=> Skandinavisk
=> Türkçe (Turkish)
===> Bitcoin Haberleri
===> Pazar Alanı
===> Madencilik
===> Ekonomi
===> Servisler
=====> Fonlar
===> Proje Geliştirme
===> Alternatif Kripto-Paralar
=====> Madencilik (Alternatif Kripto-Paralar)
=====> Duyurular (Alternatif Kripto-Paralar)
===> Konu Dışı
===> Yeni Başlayanlar & Yardım
===> Buluşmalar
=> Other languages/locations
Loading...