Pages:
Author

Topic: Requesting Testnet4 tBTC - page 8. (Read 2333 times)

copper member
Activity: 906
Merit: 2258
August 05, 2024, 12:27:41 PM
#16
Quote
Can you get me an Eli5 for this?
Baby steps: run mainnet in offline mode, without any connections, start from the Genesis Block, and mine a single block, on top of that, by using Bitcoin Core. For example:
Code:
$ ./bitcoin-qt -noconnect
generatetodescriptor 1 "pk(0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798)#gn28ywm7" 1000000000
[
  "0000000085c70827e0b4e5590d820d66dce32ef4cdbab06968c6372a45d51fa6"
]
getblock 0000000085c70827e0b4e5590d820d66dce32ef4cdbab06968c6372a45d51fa6
{
  "hash": "0000000085c70827e0b4e5590d820d66dce32ef4cdbab06968c6372a45d51fa6",
  "confirmations": 1,
  "height": 1,
  "version": 536870912,
  "versionHex": "20000000",
  "merkleroot": "20bb379fd28f090730ac2d207b92c6e95c69dfa48a8118577edb20e068c9a65d",
  "time": 1722878378,
  "mediantime": 1722878378,
  "nonce": 3526334891,
  "bits": "1d00ffff",
  "difficulty": 1,
  "chainwork": "0000000000000000000000000000000000000000000000000000000200020002",
  "nTx": 1,
  "previousblockhash": "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f",
  "strippedsize": 225,
  "size": 225,
  "weight": 900,
  "tx": [
    "20bb379fd28f090730ac2d207b92c6e95c69dfa48a8118577edb20e068c9a65d"
  ]
}
decoderawtransaction 02000000010000000000000000000000000000000000000000000000000000000000000000ffffffff025100ffffffff0200f2052a0100000023210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798ac0000000000000000266a24aa21a9ede2f61c3f71d1defd3fa999dfa36953755c690689799962b48bebd836974e8cf900000000
{
  "txid": "20bb379fd28f090730ac2d207b92c6e95c69dfa48a8118577edb20e068c9a65d",
  "hash": "20bb379fd28f090730ac2d207b92c6e95c69dfa48a8118577edb20e068c9a65d",
  "version": 2,
  "size": 144,
  "vsize": 144,
  "weight": 576,
  "locktime": 0,
  "vin": [
    {
      "coinbase": "5100",
      "sequence": 4294967295
    }
  ],
  "vout": [
    {
      "value": 50.00000000,
      "n": 0,
      "scriptPubKey": {
        "asm": "0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 OP_CHECKSIG",
        "desc": "pk(0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798)#gn28ywm7",
        "hex": "210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798ac",
        "type": "pubkey"
      }
    },
    {
      "value": 0.00000000,
      "n": 1,
      "scriptPubKey": {
        "asm": "OP_RETURN aa21a9ede2f61c3f71d1defd3fa999dfa36953755c690689799962b48bebd836974e8cf9",
        "desc": "raw(6a24aa21a9ede2f61c3f71d1defd3fa999dfa36953755c690689799962b48bebd836974e8cf9)#cav96mf3",
        "hex": "6a24aa21a9ede2f61c3f71d1defd3fa999dfa36953755c690689799962b48bebd836974e8cf9",
        "type": "nulldata"
      }
    }
  ]
}
If you can get it right, then you can mine blocks with the minimal difficulty, and we can go further. This simple exercise is what I started with, long time ago, when I was curious, how to mine blocks with Bitcoin Core.
copper member
Activity: 821
Merit: 1992
August 05, 2024, 11:53:39 AM
#15
My comment in testnet4 pull request: https://github.com/bitcoin/bitcoin/pull/29775#issuecomment-2218329966
My code changes: https://bitcointalksearch.org/topic/m.64205870

How to reproduce:

1. Go to: https://github.com/fjahr/bitcoin/tree/2024-04-testnet-4-fix
2. Execute "git clone" on this repo, or get source code in any other way.
3. Edit "src/chain.h" and "src/node/miner.cpp" exactly as I presented on forum.
4. Build Bitcoin Core from source code.
5. Apply vjudeu's scripts from above in your terminal (they are for Bash on Linux, but you can use "Git Bash for Windows", or modify it slightly, to get it working under Windows).
6. See increasing nonces in your terminal, and observe mined blocks.

Quote
but didn't mine anything after a week and gave up
If you use my method, and your block will have the minimal difficulty, and will be valid, then it is guaranteed to always see it in your Bitcoin Core client, as long as your private keys are properly imported. It may be stale, it may be not accepted by other nodes, but it will be always visible.

Also, if you want to see any block, then you can use a simple shortcut:

1. Open Bitcoin Core.
2. Type "generatetoaddress 1
100000000".
3. Repeat it several times manually (or use bitcoin-cli). As long as your difficulty is set into the minimum, you should get a block after around 4 billion hashes (or 40 nonces, if you use that line above inside some loop).

Long time ago, when I started, I simply used "generatetoaddress" command manually, and modified my system clock, to set it 20 minutes after the last block. But: if you think about a stable environment, then modifying the source code is easier, because then your node will report the correct time, and you will not see a lot of warnings saying that "please check your system clock, because it may be set incorrectly". Also, if some blocks will already be in the future, you won't be forced to mine blocks with the real difficulty (by the way, once per 2016 blocks, the real difficulty is used anyway; you can of course run your CPUs 24/7, but I usually turn off my miners, and wait for ASICs to do that job).

Also, a good starting point is regtest, or signet with signetchallenge set to OP_TRUE. Then, you will always see some generated blocks.

So, to sum up: you can always mine blocks, on testnet, mainnet, signet, regtest, just everywhere. Command line and "generatetoaddress" is your friend. The hardest part is just setting your system clock 20 minutes after the last block. But if you can cover that, or if your Bitcoin Core can give you future timestamps in your block templates, then you are good to go.
legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
August 05, 2024, 06:42:06 AM
#14
This sentence didn't age well, because now I can produce something around 10% of testnet4 blocks, and all of them are CPU-mined.
Can you get me an Eli5 for this? I tried for testnet3 in the past, but didn't mine anything after a week and gave up.
copper member
Activity: 821
Merit: 1992
August 05, 2024, 12:28:26 AM
#13
BIP for Testnet4 is now officially merged: https://github.com/bitcoin/bips/blob/master/bip-0094.mediawiki

Edit:
Quote
I did the math a couple of weeks ago, and at that time, on average, it would take several hundreds of years to mine a block using your cpu on testnet 4.
This sentence didn't age well, because now I can produce something around 10% of testnet4 blocks, and all of them are CPU-mined.
copper member
Activity: 906
Merit: 2258
June 10, 2024, 03:05:18 PM
#12
Quote
how to mine testnet4 useing cpu
Code:
$ cat mining4.sh
nonce=0
while [ 1 ]
do
  ./bitcoin-cli --testnet4 generatetoaddress 1 mk4Lmwd1g787twjQYbswdotpYDz9XVD3hH 100000000
  echo nonce: $nonce
  ((nonce=nonce+1))
done

Quote
please guide me step by step
1. Download, build and run Bitcoin Core, made by fjahr, from branch 2024-04-testnet-4-fix: https://github.com/fjahr/bitcoin/tree/2024-04-testnet-4-fix
2. Generate some new address (or import it into Bitcoin Core).
3. Start mining. Most likely, your blocks will be ignored, but you will see them in your GUI, if you use Bitcoin Core as a wallet.

Quote
how to cerate testnet4 address
Code:
getnewaddress
mk4Lmwd1g787twjQYbswdotpYDz9XVD3hH
dumpprivkey mk4Lmwd1g787twjQYbswdotpYDz9XVD3hH
cPLfGZGNgVsYvGfUTP62JdPBzHhL3jjqQ82RobkamETm7WzdgcGE

Quote
this testnet mk4Lmwd1g787twjQYbswdotpYDz9XVD3hH adderess also use to testnet4 ??
Yes: https://mempool.space/testnet4/address/mk4Lmwd1g787twjQYbswdotpYDz9XVD3hH
newbie
Activity: 3
Merit: 1
June 10, 2024, 01:32:50 PM
#11
Quote
Just for your information: no, you can't...
Sure, but my node, and some block explorers think otherwise:

https://mempool.space/testnet/address/tb1qvy67actlsslmvwpjzk9hnx6jf04g5y26sz5crx
https://mempool.space/testnet4/address/tb1qvy67actlsslmvwpjzk9hnx6jf04g5y26sz5crx

Public key: 0261c2c04c8133b863d9df2ef4082c21074f8849ef86ddf54b13e07d6c828faac6
Legacy address: mpNxT11hJpGH2YhUgQKZm2S1rBnnieWbHr
Segwit address: tb1qvy67actlsslmvwpjzk9hnx6jf04g5y26sz5crx

Code:
verifymessage "mpNxT11hJpGH2YhUgQKZm2S1rBnnieWbHr" "IORhFfwQl/VK8NU6sQrRxQ6pqoGjHTElUirU+H0lrsyPKE+cOYUZ3TNx3JF8WM69TvhfwZ9iafDk2f6WK1tZZMg=" "June 10, 2024, 04:13:45 PM: I am Garlo Nicon, and I confirm in topic 5499150 on bitcointalk, that I can mine new blocks in testnet3 and testnet4, by using address tb1qvy67actlsslmvwpjzk9hnx6jf04g5y26sz5crx. All of those blocks have minimal difficulty, equal to one, and were mined on my own CPU."
true

how to mine testnet4 useing cpu
please guide me step by step
how to cerate testnet4 address
i am using to create testnet address
https://www.bitaddress.org/bitaddress.org-v3.3.0-SHA256-dec17c07685e1870960903d8f58090475b25af946fe95a734f88408cef4aa194.html?testnet=true

example
Bitcoin testnet Address
mk4Lmwd1g787twjQYbswdotpYDz9XVD3hH
Private Key
cPLfGZGNgVsYvGfUTP62JdPBzHhL3jjqQ82RobkamETm7WzdgcGE

this testnet mk4Lmwd1g787twjQYbswdotpYDz9XVD3hH adderess also use to testnet4 ??
copper member
Activity: 821
Merit: 1992
June 10, 2024, 11:41:23 AM
#10
Quote
Just for your information: no, you can't...
Sure, but my node, and some block explorers think otherwise:

https://mempool.space/testnet/address/tb1qvy67actlsslmvwpjzk9hnx6jf04g5y26sz5crx
https://mempool.space/testnet4/address/tb1qvy67actlsslmvwpjzk9hnx6jf04g5y26sz5crx

Public key: 0261c2c04c8133b863d9df2ef4082c21074f8849ef86ddf54b13e07d6c828faac6
Legacy address: mpNxT11hJpGH2YhUgQKZm2S1rBnnieWbHr
Segwit address: tb1qvy67actlsslmvwpjzk9hnx6jf04g5y26sz5crx

Code:
verifymessage "mpNxT11hJpGH2YhUgQKZm2S1rBnnieWbHr" "IORhFfwQl/VK8NU6sQrRxQ6pqoGjHTElUirU+H0lrsyPKE+cOYUZ3TNx3JF8WM69TvhfwZ9iafDk2f6WK1tZZMg=" "June 10, 2024, 04:13:45 PM: I am Garlo Nicon, and I confirm in topic 5499150 on bitcointalk, that I can mine new blocks in testnet3 and testnet4, by using address tb1qvy67actlsslmvwpjzk9hnx6jf04g5y26sz5crx. All of those blocks have minimal difficulty, equal to one, and were mined on my own CPU."
true
copper member
Activity: 906
Merit: 2258
June 10, 2024, 05:09:12 AM
#9
Quote
But still, when you cpu mine at a couple dozen Mh/s, you're still vastly outnumbered against a multi Terrahash/second asic that's also mining at the same difficulty.
It is obvious, that you have to prepare some blocks in advance (for example in testnet3, you have everything filled, up to 2 hours in the future). And then, it is more related to network connections, than to the computing power. You just prepare a block, and you have your block with difficulty one, vs some ASIC block, also with difficulty one. Then, it is not about "who will mine it faster", but rather about "who will propagate it faster".

And of course, ASIC miners rule that world of test chains, so you have to mine your blocks around theirs. But still, it is possible to propagate some block faster, than some ASIC will do, because both players will prepare them in advance, and then the competition is related only to network connections.

Another thing is that ASIC miners potentially could always reorg CPU-mined blocks, but for some reason they don't. It is more profitable to mine a strong, regular block on top of them, because then, you can pick any block time you want. In case of CPU block times, it is more restricted.

Quote
i tested out the cpuminer that i included into my image for 2 weeks to see if it was stable, and i did not solve a single block...
It should mine at least some blocks, but they probably were reorged. If that's the case, then you have to improve the code for your node, not for your mining equipment. For example, to mine testnet blocks easily, I slighttly modified Bitcoin Core, and since then, it works on my CPU.

Quote
So yes, maybe at the moment it might be possible to mine a couple testnet4 blocks with your cpu if you're really lucky.
I repeated the same thing on testnet3, just to be sure. Now, I can mine on CPU in both networks, but testnet4 is more stable. However, mining in testnet3 is still quite good idea, if you want to test block rewards, based on transaction fees.
legendary
Activity: 3584
Merit: 5248
https://merel.mobi => buy facemasks with BTC/LTC
June 10, 2024, 02:23:46 AM
#8
I have mined on testnet3 in the past, i'm well aware of the fact that the difficulty can reset to 1. But still, when you cpu mine at a couple dozen Mh/s, you're still vastly outnumbered against a multi Terrahash/second asic that's also mining at the same difficulty.

When i created my testnet4 node container, i tested out the cpuminer that i included into my image for 2 weeks to see if it was stable, and i did not solve a single block... Sure, it might not be impossible, but your odds are really low.

EDIT: truth be told, based on the info i got from my node, it does seem like a lot of people did turn off their ASIC's since i last tested my container.... A couple weeks ago, my node estimated the total network hashrate to be >400Th/s, whilst now it's only >70 Th/s, and i do indeed see blocks being mined at difficulty 1 (which was not the case a couple weeks ago). So yes, maybe at the moment it might be possible to mine a couple testnet4 blocks with your cpu if you're really lucky.
copper member
Activity: 906
Merit: 2258
June 10, 2024, 01:45:59 AM
#7
Quote
Just for your information: no, you can't...
Yes, I can, and I did. It is always a lottery, but I can put something in the next coinbase, if you want. There is always a chance, that it will take some time, because of frequent chain reorganizations, but it is possible.

Quote
The diff is already sky-high
The diff for CPU mining is always one. Obviously, I won't try mining any more difficult blocks on CPUs.

Also see: https://bitcointalksearch.org/topic/the-real-testnet3-difficulty-is-equal-to-one-5468925
Connected topic: https://blog.lopp.net/griefing-bitcoin-testnet/

And note, that on testnet4, some tricks are easier to achieve, than on testnet3 (as long as the basic block reward is still quite high).
legendary
Activity: 3584
Merit: 5248
https://merel.mobi => buy facemasks with BTC/LTC
June 10, 2024, 01:02:42 AM
#6

Why you need a faucet, if you can mine a block on your CPU? For example, note how many blocks were mined by wiz: https://mempool.space/testnet4/mining/pool/wiz


Just for your information: no, you can't... The diff is already sky-high (well, not sky-high compared to the main net, but sky-high compared to a cpu-mining setup)... I did the math a couple of weeks ago, and at that time, on average, it would take several hundreds of years to mine a block using your cpu on testnet 4. I have no idear why people would run ASIC's on a testnet, but apparently, they do...

EDIT: here are the current stats from my testnet4 node... A lot lower than a couple weeks ago, but still waaaaaaaaay to high for cpu mining:

Code:
{
  "blocks": 29322,
  "difficulty": 32874715.22081029,
  "networkhashps": 71876496349832.81,
  "pooledtx": 272,
  "chain": "testnet4",
  "warnings": [
    "This is a pre-release test build - use at your own risk - do not use for mining or merchant applications"
  ]
}

newbie
Activity: 4
Merit: 2
June 10, 2024, 12:45:31 AM
#5
Test coins are weird: some of them are free, some of them are burned. But it seems you got what you wanted anyway.

to whoever did this, thanks a ton!
newbie
Activity: 26
Merit: 62
June 09, 2024, 09:53:36 AM
#4
Test coins are weird: some of them are free, some of them are burned. But it seems you got what you wanted anyway.
sr. member
Activity: 192
Merit: 262
Rollbit.com - Crypto Futures
June 07, 2024, 09:53:32 PM
#3
I am looking to set up testnet4 to begin testing my current project without needing to index all the testnet3 blocks. However, I haven't been able to find a testnet4 faucet yet. Would anyone be willing to share some tBTC with me at the following address?

It seems that you are not serious enough to find out about the testnet4 faucet site. If you really need testnet4 tBTC, you can get some tBTC from the sites

https://coinfaucet.eu/en/btc-testnet4/
https://mempool.space/testnet4/faucet
https://testnet4.anyone.eu.org/

As explained above, the testnet4 network https://mempool.space/testnet4 is not final, and it may not be this network that will be used later.
copper member
Activity: 906
Merit: 2258
June 07, 2024, 12:13:31 AM
#2
Quote
However, I haven't been able to find a testnet4 faucet yet.
Why would anyone run a faucet for the network, which is not yet finalized, and can be resetted at any time?

Quote
Would anyone be willing to share some tBTC with me at the following address?
Why you need a faucet, if you can mine a block on your CPU? For example, note how many blocks were mined by wiz: https://mempool.space/testnet4/mining/pool/wiz

One of the latest blocks: https://mempool.space/testnet4/block/0000000012bfe95b1e2fcdccf0f855792a051e2412287869c758491a5cacdbf7

See? Those blocks have just the minimal difficulty. You need only CPU to mine it.
newbie
Activity: 4
Merit: 2
June 06, 2024, 09:30:00 PM
#1
I am looking to set up testnet4 to begin testing my current project without needing to index all the testnet3 blocks. However, I haven't been able to find a testnet4 faucet yet. Would anyone be willing to share some tBTC with me at the following address?

tb1preru33xeap6v33g0jaypn7x2dsuheyny0n0hh48wany8h8kz98us8l9rv9

Thanks in advance!
Pages:
Jump to: