Bitcoin Forum
May 12, 2024, 05:43:05 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Clarifications on RFC 6979  (Read 105 times)
Bronsted (OP)
Newbie
*
Offline Offline

Activity: 11
Merit: 7


View Profile
December 05, 2020, 12:45:24 PM
Last edit: December 05, 2020, 01:28:31 PM by Bronsted
 #1

Hello all!

I have read the whitepaper and some of the more indepth aspects of Bitcoin. I have come across the implementation of RFC 6979. As far as I can tell, the motivation behind it is to eliminate the randomness of the PRNG being a weak link and resulting in the 'r' values being reused in subsequent signatures.

I have a few questions :

How does RFC 6979 ensure that the generation of the initial seed(?) to be random? Is this being implemented during the generation of the hierarchical deterministic seed to ensure randomness of the seed? To what extent is it effective if, lets say the source of the randomness is weak? Does Bitcoin Core use this, and if it does, can someone point me to the segment which this is implemented?

Thank you in advance.
Once a transaction has 6 confirmations, it is extremely unlikely that an attacker without at least 50% of the network's computation power would be able to reverse it.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
pooya87
Legendary
*
Offline Offline

Activity: 3444
Merit: 10558



View Profile
December 05, 2020, 01:23:34 PM
Merited by ABCbits (1)
 #2

RFC6797 is about HTTP Strict Transport Security (HSTS) which doesn't seem to have anything to do with bitcoin.
RFC6979 is the closest thing to what you are talking about and is implemented by almost all bitcoin wallets and is used for deterministic generation of the ephemeral key (k) for usage in Elliptic Curve Digital Signature Algorithm (ECDSA) (it has nothing to do with seed). It is to eliminate any possible issues with the RNG by making signatures deterministic while still random.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
Bronsted (OP)
Newbie
*
Offline Offline

Activity: 11
Merit: 7


View Profile
December 05, 2020, 01:29:58 PM
 #3

RFC6797 is about HTTP Strict Transport Security (HSTS) which doesn't seem to have anything to do with bitcoin.
RFC6979 is the closest thing to what you are talking about and is implemented by almost all bitcoin wallets and is used for deterministic generation of the ephemeral key (k) for usage in Elliptic Curve Digital Signature Algorithm (ECDSA) (it has nothing to do with seed). It is to eliminate any possible issues with the RNG by making signatures deterministic while still random.
Thank you. I have amended the topic to reflect the error. Can you help me clarify some of my doubts as stated in the post? I still don't understand how it could be deterministic yet random at the same time. It sounds very much like a paradox.
pooya87
Legendary
*
Offline Offline

Activity: 3444
Merit: 10558



View Profile
December 05, 2020, 01:54:26 PM
 #4

Can you help me clarify some of my doubts as stated in the post?
The idea is that if you already have a random entropy you can derive another random entropy from that original entropy by performing certain cryptography functions on it (basically hashing it). For example SHA256 of 32 byte entropy produces a random but deterministic 32 bytes.

Although the algorithm used in RFC6979 is more complicated than that but the principle is the same. You have you private key (which should be random) and the hash of the message that you want to sign (which is not random) and by performing a series of HMACSHA256 you derive a new key.
Since part of the input to HMACSHA was random (the key) the result can not be guessed ergo is random.

The benefit of this is that the algorithm avoids using any kind of RNG that can be weak and since it is deterministic, the ECDSA itself can be easily tested which makes implementing it so much easier.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
Bronsted (OP)
Newbie
*
Offline Offline

Activity: 11
Merit: 7


View Profile
December 06, 2020, 03:17:44 AM
 #5

The idea is that if you already have a random entropy you can derive another random entropy from that original entropy by performing certain cryptography functions on it (basically hashing it). For example SHA256 of 32 byte entropy produces a random but deterministic 32 bytes.

Although the algorithm used in RFC6979 is more complicated than that but the principle is the same. You have you private key (which should be random) and the hash of the message that you want to sign (which is not random) and by performing a series of HMACSHA256 you derive a new key.
Since part of the input to HMACSHA was random (the key) the result can not be guessed ergo is random.

The benefit of this is that the algorithm avoids using any kind of RNG that can be weak and since it is deterministic, the ECDSA itself can be easily tested which makes implementing it so much easier.
Understood. I will delve deeper into the topic. Thanks for the speedy response.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!