Bitcoin Forum
April 24, 2024, 06:04:05 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1] 2 3 4 »
1  Bitcoin / Bitcoin Technical Support / create version2 transactions in coinb.in on: April 06, 2024, 03:15:02 PM
Hi all,

is coinb.in old-fashioned and thus creates only version 1 TX? I wasn't able to find any setting to enable the creation of v2 transactions. Any clues ?

Cheers
citb0in
2  Bitcoin / Bitcoin Discussion / Genesis block reward 1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa on: March 31, 2024, 07:04:24 PM
This is the bitcoin address that received the very first Bitcoin block reward in the genesis block:

1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa

What information is known about the use of this address? Who regularly sends coins to this address and, above all, for what potential reason?
3  Bitcoin / Bitcoin Technical Support / Implementing 2-of-2 Multisig with Existing Bitcoin Addresses on: February 19, 2024, 07:02:54 PM
Hello Bitcoin Community,

imagine following scenario: Alice owns the private key for Bitcoin address 1example555... and Bob owns the private key for Bitcoin address 1foo888... Now, Alice and Bob want to implement a 2-of-2 multisig setup. I have a few questions regarding this process:

1) Do they need to generate a new Bitcoin address for this purpose, or can they use their existing addresses?

2) Could someone provide a step-by-step guide on how to achieve this using Bitcoin Core or Electrum, preferably with an example?

3) Is it necessary to fund the newly created Bitcoin address during this process, or can they generate the multisig Bitcoin address without funding it?

If Alice and Bob want to transfer all their coins to this newly created multisig 2-of-2 address, do they both need to approve the transaction along 2-of-2, or can Alice and Bob independently execute the transaction as usual from their private addresses, with the multisig address as the destination?

EDIT: I think this answers my question and I understand. Please correct me if I'm wrong --> a new multisig address is going to be generated which will be treated independently of Alice and Bobs' private address. In case Alice and Bob want to fund the new multisig address they can use any bitcoin source address, right? However, I've still an unanswered question that was born out off this: is the Bitcoin address of Alice and Bob somehow related to the new-created multi-sig address or can Alice and Bob continue using their private address as they were used to before the multi-sig address creation ?

I would appreciate any insights or guidance on this matter. Thanks to @ll in advance
citb0in
4  Bitcoin / Project Development / fastest way in C to generate numbers on: February 09, 2024, 07:29:56 PM
Hi folks.

I'm trying to achieve the highest possible throughput for number generation and am making my first attempts in C. Unfortunately I can't manage to work with multithreading, all my attempts failed. The goal is to simply generate numbers from 1 to 2^n and measure the time needed to do so in order to work as efficiently as possible. My current simple program looks like this:

The user can enter an integer number from 1-100 and then the program starts and generates all numbers starting from 1 up to 2^n. It writes the result into the output.txt file. At the end of the program it displays the required time.

Code:
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>

int main() {
    int n;
    printf("Enter the value of n (1-100): ");
    scanf("%d", &n);

    if (n < 1 || n > 100) {
        printf("Invalid input. Please enter an integer between 1 and 100.\n");
        return 1;
    }

    clock_t start_time, end_time;
    double total_time;

    start_time = clock();

    FILE *output_file = fopen("output.txt", "w");
    if (output_file == NULL) {
        printf("Error opening file.\n");
        return 1;
    }

    int end_number = pow(2, n);

    for (int i = 1; i <= end_number; i++) {
        fprintf(output_file, "%d\n", i);
    }

    fclose(output_file);

    end_time = clock();
    total_time = (double)(end_time - start_time) / CLOCKS_PER_SEC;
    printf("Total runtime: %.4f seconds\n", total_time);

    return 0;
}

Here are some benchmark results on my machine for this simple program:

Quote
25 bit --> 1.9 seconds
28 bit --> 9.87 seconds
30 bit --> 40.01 seconds

I would like to be able to use multithreading or multiprocessing so that the program runs not only on one thread/core but optionally on several or all cores available to the system. The load would have to be shared, similar to Python with concurrent feautures with which I had the best experience.

The very best would of course be the use of CUDA, but I have absolutely no idea how to write the kernel for this.A typical sequence of operations for a CUDA C program is:

Declare and allocate host and device memory.
Initialize host data.
Transfer data from the host to the device.
Execute one or more kernels.
Transfer results from the device to the host.

If anyone could assists with a simple basic structure as a template, that would help me a lot. I am very grateful for any tips.
5  Bitcoin / Development & Technical Discussion / BIP-125 and maximum total of 100 transactions to be replaced on: February 09, 2024, 07:46:55 AM
The policy BIP-125 specifies two ways a transaction can signal that it is replaceable.

Explicit signaling: A transaction is considered to have opted in to allowing replacement of itself if any of its inputs have an nSequence number less than (0xffffffff - 1).
Inherited signaling: Transactions that don't explicitly signal replaceability are replaceable under this policy for as long as any one of their ancestors signals replaceability and remains unconfirmed.
Implementation Details
The initial implementation expected in Bitcoin Core 0.12.0 uses the following rules:

One or more transactions currently in the mempool (original transactions) will be replaced by a new transaction (replacement transaction) that spends one or more of the same inputs if,

The original transactions signal replaceability explicitly or through inheritance as described in the above Summary section.
The replacement transaction may only include an unconfirmed input if that input was included in one of the original transactions. (An unconfirmed input spends an output from a currently-unconfirmed transaction.)
The replacement transaction pays an absolute fee of at least the sum paid by the original transactions.
The replacement transaction must also pay for its own bandwidth at or above the rate set by the node's minimum relay fee setting. For example, if the minimum relay fee is 1 satoshi/byte and the replacement transaction is 500 bytes total, then the replacement must pay a fee at least 500 satoshis higher than the sum of the originals.
The number of original transactions to be replaced and their descendant transactions which will be evicted from the mempool must not exceed a total of 100 transactions.
The initial implementation may be seen in Bitcoin Core PR#6871 and specifically the master branch commits from 5891f870d68d90408aa5ce5b597fb574f2d2cbca to 16a2f93629f75d182871f288f0396afe6cdc8504 (inclusive).

I am not sure if I have understood this correctly. Can someone from the devs explain this to me in more detail? How was this implemented in the current bitcoin core versions? Does this mean that you can replace a transaction at most 100x?

Is this related to this maxDescendantsToVisit value or is this something completely different and not in the context of BIP-125?

Quote
src/main.cpp:
Code:
[...]
const int maxDescendantsToVisit = 100;
[...]

I wasn't able to find this directive in the /src folder of Bitcoin Core. Any insight to this much appreciated. What's the limit and how does eviction works? Thank you in advance.
6  Bitcoin / Development & Technical Discussion / process flow of transactions > mempool / full-nodes on: February 08, 2024, 07:40:14 AM
The following scenario: John is the owner of the private key for the address 123EX456 and uses Bitcoin Core. He operates a full node that is correctly connected and up to date. John manually creates a raw transaction, signs it and feeds it into the Bitcoin network, but does not use his full node but one of the well-known large blockchain explorers that allows a signed transaction to be sent. The transaction has 123EX456 as input and the output address of his friend Bill. The transaction is successfully submitted, and the transaction can be viewed on the block explorers, even though it is unconfirmed.

Question:
What would John's full node see when John fires up Bitcoin core? Does it notice anything at all? Does John's full node poll all his connected node partners at regular intervals and see this unconfirmed TX? Would John now see a lower account balance in his full node, even though the TX was not performed on his full node but is still known in the network and even though it is unconfirmed? Or will John's full node never seen anything as long as the TX gets a confirmation ?

I am trying to understand the context of the workflow. I am not yet clear what types of mempool there are and I do not yet understand in which mempool the TX submitted by John has ended up. He had used a public service on the web to submit the transaction, so did the TX just end up in the mempool of the full node of that web service and is waiting for confirmation?
7  Bitcoin / Development & Technical Discussion / how-to clean up chainstate folder on: January 29, 2024, 11:10:49 AM
In short: a pruned node that uses the minimum possible value "prune=550" shows a folder structure of

./blocks = 704M
./chainstate = 11G

This of course goes beyond the actual purpose of a pruned node. Why does the folder content of chainstate rise to this immense height? And how can this immensely high disk usage of the chainstate folder be cleaned up? Simply deleting it is certainly not a good option. What is the best way to proceed in such a case?
8  Bitcoin / Development & Technical Discussion / custom mnemonic wordlist to generate deterministic keys and compare to addresses on: January 22, 2024, 07:43:51 PM
Hi all

do any of you know of an open source project preferably on github for free use that I could use as a basis for the following?

a custom mnemonic wordlist should be used, let's call it <klingon_mnemonic_word.lst> Smiley this klingon wordlist contains 2048 lines in total, a line can contain special characters like hyphens or an equal sign or other special characters. Spaces are also considered special characters. One word (or words) per line, so in summary the word list <klingon_mnemonic_word.lst> has 2048 lines.

Then there is another file called <btc_addresses.lst>. The tool should mass-gen n deterministic keys by using x words of the given mnemonic word list. The user should also be able to input how many derivation paths should be used for the generation. Then the seed should be generated and used to generate priv keys and their addresses. It should instantly check against the given list of Bitcoin addresses <btc_addresses.lst> and if a hit occurs it should output the result also to a log file <winner.txt>

Which freely available program (preferably Python or C++) can already handle this and I could use it as the basis for a test project so that I don't have to reinvent the wheel?

I look forward to helpful answers and thank you in advance.
9  Bitcoin / Bitcoin Technical Support / cannot getrawtransaction on a txindex=0 node although block hash provided on: January 22, 2024, 11:40:04 AM
Hey everybody,

when I read the help of bitcoin-core command
Code:
getrawtransaction
I get this ...
Quote
getrawtransaction "txid" ( verbosity "blockhash" )

By default, this call only returns a transaction if it is in the mempool. If -txindex is enabled
and no blockhash argument is passed, it will return the transaction if it is in the mempool or any block.
If a blockhash argument is passed, it will return the transaction if
the specified block is available and the transaction is in that block.

Hint: Use gettransaction for wallet transactions.

If verbosity is 0 or omitted, returns the serialized transaction as a hex-encoded string.
If verbosity is 1, returns a JSON Object with information about the transaction.
If verbosity is 2, returns a JSON Object with information about the transaction, including fee and prevout information.

Arguments:
1. txid         (string, required) The transaction id
2. verbosity    (numeric, optional, default=0) 0 for hex-encoded data, 1 for a JSON object, and 2 for JSON object with fee and prevout
3. blockhash    (string, optional) The block in which to look for the transaction

I tried, and the result was not as expected. I used
Code:
getrawtransaction "abc123...TX...ID..." 0 <blockhash>

and the error was:
Quote
No such mempool transaction. Use -txindex or provide a block hash to enable blockchain transaction queries. Use gettransaction for wallet transactions. (code -5)

In my understanding, it should return the requested data when I provide the blockhash even my full-node does not utilize txindex=1
The error message that Bitcoin Core outputted says the same: Either -txindex enabled or block hash provided.

But it doesn't. I am running latest version, why does this not work? Is the help page outdated somehow? Of course, when I enable txindex I get the result but this is contrary to what the documentations and help page of that command shows.

citb0in
10  Bitcoin / Development & Technical Discussion / Remove obsolete RPC function "sendfrom" from the documentation on: January 14, 2024, 07:29:43 PM
To the developers, providers or supporters of the bitcoin core documentation at the URL:

https://developer.bitcoin.org/examples/transactions.html

Quote
[...]
To spend a specific UTXO, you could use the sendfrom RPC instead.
[...]

I stumbled over the mentioned function and as far as I can tell, this function was removed several years ago and is deprecated.

I could not find any information in the current Bitcoin core versions, and my own tests have shown that this command is not known. Presumably this has not been removed from the documentation, or an updated note has been written about it.

If this is not known, I would like to kindly point it out. If I am wrong and the explanation is to be found elsewhere, please correct me.

Thank you very much for your attention.
citb0in
11  Bitcoin / Development & Technical Discussion / transactions and their distribution via mempools on: January 14, 2024, 05:16:15 PM
Hello forum,

Bob has made a transaction in bitcoin core. The TXID was immediately visible in https://mempool.space

Bob created another transaction on another day. The TXID was not visible in mempool.space even after several minutes. Only after about 2 hours did the TXID appear there.

Bitcoin core displayed both transactions immediately in the dashboard. Bob finds both transactions in the mempool of its bitcoin core installation and can view its details.
Quote
bitcoin-cli getrawmempool |grep <TXID1>
bitcoin-cli getrawmempool |grep <TXID2>
bitcoin-cli getmempoolentry <TXID1>
bitcoin-cli getmempoolentry <TXID2>

What are the possible reasons why the second transaction only appeared in the mempool hours later? Bitcoin core was continuously connected to the Internet, no connection problems or other warnings/errors in the log.

Charlie operates several full-nodes across the globe. Bob has asked Charlie to give him info on whether Charlie's nodes know these TXIDs. So Charlie also executed the commands shown above. Charlie could not detect either transaction in his mempool.

I would be interested to know what the usual route and process chain of the mempool looks like once a user creates a transaction on his local Bitcoin core. Bob uses a pruned full-node, Charlie an archived full-node with -txindex and neither of them mines blocks.

Who can explain how this process chain works in detail or point me to helpful help pages?

Many thanks
citb0in
12  Bitcoin / Bitcoin Technical Support / ask a reputable large mini-pool to include a transaction in block on: January 02, 2024, 09:56:01 PM
Assuming you want to make a transaction without the public key being known in the mempool. What options are there if you do not own any mining hardware? Which large, well-known, trustworthy miners could you ask for support with a completed transaction? I imagine that it would have to be a really large mining pool that regularly mines blocks successfully. Have any of you ever done something like this and can share experiences? Do you send an email inquiry to Antpool or ViaBTC and simply ask them for such a favor? I hardly think they care, don't they? Should you suggest an attractive amount as a "donation" so that they carry out the favor?

Who has ever done something like this and can report back? I'm curious and look forward to your answers.
13  Bitcoin / Development & Technical Discussion / challenges of blockchain growth and potential solutions on: January 02, 2024, 09:42:22 AM
Hi all, wish you a Happy and Healthy New Year 2024!

Lately I've been contemplating the rapid growth of the Bitcoin blockchain and its potential impact on full-node operators. With the current blockchain size surpassing 500GB (538.09 GB on Jan/01/2024) there's a concern that some of us may be approaching capacity limits to continue hosting such large amounts of data.

Therefore, I'd like to take this opportunity to initiate an open discussion on this matter and find out what solutions or considerations might already be in place. Here are some thoughts that have crossed my mind:

    - Block Size Limit: What is the community's stance on potentially adjusting the block size limit to manage growth? Are there ongoing discussions on this topic?

    - Second-Layer Solutions: How effective are second-layer solutions like the Lightning Network in relieving the main blockchain? Are there experiences or concerns that we can share?

    - Pruning: For those already implementing pruning, how has this impacted your node's resource usage? Any insights or recommendations for others considering this approach?

    - Optimizations: Are there any ongoing efforts or developments within the Bitcoin protocol to optimize resource usage and improve scalability?

Here are some current stats as of today:

Last Value from Jan 1 2024, 22:03 EST:
538.09 GB

Value from 1 Year Ago:
446.05 GB

Change from 1 Year Ago:
20.63%

Average Growth Rate:
118.8%

I believe that by pooling our collective knowledge and experiences, we can better understand the current landscape and potentially contribute to the ongoing evolution of the Bitcoin ecosystem. Please share your thoughts, insights, or any information you may have on this topic. Looking forward to a fruitful discussion!

Cheers,
citb0in
14  Bitcoin / Bitcoin Technical Support / adding "sending address" in bitcoin core fails on: December 27, 2023, 10:01:47 PM
Hello, I have created a wallet in bdb format with avoid_reuse=false in Bitcoin Core 26.0.0 for testing purposes and imported the corresponding transactions manually using importprunedfunds. This worked for all incoming payments, i.e. incoming transactions. Unfortunately I could not import the outgoing transactions with this command, the error message appears:
Quote
No addresses in wallet correspond to included transaction (code -5)

So I checked the windows "Receiving Addresses" and "Sending Addresses". Under "Receiving Addresses" I see my wallet address as expected, that's why the importfunds worked for incoming transaction. I'm pretty sure Bitcoin core expects to see my wallet address under "Sending Addresses" but this window is empty. So I create to add my same address to "Sending Addresses", too. But it fails with the error message:
Quote
Address "123foobar" already exists as a receiving address with label "foo" and so cannot be added as a sending address

I am aware about the risk of reusing a address, but as this is only for testing purposes with no valuable coins in there I know what I'm doing. I just like to import the outgoing transactions, too. What am I missing here? Do I need to start bitcoin core with any certain parameter that to override maybe a deprecated option that I'm not aware of ? Or is this a still unsolved bug ? Any help appreciated. Thanks
15  Bitcoin / Bitcoin Technical Support / anyone running a non-pruned full node - please help with gettxoutproof on: December 27, 2023, 09:08:56 PM
Anyone out there running a non-pruned full node with "-txindex", can you please provide the result of:

gettxoutproof '["65c7e5cbff719ff7fd32645b777cb20b69db513f1cd6a064dfcc95b69ad77acc"]'
gettxoutproof '["2185591eac841d79af1699bfe8f533da7363aff98585fe92487df659cd69414c"]'
gettxoutproof '["5f5a35c937c2e6cf47774024b826f4f30212e860ed606dc7787438ca7c5a88cf"]'
gettxoutproof '["eec7a2ba8a89b4eabe7109518af6c7e84488760fe285501e1460b76bca297c00"]'
gettxoutproof '["43bb89f7d16fb47fee3eaeee0fa26aa2d0d6874c8907b2eca4ec2420bf4a9dc3"]'
gettxoutproof '["17e4e323cfbc68d7f0071cad09364e8193eedf8fefbcbd8a21b4b65717a4b3d3"]'
gettxoutproof '["7c432398c7631600af01695c9767eff109cbfae4f7ecccaff388043a474d4f1e"]'
gettxoutproof '["5d45587cfd1d5b0fb826805541da7d94c61fe432259e68ee26f4a04544384164"]'
gettxoutproof '["08389f34c98c606322740c0be6a7125d9860bb8d5cb182c02f98461e5fa6cd15"]'

Thank you in advance.
citb0in
16  Bitcoin / Project Development / Keyhunt-CUDA - searching for predefined list of keys on: December 16, 2023, 03:43:57 PM
Hello community,

does anyone know a Keyhunt-CUDA version that is able to read a file that has a hexkey per line and searches this list sequentially?

Example:
unordered.lst is a 500MB file and contains a private key per line in hexadecimal form. Now Keyhunt-Cuda should read this file instead of a range and process it sequentially, e.g:

./KeyHunt-Cuda -t 0 -g -m address --keylist privkey.lst 123btcaddress...

but it should also be possible to specify several wallet addresses using the "-m addresses" switch, e.g:

./KeyHunt-Cuda -t 0 -g -m addresses --keylist privkey.lst walletaddress.lst

Does anyone know of such a modified KeyHunt-Cuda version that may already exist? Or is someone able to implement this modification in the latest KeyHunt-Cuda version? I look forward to constructive feedback and wish you all a nice weekend.
17  Bitcoin / Project Development / KeyHunt-Cuda version that works with p2sh and bech32 (3 and 1) adresses on: May 04, 2023, 03:58:15 PM
Hi everybody,

is anyone aware of a KeyHunt-Cuda version that supports p2sh and bech32 addresses as well? Any hints appreciated.

Thanks.
18  Bitcoin / Bitcoin Discussion / incorrect output of information on blockcypher.com on: April 23, 2023, 10:49:16 AM
Hello all. I am puzzled about the information showed on blockcypher.com and can not explain it at the moment. For example, it is about the following Bitcoin address 1BFhrfTTZP3Nw4BNy4eX4KFLsn9ZeijcMm

On the most diverse block explorers like mempool.space or blockchair.com or blockchain.com  I see following information for this address:

Total transactions: 173
Total received: 0.16381090 BTC
Total sent: 0.16381090 BTC

However block explorer blockcypher.com outputs for that address a fewer amount of total received/sent amount
https://live.blockcypher.com/btc/address/1BFhrfTTZP3Nw4BNy4eX4KFLsn9ZeijcMm

Total received: 0.1474109 BTC
Total sent: 0.1474109 BTC

Why? All explorers show the correct total transactions of 173 though. How can the mismatch be explained? So far, blockcypher seems not outputting correct information.

I must add that the API service of this page could be used for several Bitcoin tools available out there, and these tools might therefore output incorrect or incomplete information. One example is the python library pycoin.


19  Bitcoin / Development & Technical Discussion / solomining probability calculator on: January 28, 2023, 12:24:23 AM
Hello all,

The following post grew out of a discussion of another post. There the user akaki had criticized that in solomining one cannot simply multiply the calculated probability of a block hit per block average time of 10min with any desired time frame that would result in the probability e.g. for 1h, or a day, or a year. The user mikeywith has thankfully countered with very informative posts and explained the opposite. Since I wanted to dedicate myself to this topic intensively and learn more, I made a learning project out of it and wrote a Python program in parallel, which I constantly extended. This way I could try out different approaches and implement my learning into a working program right away.

At this point again a BIG THANKS to @mikeywith, who has really animated me to do this and has helped with his valuable explanations on.

I had already recommended the moderators to move the corresponding posts #46 - #56 to a new thread here in the technical forum, since this has become off-topic after all, but the mods probably haven't seen or wanted to implement that yet. I think it is appropriate to move the discussion here on technica part of the forum so that it is clear to everyone what it was actually about and on this way more information and a good discussion could follow.

All this resulted in the following python tool which I have uploaded to my repository [1] and would like to share with interested parties. I would like to add that I'm a complete Python beginner and still taking the first steps, so bear with me and correct me if you find any gross errors. I am also open to recommendations or constructive advice and will try to implement them in my free time. The goal is to learn and continue to have fun.

The "Solomining Probability Calculator" is a tool designed to assist solo miners in understanding their chances of successfully mining a block on the Bitcoin network. The program takes the user's hash rate as input, supporting various formats for ease of use. It also retrieves the current Bitcoin network difficulty which is then used to calculate a range of important mining metrics. These include the ratio of all hashes over the valid hashes, the probability of each single hash attempt, expected time to mine a block and the probability of successfully mining a block for various time frames. Additionally, the program offers helpful analogy and phrases to provide a better human-understanding of the probabilities, making it easier for users to interpret the results. With this tool, solo miners can gain valuable insights into their mining operations and make more informed decisions. Overall, the solomining probability calculator is a valuable tool for any solo miner looking to increase their chances of success in the competitive world of cryptocurrency mining.

If you like it and are interested, I could imagine to move the function to a website. This is because I have found that the solochance.com website that I am familiar with does not include current Difficulty values, and thus the calculations are not accurate when I compare them to others and my own calculations. I may be wrong, but I suspect that the relevant values like "difficulty" or "nbits" are not kept up to date there or may be manually entered by the operator from time to time. That would explain the deviation. For this reason, I was thinking about using my existing Python program as a basic framework to create a website with that functionality and output. I think I would have to rewrite that in JavaScript, which would be again (almost) new territory for me but if there is great interest then I would tackle that. Just let me know.

Have fun and a nice weekend.
citb0in

[1] https://github.com/citb0in/solomining_probability_calc
20  Bitcoin / Development & Technical Discussion / secp256k1 signrec - sha256 to final signature ? on: January 07, 2023, 09:43:27 AM
Hello all. I am referring to secp256k1 library in Python where you can signrec a message.
Following example:
Quote
privkey = '0000000000000000000000000000000000000000000000000000000000000001'
message = 'Hello, world!'

after signing it will produce the signature
Quote
b85d62928d63583f52b14995c9444a92e1b7998a3fcfd0c134f327d61b162c6e7ea40adb783bd4c 00f9cfdb829c7e7d5b8d8e25a797d8548aec6f41df461fab9

I am digging into the code and like to understand what the process looks in detail. I am stuck on the last point and hopefully someone can shed some light onto...

The signrec command line argument calls the function ecdsa_sign_recoverable
Code:
[...]
    elif args.action == 'signrec':
        priv, sig = sign('ecdsa_sign_recoverable', args)
[...]

the message is hashed one time through sha256 and stored into the variable name msg32. The sha256 from the message shown is
Quote
315f5bdb76d078c43b8ac0064e4a0164612b1fce77c869345bfc94c75894edd3

Code:
[...]
    def ecdsa_sign_recoverable(self, msg, raw=False, digest=hashlib.sha256):
        if not HAS_RECOVERABLE:
            raise Exception("secp256k1_recovery not enabled")

        msg32 = _hash32(msg, raw, digest)
[...]

So far so good and understood. But on the next step the raw_sig variable is created by calling ffi.new('secp256k1_ecdsa_recoverable_signature *')

Code:
[...]
        raw_sig = ffi.new('secp256k1_ecdsa_recoverable_signature *')

        signed = lib.secp256k1_ecdsa_sign_recoverable(
            secp256k1_ctx, raw_sig, msg32, self.private_key,
            ffi.NULL, ffi.NULL)
        assert signed == 1

        return raw_sig
[...]

I am trying to understand what exactly is done in this step but I have no insight. I see that the called functions are derived from _libsecp256k1.
Code:
from ._libsecp256k1 import ffi, lib

I looked into the filesystem of that python module secp256k1, there is the file:
Quote
~/.local/lib/python3.10/site-packages/secp256k1/_libsecp256k1.cpython-310-x86_64-linux-gnu.so

but I have no clue what's inside. Can anyone explain to me, please?
What process in detail is done to get from the sha256 hash "315f5bdb76d078c43b8ac0064e4a0164612b1fce77c869345bfc94c75894edd3"
--> to the final signature ?

Quote
b85d62928d63583f52b14995c9444a92e1b7998a3fcfd0c134f327d61b162c6e7ea40adb783bd4c 00f9cfdb829c7e7d5b8d8e25a797d8548aec6f41df461fab9

My next question ... If I'm not mistaken the shown final signature in base64 representation is:
Quote
IEkjQHms3Yy0+B8INBVgKozpZc1rf3OHf7MCk2CnrGorYk2TEnwnNSHnLuK8tRkBIAIR1c9i8NCO19EebEHCMak=

How do you convert this base64 to get to the hex representation and vice-versa ?

Thanks to all.
Pages: [1] 2 3 4 »
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!