Search content
Sort by

Showing 20 of 218 results by CounterEntropy
Post
Topic
Board Speculation
Re: Wall Observer BTC/USD - Bitcoin price movement tracking & discussion
by
CounterEntropy
on 06/12/2023, 19:20:32 UTC

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
Post
Topic
Board Bitcoin Discussion
Merits 2 from 2 users
Topic OP
Do you think BIP 106 would have solved the Mempool congestion due to BRC20?
by
CounterEntropy
on 11/06/2023, 19:16:47 UTC
⭐ Merited by iwantmyhomepaidwithbtc2 (1) ,d5000 (1)
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. 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?
Post
Topic
Board Announcements (Altcoins)
Merits 1 from 1 user
OpenAI generated PHP code for Address/Key is NOT Working. Can anyone plz help?
by
CounterEntropy
on 20/02/2023, 13:29:49 UTC
⭐ Merited by vapourminer (1)
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?
Post
Topic
Board Development & Technical Discussion
Topic OP
OpenAI generated PHP code for Address/Key is NOT Working. Can anyone plz help?
by
CounterEntropy
on 18/02/2023, 19:07:12 UTC
I am trying to get a standalone PHP code without any external dependency to generate an 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?
Post
Topic
Board Development & Technical Discussion
Merits 1 from 1 user
Re: website development
by
CounterEntropy
on 28/11/2022, 16:50:01 UTC
⭐ Merited by ETFbitcoin (1)
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.
Post
Topic
Board Project Development
Re: easybitcoin.php
by
CounterEntropy
on 28/10/2022, 22:01:32 UTC
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] => )
Post
Topic
Board Project Development
Re: easybitcoin.php
by
CounterEntropy
on 28/10/2022, 21:39:55 UTC
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]);
Post
Topic
Board Bitcoin Technical Support
Topic OP
Why this PHP code is not posting BTC price in USD on 29-08-2019?
by
CounterEntropy
on 29/08/2022, 17:23:09 UTC
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?
Post
Topic
Board Bitcoin Technical Support
Merits 7 from 5 users
Topic OP
Test
by
CounterEntropy
on 18/06/2022, 17:32:46 UTC
⭐ Merited by DdmrDdmr (3) ,vapourminer (1) ,theymos (1) ,ETFbitcoin (1) ,hugeblack (1)
<? echo "Hello World"; ?>
Post
Topic
Board Bitcoin Technical Support
Topic OP
Why is this code yielding something like this?
by
CounterEntropy
on 18/06/2022, 17:20:47 UTC
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.
Post
Topic
Board Wallet software
Re: Hardware wallet vs software wallet for daily transaction
by
CounterEntropy
on 14/03/2022, 12:41:51 UTC
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.
Post
Topic
Board Development & Technical Discussion
Re: From Entropy Source to Address Generation - A Technical Overview
by
CounterEntropy
on 14/03/2022, 12:33:34 UTC
Bumped, so that more people may get to know about this stuff.
Post
Topic
Board Wallet software
Re: Hardware wallet vs software wallet for daily transaction
by
CounterEntropy
on 10/03/2022, 18:06:05 UTC
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.
Post
Topic
Board Mining
Re: Solar powered Bitcoin mining on the Earth Orbit or on the Moon Surface?
by
CounterEntropy
on 10/10/2021, 11:02:19 UTC
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.
Post
Topic
Board Bitcoin Discussion
Re: How to properly use a Mixer?
by
CounterEntropy
on 02/10/2021, 17:51:32 UTC
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/
Post
Topic
Board Beginners & Help
Re: List of Bitcoin Mempool Viewers for Reference
by
CounterEntropy
on 02/07/2021, 18:58:04 UTC
Post
Topic
Board Development & Technical Discussion
Merits 10 from 4 users
Topic OP
Is there any standalone script to generate SegWit Address Key pair using PHP?
by
CounterEntropy
on 02/07/2021, 18:43:07 UTC
⭐ Merited by hugeblack (4) ,bitmover (2) ,NotATether (2) ,ETFbitcoin (2)
Post
Topic
Board Development & Technical Discussion
Merits 1 from 1 user
Re: How do crypto payment gateways work?
by
CounterEntropy
on 02/07/2021, 18:37:30 UTC
⭐ Merited by odolvlobo (1)
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.
Post
Topic
Board Wallet software
Re: Is BitAddress still good for cold storage-paper wallets?
by
CounterEntropy
on 02/02/2021, 18:07:57 UTC
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 your paper wallet...

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.
Post
Topic
Board Bitcoin Technical Support
Merits 2 from 1 user
Topic OP
How to determine whether an address starting with '3' is SegWit or Not?
by
CounterEntropy
on 15/01/2021, 11:45:57 UTC
⭐ Merited by o_e_l_e_o (2)
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?