Bitcoin Forum
May 11, 2024, 06:08:41 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1]
1  Local / Кодеры / Как вытащить из hex raw транзакции комиссию и по on: September 24, 2023, 09:21:58 AM
Как вытащить из hex raw транзакции комиссию и получить входные суммы?

020000000001012ed19c0d7cee13d32e36a0b3f42e07404e0db43ac589962693264f9b764c38a50 100000000fdffffff023b770a000000000017a914252c6ccd8c3d8f72d5ac424fa05daf7db7e9f8 b5875a17fc6800000000160014f60834ef165253c571b11ce9fa74e46692fc5ec10248304502210 086b64a551e68fdea629930ab7590da58cbec8b5ec6648100cb69eacd87410ca402204b4afe518c 84874b03e31246542d8a41e3e18e8157c4fee71b26f94610bd7c7c0121026e5628506ecd33242e5 ceb5fdafe4d3066b5c0f159b3c05a621ef65f177ea28600000000

{
    "Version": "02000000",
    "IsCoinBase": "False",
    "IsWitness": "True",
    "WitnessCount": "0001",
    "InputCount": "01",
    "Inputs": [
        {
            "ID": "2ed19c0d7cee13d32e36a0b3f42e07404e0db43ac589962693264f9b764c38a5",
            "AddressType": "Hash160",
            "Address": "f60834ef165253c571b11ce9fa74e46692fc5ec1",
            "VOUT": "01000000",
            "ScriptSigSize": "",
            "ScriptSig": "",
            "WitnessDataSig": [
                "48304502210086b64a551e68fdea629930ab7590da58cbec8b5ec6648100cb69eacd87410ca4022 04b4afe518c84874b03e31246542d8a41e3e18e8157c4fee71b26f94610bd7c7c01",
                "21026e5628506ecd33242e5ceb5fdafe4d3066b5c0f159b3c05a621ef65f177ea286"
            ],
            "Sequence": "fdffffff"
        }
    ],
    "OutputCount": "02",
    "Outputs": [
        {
            "AddressType": "Hash160",
            "Address": "252c6ccd8c3d8f72d5ac424fa05daf7db7e9f8b5",
            "Value": "3b770a0000000000",
            "ScriptPubKeySize": "17",
            "ScriptPubKey": "a914252c6ccd8c3d8f72d5ac424fa05daf7db7e9f8b587"
        },
        {
            "AddressType": "Hash160",
            "Address": "f60834ef165253c571b11ce9fa74e46692fc5ec1",
            "Value": "5a17fc6800000000",
            "ScriptPubKeySize": "16",
            "ScriptPubKey": "0014f60834ef165253c571b11ce9fa74e46692fc5ec1"
        }
    ],
    "LockTime": "00000000"
}
2  Local / Кодеры / Как мне вытащить Pkscript(P2WSH) публичный ключ из witness data в т&# on: September 23, 2023, 12:40:16 PM
Как мне вытащить Pkscript(P2WSH) публичный ключ из witness data в транзакции из входа?

Транзакция:
https://www.blockchain.com/ru/explorer/transactions/btc/3cddfcd05a151d4b42df6505da7c2725772ba75663f2bd4bd2b37ef263f942bc



"WitnessDataSig": [
   "00",
   "4730440220196d759a59107aab4fd62eb3b2998befee5766312da5fd62e1068c0c35f7b2f102203 960b328ac8d65b541db3848e4d5f01f88ec690aaeb92fe1ff33ef40d5518d7101",
    "47304402207eeae87a737bb78dea5479413b2bd361387a5f27fab3193a0cf87d5a742b056802202 655926ee18aea4d47fd5d836554e04a466906bd0e378130c718f12e86e7c31701",
    "69522102755a063ef9223a86ecd06e1cb3c149d69de240542197a30900439543bec621f72102e62 c172505d9c48f57383257b6cc5f22e4cb04d0fe1ed9e4785b3593ab83eb6a210300329f881907a2 49d8c4af0c6a9d4fe158f3e14f8d3e1254e4ef3038af52b88653ae"
]

Нужно получить Pkscript: 8b262f778fe8ceb21e93bdef10ff19fca5bd3b06066980ec70a2c9916779eb1b
3  Local / Новички / Bitcoin TestNet CLI RPC Почему не получается импортировать п on: September 17, 2023, 07:40:22 PM
Я пытаюсь импортировать хоть какой-то приватный ключ в кошелек но в результате получаю ошибку: Эта команда поддерживает только устаревшие кошельки.
И при создание кошелька много раз менял disable_private_keys: true/false и ничего не помогло

D:\Bitcoin\daemon>bitcoin-cli -conf=D:\Bitcoin\bitcoin.conf createwallet Test false false "1"
{
  "name": "Test"
}

D:\Bitcoin\daemon>bitcoin-cli -conf=D:\Bitcoin\bitcoin.conf getwalletinfo
{
  "walletname": "Test",
  "walletversion": 169900,
  "format": "sqlite",
  "balance": 0.00000000,
  "unconfirmed_balance": 0.00000000,
  "immature_balance": 0.00000000,
  "txcount": 0,
  "keypoolsize": 4000,
  "keypoolsize_hd_internal": 4000,
  "unlocked_until": 0,
  "paytxfee": 0.00000000,
  "private_keys_enabled": true,
  "avoid_reuse": false,
  "scanning": false,
  "descriptors": true,
  "external_signer": false
}

D:\Bitcoin\daemon>bitcoin-cli -conf=D:\Bitcoin\bitcoin.conf walletpassphrase 1 6000

D:\Bitcoin\daemon>bitcoin-cli -conf=D:\Bitcoin\bitcoin.conf importprivkey 1
error code: -4
error message:
Эта команда поддерживает только устаревшие кошельки.


CONFIG:

debug=blockchain,net,mempool

testnet=1

rpcpassword=Test
rpcuser=Test

datadir=D:\Bitcoin\BitcoinData

txindex=1
zmqpubrawtx=tcp://127.0.0.1:28332
zmqpubhashtx=tcp://127.0.0.1:28332
zmqpubrawblock=tcp://127.0.0.1:28332
zmqpubhashblock=tcp://127.0.0.1:28332
zmqpubsequence=tcp://127.0.0.1:28332

server=1

====================================================================

Я хочу отслеживать транзакции в нескольких кошельках одновременно с проверкой баланса.
Пытаюсь реализовать аналогичный принцип проверки транзакций как на обменниках.

4  Local / Кодеры / 🤔Как Создается nBits в блоке?🤔 on: December 15, 2022, 03:01:35 PM
Как Создается nBits в блоке?
Я так понимаю значение nBits получаем из сложности?

https://www.blockchain.com/explorer/blocks/btc-testnet/2411364

из Difficulty:
86564599.52

в Bits:
422681968

Как это сделать?
5  Bitcoin / Development & Technical Discussion / How to get <target> values ​​for a block? The question is closed. on: December 14, 2022, 11:12:03 PM
You provided nbits = 422681968
If you convert that integer value to hex, you get the 4 bytes (32 bits) that nbits is made up of:
422681968 = hex value 0x19319D70

Split the first byte off of nbits to get hex value 0x19 leaving behind the remaining 3 bytes of 0x319D70
These are the two pieces that are used to calculate the target hash value and the difficulty using this formula:
TARGET = 0x319D70 * 2(8(0x19 - 3))

To make the math a bit easier to understand, we can convert those hex values back to integers for the purposes of this discussion:
= 3251568 * 2(8(25-3))
= 3251568 * 2(8(22))
= 3251568 * 2176
= 3251568 * 95780971304118053647396689196894323976171195136475136
TARGET = 311438341301388531462158357898567283222551020627518185013248

Convert this value back to hex to get the hash value that the block hash is compared to:
TARGET = 0x00000000000000319d7000000000000000000000000000000000000000000000

You may notice that hex value of TARGET is 0x319D70 shifted to the left until the 31 is in the 25'th (0x19) byte from the right. That's what that formula above does. It takes the last 3 bytes (6 characters) from nbits, and shifts them to the left until the first byte of that block of 3 bytes is exactly the number of bytes from the right that is specified by the first byte of nbits.

Now that you have the TARGET, the DIFFICULTY is just:
DIFFICULTY = (0xffff * 2208)/TARGET

Let's convert the formula above into integers to make the math easier to follow:
(65535 * 2208)/TARGET

We have the integer value of TARGET above so:
(65535 * 2208)/311438341301388531462158357898567283222551020627518185013248
= 86564599.52 = DIFFICULTY

Regarding my most recent message to you...

You didn't ask for it, but it's the calculation of the expected hash rate for a given difficulty is closely related, so I figured I'd share it.

The average number of hashes needed to find an acceptable hash at a given difficulty can be calculated as:
DIFFICULTY * 2256 / (0xffff * 2208)

Since the difficulty on the previous example was:
86564599.52

The average number of hashes that need to be calculated per block is:
= 86564599.52 * 2256 / (0xffff * 2208)
= 86564599.52 * 2256 / (65535 * 2208)
= 371797797113897361

Since blocks are intended to occur on average every 10 minutes (and there are 600 seconds in 10 minutes), this means that a difficulty of 86564599.52 would be set when the global average hash rate is:
371797797113897361 total hashes / 600 seconds = 619662995189828 hashes per second.

That's about 619.663 Thash/sec

The question is closed.
6  Local / Майнеры / 🤔Почему <getrawmempool> возвращает пустое значение?🤔 on: December 12, 2022, 01:34:51 PM
Почему <getrawmempool> возвращает пустое значение?
BTC-TESTNET синхронизирован

FIX Bitcoin Config: blocksonly=1 TO blocksonly=0
7  Bitcoin / Mining / 🤔Why does <getrawmempool> return empty?🤔 on: December 09, 2022, 11:44:11 AM
Why does <getrawmempool> return empty?

Code:
testnet=1
[test]
addnode=104.237.131.138
addnode=151.80.205.132
addnode=192.155.82.123
addnode=74.220.255.190
addnode=80.100.203.151

blocksdir=D:\\Bitcoin
datadir=D:\\Bitcoin

dbcache=4000
maxorphantx=1000
maxmempool=1000
blockreconstructionextratxn=1000
maxsigcachesize=100
blockmaxweight=4000000

#debug=1
#natpmp=1
blocksonly=1
logips=1
deprecatedrpc=validateaddress
deprecatedrpc=signrawtransaction
deprecatedrpc=addwitnessaddress
deprecatedrpc=accounts
acceptnonstdtxn=1
server=1
rest=1

Screen: https://pastenow.ru/f335e33eef49c18306448a298f326972
8  Bitcoin / Mining / Del on: December 06, 2022, 05:03:30 PM
del
9  Bitcoin / Development & Technical Discussion / Why is it empty when sending rpc via curl? on: October 10, 2022, 03:35:40 PM
None
10  Bitcoin / Development & Technical Discussion / What is the best language to write a miner in? on: October 09, 2022, 04:40:16 PM
What is the best language to write a miner in?
11  Bitcoin / Bitcoin Technical Support / Is it possible to somehow send a new block to the btc network without using port on: October 08, 2022, 01:26:27 PM
Is it possible to somehow send a new block to the btc network without using ports?
12  Bitcoin / Development & Technical Discussion / Pls Help!! How to get an outpoint in a transaction? #blockchain on: October 04, 2022, 06:01:17 PM
https://developer.bitcoin.org/reference/transactions.html#raw-transaction-format
https://developer.bitcoin.org/reference/transactions.html#outpoint-the-specific-part-of-a-specific-output

How to get an outpoint in a transaction?
I'm trying to parse the structure of an unprocessed transaction.

How to get this c997a5e56e104102fa209c6a852dd90660a20b2d9c352423edce25857fcd3704 hash?

Code:
0100000055bd840a78798ad0da853f68974f3d183e2bd1db6a842c1feecf222a00000000ff104ccb05421ab93e63f8c3ce5c2c2e9dbb37de2764b3a3175c8166562cac7d51b96a49ffff001d283e9e70

02

01000000 01 0000000000000000000000000000000000000000000000000000000000000000 ffffffff 07 04ffff001d0102 ffffffff 0100f2052a010000 00 43 4104d46c4968bde02899d2aa0963367c7a6ce34eec332b32e42e5f3407e052d64ac625da6f0718e7b302140434bd725706957c092db53805b821a85b23a7ac61725bac 00000000

01000000

01

   Outpoint: The Specific Part Of A Specific Output
       c997a5e56e104102fa209c6a852dd90660a20b2d9c352423edce25857fcd3704

00000000

48

47304402204e45e16932b8af514961a1d3a1a25fdf3f4f7732e9d624c6c61548ab5fb8cd410220181522ec8eca07de4860a4acdd12909d831cc56cbbac4622082221a8768d1d0901

ffffffff

02

00ca9a3b00000000

434104ae1a62fe09c5f51b13905f07f06b99a2f7159b2225f374cd378d71302fa28414e7aab37397f554a7df5f142c21c1b7303b8a0626f1baded5c72a704f7e6cd84cac00286bee00000000

43410411db93e1dcdb8a016b49840f8c53bc1eb68a382e97b1482ecad7b148a6909a5cb2e0eaddfb84ccf9744464f82e160bfa9b8b64f9d4c03f999b8643f656b412a3ac00000000

Help me figure it out.
Can you give an example of generating this hash?
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!