Jump to content
Technetium

Generate BTC addresses from private keys

Recommended Posts

https://blockchain.info/en/q/newkey

https://github.com/BitcoinPHP/BitcoinECDSA.php

###

https://blockexplorer.com/api-ref

https://pypi.python.org/pypi/pycoin

https://github.com/richardkiss/pycoin

https://github.com/vbuterin/pybitcointools

 

import bitcoin as btclib
import requests

from pycoin.services.blockchain.info import BlockchainInfoProvider
from pycoin.tx import script, Tx

###

https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list

https://github.com/jgarzik/python-bitcoinrpc

from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException
def btc_rpc_connect(config):
   rpc_server_url = ("http://{user}:{password}@{host}:{port}").format(
       user=config.rpc_user,
       password=config.rpc_pass,
       host=config.rpc_host,
       port=config.rpc_port
   )
   rpc_conn = AuthServiceProxy(rpc_server_url)
   return rpc_conn
config = {
   'rpc_user': 'username',
   'rpc_pass': 'password',
   'rpc_host': 'host',
   'rpc_port': 'port',
}
try:
   rpc_conn = btc_rpc_connect(config)
    btc_address = rpc_conn.getnewaddress('accountname')
   amount = rpc_conn.getreceivedbyaddress('some_btc_address', 2)
except JSONRPCException, e:
  if settings.DEBUG:
     print e

###

Coinbase API - VA RECOMAND SA EVITATI!

<?php

require __DIR__ . '/vendor/autoload.php';
use Coinbase\Wallet\Client;
use Coinbase\Wallet\Configuration;
use Coinbase\Wallet\HttpClient;
use Coinbase\Wallet\Mapper;
use Coinbase\Wallet\Resource\Account;
use Coinbase\Wallet\Resource\Address;

$apiKey = 'XXXXXXXX';
$apiSecret = 'XXXXXXXXXX';

$configuration = Configuration::apiKey($apiKey, $apiSecret);
$client = Client::create($configuration);
$account = $client->getPrimaryAccount();

$address = new Address();
$client->createAccountAddress($account, $address);

echo $address->getAddress();

?>

###

Plaintext query api to retreive data from blockchain.info:

https://blockchain.info/q

Poate va trebuie si wrapper-ul asta:

https://github.com/gsalvati/jsonRpcClient-PHP/blob/master/jsonRPCClient.php

Edited by Technetium
  • Upvote 1
Link to comment
Share on other sites

3 hours ago, Che said:

@Technetium Scuze, nu ma prea pricep la Bitcoin, scriptul asta practic te ajuta sa iti creezi singur niste portofele virtuale care deja au Bitcoini in ele sau la ce te ajuta adresele generate ?

Teoretic, daca ai noroc se poate intampla sa iti genereze o adresa care are deja bani pe ea. Dar ai mai multe sanse sa castigi la loto de mai multe ori consecutiv decat sa se intample asta.

Link to comment
Share on other sites

3 hours ago, Che said:

@Technetium Scuze, nu ma prea pricep la Bitcoin, scriptul asta practic te ajuta sa iti creezi singur niste portofele virtuale care deja au Bitcoini in ele sau la ce te ajuta adresele generate ?

Hai bro, ce naiba!

Folosesti api-ul si generezi adrese BTC. Ca si cum ti-ai crea un cont nou.

Cine stie, foloseste deja, cine nu, o sa inceapa sa foloseasca, i-am dat idei :).

Documenteaza-te si pune-te si tu putin la punct!

Iti las aici un video, sper sa te ajute.

 

Wallet-ul e cu totul altceva.

https://www.bitcoin.com/choose-your-wallet/

 

Recomand:

Copay
Bitcoin Core
Multibit
Electrum
Armory
https://blockchain.info/wallet/#/
https://bitcoin.org/en/

 

Ca sa afli mai mult despre ele dupa /choose-your-wallet/ pui copay, armory etc...

  • Upvote 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...