Skip to main content
6 votes
Accepted

Questions about secp256k1_pubkey_load/save() implementation

Wouldn't the code below work just as well? Possibly, but I believe it would be undefined behavior (and if it isn't, it'd need careful language lawyering to make sure it isn't). The existing code is ...
Pieter Wuille's user avatar
4 votes
Accepted

Questions about generating a random number for ECDSA

What's the length of k (random number), in bytes, bits? 256 bits. The number k (also called the nonce) in ECDSA must be an unpredictable value, indistinguishable from uniformly random among the set ...
Pieter Wuille's user avatar
4 votes

Bitcoin value as int64_t or as double

I want to do program that doing some calculations with bitcoin values. I know bitcoin have 8 digits after decimal point (please correct me). There is no decimal in bitcoin at code level. There is no &...
Coding Enthusiast's user avatar
3 votes
Accepted

C secp256k1 : ec_pubkey_parse successful on NULL context despite attribute

If you look at the source code, secp256k1_ec_pubkey_parse doesn't actually use its ctx argument. So no harm is done if it's null. You can see in the code that there is a VERIFY_CHECK macro to test ...
Nate Eldredge's user avatar
2 votes
Accepted

call to bip39_mnemonic_from_bytes in libwally-core returns NULL

There are a few problems, you are passing mnemonic_secret incorrectly resulting in the API call getting a NULL pointer hence returning WALLY_EINVAL. Here is a corrected version, although note that ...
makriath's user avatar
2 votes
Accepted

Basic point multiplication with G in libsecp256k1

Remember, as Pieter Wuille said, all exposed functions (only those that you'd need to use) are in include/secp256k1.h You can use secp256k1_ec_pubkey_create like this: secp256k1_context *sign = ...
MCCCS's user avatar
  • 10.2k
1 vote

In bitcoin-cli getpeerinf call what does "-1" mean as a "synced_headers" or "synced_blocks" value?

It means you either have no headers, no block, or both known to be (*) in common with this peer. From the help: $ bitcoin-cli help getpeerinfo .... "synced_headers" : n, (...
Antoine Poinsot's user avatar
1 vote

blockchain official documentation

Where can I find the official documentation of blockchain technology Nowhere. There is no official body in charge of "blockchain technology". There are many different individuals, groups and ...
RedGrittyBrick's user avatar
1 vote

How to get crypto currency wallet balances

Do I need to set up bitcoind, litecoind, neo equivalent, and all of the rest? You don't have to; you can use different APIs for different coins. But not all coins will have a service that offers that,...
Ava Chow's user avatar
  • 71k
1 vote

what is "forming a coinbase transaction"?

The link you mentioned has a few code snippets, so I am assuming the code you want to write in C is the simple mining program. The python code can act as your pseudo code and very well write your ...
Shabahat M. Ayubi's user avatar
1 vote
Accepted

Implementation of the Variable length integer in C

No. The compact size unsigned integers are not uints (except for the base one of one byte). They are a serialization, so it is actually just an array of bytes. You just compare the number you are ...
Ava Chow's user avatar
  • 71k
1 vote

How create / generate a coinbase transaction for a new block?

The coinbase transaction is like every other transaction except it has only 1 special coinbase input which you can read about here: https://bitcoin.org/en/developer-reference#coinbase. The outputs ...
Ava Chow's user avatar
  • 71k

Only top scored, non community-wiki answers of a minimum length are eligible