Bitcoin Forum
September 28, 2025, 03:48:32 AM *
News: Latest Bitcoin Core release: 29.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1] 2 3 4 5 6 7 8 9 10 11 »
1  Economy / Speculation / Re: Wall Observer BTC/USD - Bitcoin price movement tracking & discussion on: December 06, 2023, 07:20:32 PM

Explanation
100bit.co.in thanks TalkImg.com
Slowly, but surely, 2023 is closing the gap with 2021. 2024 is going to bring in new wonders... Roll Eyes
2  Bitcoin / Development & Technical Discussion / Do you think BIP 106 would have solved the Mempool congestion due to BRC20? on: June 11, 2023, 07:16:47 PM
Because of the recent Mempool congestion due to BRC20 some discussions of past crossed my mind. Bitcoin Scalability Problem is not new. Block Size Limit Controversy was a byproduct of this. This gave us multiple BIPs (Bitcoin Improvement Proposal) by multiple experts. Below is a consolidated list of those all...


Out of all these, I have always voiced in favor of BIP 106 on BitcoinTalk. Second part of the proposal, i.e. Proposal 2 : Depending on previous block size calculation and previous Tx fee collected by miners, has always seemed most practical & effective to me.

Now, as almost 8 years have passed and the scaling issue is still daunting us, what do you think about this proposal?
3  Alternate cryptocurrencies / Announcements (Altcoins) / OpenAI generated PHP code for Address/Key is NOT Working. Can anyone plz help? on: February 20, 2023, 01:29:49 PM
I am trying to get a standalone PHP code without any external dependency to generate an Ethereum address/key pair. So I asked OpenAI ChatGPT to write the code for me. I got two different versions from it...

Version 1

Code:
include "keccak.php";
use kornrunner\Keccak;

// Generate a random private key
$private_key = bin2hex(openssl_random_pseudo_bytes(32));

// Compute the public key from the private key using elliptic curve cryptography
$public_key = '0x'.bin2hex(gmp_export(gmp_mul(gmp_init('0x'.bin2hex(openssl_random_pseudo_bytes(32)), 16), gmp_init('0x'.bin2hex(gmp_powm(gmp_init(2), gmp_init('0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0', 16), gmp_init('0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A1', 16))), 16))));

// Compute the Keccak-256 hash of the public key (as a hex string)
$address = '0x' . substr(Keccak::hash(hex2bin(substr($public_key, 2)), 256), -40);

echo "Private key: $private_key<br>";
echo "Address: $address<br>";

Version 2

Code:
include "keccak.php";
use kornrunner\Keccak;

function generate_ethereum_address() {
// Generate a new private key
$privateKey = bin2hex(random_bytes(32));
echo "Private Key: " . $privateKey. "<br>";

// Derive the public key from the private key
$publicKey = hex2bin('04' . str_pad(gmp_strval(gmp_init(substr($privateKey, 0, 64), 16), 16), 64, '0', STR_PAD_LEFT) . str_pad(gmp_strval(gmp_init(substr($privateKey, 64), 16), 16), 64, '0', STR_PAD_LEFT));

// Generate the Ethereum address from the public key
$address = '0x' . substr(Keccak::hash(substr($publicKey, 1), 256), -40);

// Return the Ethereum address
return $address;
}

// Generate an Ethereum address
$address = generate_ethereum_address();

// Output the Ethereum address
echo "Address: " . $address. "<br>";

For Keccak, this code is used - https://github.com/kornrunner/php-keccak/blob/main/src/Keccak.php

Sample o/p of Version 1 is...
Code:
Private key: 1941069a40cc71a83b8df773e0b45cdb8aa70b748710c82eace662c07ede4cf8
Address: 0x753215ef5214d2494df5e19dafa5644d034d201c

Sample o/p of Version 2 is...
Code:
Private key: 1941069a40cc71a83b8df773e0b45cdb8aa70b748710c82eace662c07ede4cf8
Address: 0x753215ef5214d2494df5e19dafa5644d034d201c

Clearly, address generated by both versions are wrong and AI is unable to fix the code. Can any of you please fix it?
4  Alternate cryptocurrencies / Altcoin Discussion / OpenAI generated PHP code for Address/Key is NOT Working. Can anyone plz help? on: February 18, 2023, 07:07:12 PM
I am trying to get a standalone PHP code without any external dependency to generate an Ethereum address/key pair. So I asked OpenAI ChatGPT to write the code for me. I got two different versions from it...

Version 1

Code:
include "keccak.php";
use kornrunner\Keccak;

// Generate a random private key
$private_key = bin2hex(openssl_random_pseudo_bytes(32));

// Compute the public key from the private key using elliptic curve cryptography
$public_key = '0x'.bin2hex(gmp_export(gmp_mul(gmp_init('0x'.bin2hex(openssl_random_pseudo_bytes(32)), 16), gmp_init('0x'.bin2hex(gmp_powm(gmp_init(2), gmp_init('0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0', 16), gmp_init('0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A1', 16))), 16))));

// Compute the Keccak-256 hash of the public key (as a hex string)
$address = '0x' . substr(Keccak::hash(hex2bin(substr($public_key, 2)), 256), -40);

echo "Private key: $private_key<br>";
echo "Address: $address<br>";

Version 2

Code:
include "keccak.php";
use kornrunner\Keccak;

function generate_ethereum_address() {
// Generate a new private key
$privateKey = bin2hex(random_bytes(32));
echo "Private Key: " . $privateKey. "<br>";

// Derive the public key from the private key
$publicKey = hex2bin('04' . str_pad(gmp_strval(gmp_init(substr($privateKey, 0, 64), 16), 16), 64, '0', STR_PAD_LEFT) . str_pad(gmp_strval(gmp_init(substr($privateKey, 64), 16), 16), 64, '0', STR_PAD_LEFT));

// Generate the Ethereum address from the public key
$address = '0x' . substr(Keccak::hash(substr($publicKey, 1), 256), -40);

// Return the Ethereum address
return $address;
}

// Generate an Ethereum address
$address = generate_ethereum_address();

// Output the Ethereum address
echo "Address: " . $address. "<br>";

For Keccak, this code is used - https://github.com/kornrunner/php-keccak/blob/main/src/Keccak.php

Sample o/p of Version 1 is...
Code:
Private key: 1941069a40cc71a83b8df773e0b45cdb8aa70b748710c82eace662c07ede4cf8
Address: 0x753215ef5214d2494df5e19dafa5644d034d201c

Sample o/p of Version 2 is...
Code:
Private key: 1941069a40cc71a83b8df773e0b45cdb8aa70b748710c82eace662c07ede4cf8
Address: 0x753215ef5214d2494df5e19dafa5644d034d201c

Clearly, address generated by both versions are wrong and AI is unable to fix the code. Can any of you please fix it?
5  Bitcoin / Development & Technical Discussion / Re: website development on: November 28, 2022, 04:50:01 PM
How do we generate the bitcoin address for every user, those who uses our website  ,and can withdraw deposit ?

Ideally you should run your own Bitcoin Node and query using JSON-RPC.

For example, get new address using - https://bitcoincore.org/en/doc/22.0.0/rpc/wallet/getnewaddress/.

But, if you are not pro, you may use third party API and query using cURL.

For example, you may use this API - https://www.blockchain.com/explorer/api/api_receive.
6  Bitcoin / Project Development / Re: easybitcoin.php on: October 28, 2022, 10:01:32 PM
If you can not provide the content of 'easybitcoin.php', provide what you exactly get here...

Code:
Array ( [version] => 1040203 [protocolversion] => 70929 [services] => NETWORK/BLOOM/ [walletversion] => 169900 [balance] => 6000.96068 [zerocoinbalance] => 0 [staking status] => Staking Active [blocks] => 1823565 [timeoffset] => 0 [connections] => 242 [proxy] => [difficulty] => 114235.22515094 [testnet] => [moneysupply] => 1114119657.5589 [keypoololdest] => 1666243740 [keypoolsize] => 99 [paytxfee] => 0 [relayfee] => 0.0001 [errors] => )
7  Bitcoin / Project Development / Re: easybitcoin.php on: October 28, 2022, 09:39:55 PM
Could have been easier to debug by knowing the content of 'easybitcoin.php'. Anyways, try this...

Code:
require_once('easybitcoin.php');

$bitcoin = new Bitcoin('user','pass','localhost','port');

$getinfo = $bitcoin->getinfo();

print_r($getinfo[staking status]);
8  Bitcoin / Project Development / Why this PHP code is not posting BTC price in USD on 29-08-2019? on: August 29, 2022, 05:23:09 PM
Neither this...
Code:
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.coingecko.com/api/v3/coins/bitcoin/history?date=29-08-2019&localization=false');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$response = curl_exec($ch);
curl_close($ch);
$object = json_decode($response);
$usdVal = $object->market_data->current_price->usd;
echo $usdVal;

Nor this...
Code:
ini_set('max_execution_time', 300);
$url ='https://api.coingecko.com/api/v3/coins/bitcoin/history?date=29-08-2019&localization=false';
$data = file_get_contents($url);
$object = json_decode($data);
$usdVal = $object->market_data->current_price->usd;
echo $usdVal;

What am I doing wrong?


p.s. I could not find a better place to ask this question on BitcoinTalk. So, asking it here. If mods think, it does not fit here, feel free to move.
9  Other / Meta / CloudFlare is blocking simple PHP code posting! on: June 18, 2022, 05:32:46 PM
Try to post the following by replacing p_h_p with php.

Code:
<?p_h_p echo "Hello World"; ?>
10  Bitcoin / Bitcoin Technical Support / Why is this code yielding something like this? on: June 18, 2022, 05:20:47 PM
I am using the following PHP code...

Code:
echo round(($satoshiValue/pow(10,8)),8);

When, $satoshiValue = 10000, result is 0.0001 as expected.

But, when, $satoshiValue = 10000000, result is 0.10000000000000001. Expected was 0.1 though.

Why is this happening?


p.s. I could not find a better place to ask this question on BitcoinTalk. So, asking it here. If mods think, it does not fit here, feel free to move.
11  Bitcoin / Wallet software / Re: Hardware wallet vs software wallet for daily transaction on: March 14, 2022, 12:41:51 PM
Given your use case, i.e. daily expenses, both Electrum wallet & Hardware wallet will provide same level of security.
This is not true. A hardware wallet is meant to protect your funds against software attacks. It's much, much more difficult to create malware that steals funds from a hardware wallet than it is to steal funds from a hot Electrum client.
True. But, malware is not the only attack vector that HW needs to withstand. There are other vectors, like compromised RNG, compromised Firmware etc. exists for HW, which is not there for open source SW. So, one can't really say that a hot wallet on HW is more secure than a hot wallet on SW, just because SW is more susceptible to malware attack.
12  Bitcoin / Development & Technical Discussion / Re: From Entropy Source to Address Generation - A Technical Overview on: March 14, 2022, 12:33:34 PM
Bumped, so that more people may get to know about this stuff.
13  Bitcoin / Wallet software / Re: Hardware wallet vs software wallet for daily transaction on: March 10, 2022, 06:06:05 PM
Given your use case, i.e. daily expenses, both Electrum wallet & Hardware wallet will provide same level of security.

Why?

Because, your Hardware wallet is not airgapped. Every now & then you'll have to connect it to the internet.

Why?

Because, first your Hardware wallet needs to update its UTXO set to create a transaction. This requires connection to the internet. Signing can be done offline. Broadcasting can also be done by copying the signed transaction to mobile/laptop. Though, it would often expose it to an internet connected device.

So, unless you are storing your fund on an airgapped Hardware wallet, your are as secured as an Electrum wallet user.
14  Bitcoin / Mining / Re: Solar powered Bitcoin mining on the Earth Orbit or on the Moon Surface? on: October 10, 2021, 11:02:19 AM
This would be beneficial from the perspective of Global Warming on Planet Earth.

But, will it be technically and financially viable?
Interesting concept. As others have stated above, it is possibly not feasible as of yet. But, in future...

1. When 1 BTC = 1 Million USD or higher, Rocket companies will probably charge in Bitcoin Blocks to place Miner Payloads in the Space/Moon. In fact, for Government backed Mining, Government Space Agencies may charge much less for Government subsidy due to this operation being Environment friendly.

2. If substantial Hash power is parked at the Moon, even 30 second latency might not be much of a downside for 10 minutes block time. If orphaned, Moon miners may still keep building on that chain and eventually outperform Earth miners.

3. When human starts habitat at the Mars, there'll be need of Intergalactic Medium of Exchange. Miners, placed on the Space/Moon, may play a crucial role at that point. Having no/little atmosphere and very low temperature will probably benefit the mining operation.
15  Bitcoin / Bitcoin Discussion / Re: How to properly use a Mixer? on: October 02, 2021, 05:51:32 PM
Does anyone have any reliable resources regarding properly/safely mixing BTC?

For decentralized mixing, you may try CoinJoin.

https://en.bitcoin.it/wiki/CoinJoin

AFAIK, non-custodial wallet wasabiwallet.io supports it.

https://blog.wasabiwallet.io/what-is-a-coinjoin/
16  Other / Beginners & Help / Re: List of Bitcoin Mempool Viewers for Reference on: July 02, 2021, 06:58:04 PM

Removing this as it no longer works.
17  Bitcoin / Development & Technical Discussion / Is there any standalone script to generate SegWit Address Key pair using PHP? on: July 02, 2021, 06:43:07 PM
Something similar is available for Bitcoin legacy addresses here -
https://github.com/BitcoinPHP/BitcoinECDSA.php/blob/master/src/BitcoinPHP/BitcoinECDSA/BitcoinECDSA.php
18  Bitcoin / Development & Technical Discussion / Re: How do crypto payment gateways work? on: July 02, 2021, 06:37:30 PM
But how is a system able to recognize this particular payment was done?
Generate unique address for each payment and monitor payment to it. May be you can have a timer running, within which time frame the payment needs to complete. Otherwise you'd stop monitoring that address.


What if someone else just bought the same product and sent amount to this wallet?
Address is unique for each payment. So, this confusion will never occur.


So would it be necessary to create a new wallet for every payment?
A wallet is a collection of addresses, which can be accessed from the same seed/phrase. You generate new address for each payment. Not wallet.


Is this how popular systems work?
Not sure what do you mean by popular. But, this is standard practice. https://btcpayserver.org is an open source implementation of such a payment gateway.


Anyone got a better understanding of this?
Hope you understood the basics.
19  Bitcoin / Wallet software / Re: Is BitAddress still good for cold storage-paper wallets? on: February 02, 2021, 06:07:57 PM
Plus is it still trustworthy, or are there currently better ways to create cold storage-paper wallets?

Can everyone also confirm that this is the correct link, and Github repository?

https://www.bitaddress.org/
https://github.com/pointbiz/bitaddress.org
https://github.com/pointbiz/bitaddress.org/archive/v3.3.0.zip

Asking for a friend. Cool

Yes. Below is a step by step way to securely generate a paper wallet using bitaddress.org...

1. Download BitAddress.org JS code from https://github.com/pointbiz/bitaddress.org.

2. Run it in an offline computer and generate Address + Private Key.

3. Copy the Address in a text file and write down the Private Key by hand in your notebook.

4. Write the Private Key from your notebook to the text file by typing and run it through BitAddress.org JS code to see whether it generates back the same Address in the text file.

5. Now remove all traces of the Private Key, save the text file with Address and wipe out the temporary cache from your browser.

6. Download Coinb.in JS code from https://github.com/OutCast3k/coinbin/ and use it to sweep fund received at the generated Address.
20  Bitcoin / Bitcoin Technical Support / How to determine whether an address starting with '3' is SegWit or Not? on: January 15, 2021, 11:45:57 AM
Example...

SegWit Address: 3Pih1gsGEufDcE3rnCvH7tSGxYCfAumr7N
Private Key: L31MGtLmx3RVomrNYkNzJqrd5h788GDkJpT6sTRhSu1rd2ZwWimr

Non-SegWit Address: 3FcdxBkv4Va8YLfyCe11pRsZ2uTki7DWvH
Private Key 1: L1QZg6Lqc8pH2RqWuEKzqv3rwjumQ2oMUyp4S8WPnZgWCnXPL4mu
Private Key 2: L3Qh439DtmJS1xKEe2tL7KG2niM4FWE6UvdJzs5DwdBqPZc8rrBe
Private Key 3: L5dhbsNKyzqPPgTFGe6kUVHibFv5QhoAhLJSVAqgTnyDXVimtm1E

Just looking at these addresses, how do we determine that 3Pih1gsGEufDcE3rnCvH7tSGxYCfAumr7N is SegWit and 3FcdxBkv4Va8YLfyCe11pRsZ2uTki7DWvH is not? And, if we can't determine, how do we decide whether to send SegWit Tx to these addresses or not?
Pages: [1] 2 3 4 5 6 7 8 9 10 11 »
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!