Search content
Sort by

Showing 20 of 80 results by bkelly13
Post
Topic
Board Development & Technical Discussion
Re: modular inverse in bitcoin arithmetic
by
bkelly13
on 19/11/2024, 16:35:38 UTC
Hello vjudeu,
You answered several questions, thank you.
I was not planning on graphing with the GUIs, just displaying a few iterations and some of the intermediate values.  For example, when I set k, which I find to be the private key, to a few low values such as 2 and 4, then walk through to get the public address.
I checked Sage and it looks good.  There are also a few sites that do the specific calculations on line, such as private to public.  I will use them also.

Next step is to install both Ruby and Python and code a few modules in each to see how they feel.  Maybe just code up a GUI and display a few numbers to get that feel.

So, again, thank you,
And thank you to everyone in the thread for your time and patience.

Just an interesting side note:  I read and see for myself how nasty so many interactive forums get, such as X.  Part of it is the anonymous concept.  But in forums like this, everyone is so incredibly helpful and courteous.  That former part of human nature is really disappointing and often discouraging.  But this part of human nature, here, displayed to just small audiences, is quite encouraging.
Thank you again for your kindness.
Post
Topic
Board Development & Technical Discussion
Re: modular inverse in bitcoin arithmetic
by
bkelly13
on 19/11/2024, 02:12:35 UTC
I found Jimmy Song's "programming bitcoin" very interesting !

Received the book and started it.  Thank you.
But, need some advice.  Almost all the web pages I find about bitcoin and the curve have examples in Ruby.  The book uses Python.  In none of the examples online and so far in the book, nothing is said about working with very long numbers.  So I presume that is trivial to both languages.  Is this correct?  I will want to use some simple GUIs to help me understand what I am going.

Should I use Ruby per all the web pages, or Python per the book.  The book is probably more comprehensive than the web page but I don't know.

Post
Topic
Board Development & Technical Discussion
Re: modular inverse in bitcoin arithmetic
by
bkelly13
on 19/11/2024, 02:07:58 UTC
Great advise. I will do that.
Post
Topic
Board Development & Technical Discussion
Re: modular inverse in bitcoin arithmetic
by
bkelly13
on 18/11/2024, 05:20:47 UTC
Re:  I think you are taking things way too literal ....

I think you are right. And easier said than done.  Song's bitcoin book arrived.  Working that and read about mathmatical groups and fields.

Thanks for your time and patience.
Post
Topic
Board Development & Technical Discussion
Merits 1 from 1 user
Re: modular inverse in bitcoin arithmetic
by
bkelly13
on 17/11/2024, 18:41:52 UTC
⭐ Merited by vapourminer (1)
Garlonicon: great reply.  Thank you

To you and kTimesG:

First, kTimesG, thoughtful moniker.

Above all: With Bitcoin, and other such concepts, rules, required, and allowed operations are important.  Following the rules, regardless of origin and their cause, is what makes bitcoin work.

And recognizing my low knowledge of mathematics, I still have questions.

Looking at the equations, they all use addition.  Addition cannot be directly applied to a point on the curve.  The equation of y^2 = x^3 + 7 makes it impossible.  However, addition can be applied to the constituent parts of the points.  In my thoughts, that differentiation between the points and the constituent parts of the points is critical.  I recognize it may be wrong, but it seems correct.  At least right now.

Addition is nothing more than a short cut to counting.  I have learned that 4 + 4 is eight.  But it is a shortcut for counting.  To make my point,  4 plus 1 is 5, plus 1 is 6, etc.

What is subtraction?  Once at 6, I can subtract 2, then again, and get back to 4.  Subtraction is nothing more than discovering what I can add 2 to in order to get 6.  If addition is allowed, then subtraction is definitely valid.

What is multiplication?  It is nothing more than addition repeated a specified number of times.  I can add 2 to itself, then do it again, and again, and get 6.  Multiplication is nothing more than a shortcut for repeated addition. 

What is division.  Divide 6 by 2 to get 3.  It is nothing more than a shortcut to determine how many times to add 2 to itself to get 6.  Same for multiplication.  If we can add, then we can divide.

If we have addition, then it does follow to say that, by the definition of the words and the operations, there is subtraction, multiplication and division.  But to be redundant, they cannot be applied directly to points on the curve, but to their constituent parts to produce the result desired.

Re: There is no concept of "non-integer" in modular arithmetic. Actually, you shouldn't even think at integers, you can think as modular arithmetic as a set of ordered emoji (or fruits) as its elements. Division is not prohibited - it's simply non-existent,

As described above, I have some difficulties with that.  If we can add, then we can subtract.  If we can add more than once, then we can multiply.  If we can subtract and multiply then we can divide.

But, and this is huge, and a bit redundant, if the rules of Bitcoin state that we must replace divide by modular inverse, then we must do that.  Otherwise we will never succeed at the task.

That said, I do recognize that you guys know far more than I.  I took Calculus 1 a second time to get an A.  For Calculus II, that semester it was the only course I took, I studied every night, got nothing less than 95 on all the homework, but never got higher than 80 on the tests.  That gave me the B needed to graduate.  So, I am not good with mathematics, but am relatively good with arithmetic.  Got an A in statistics without much problem.  And all that, because, given their huge and increasing place in world society, I want to have a reasonably good understanding in how Cryptos work

I will dig into the concepts of Group, Field, etc.  I do solicit suggestions of where to look.

Thank you again for your time and patience.
Post
Topic
Board Development & Technical Discussion
Re: modular inverse in bitcoin arithmetic
by
bkelly13
on 17/11/2024, 04:25:24 UTC
Potatotom: Song’s book is on order.  Hopefully that will be a thank you moment.

A follow up question.  The elliptic curve under discussion is defined as:

Y2 = x3 + ax + b  where a = 0 and b = 7 giving us
Y2 = x3 + 7 

To plot the curve we use exponentiation, which is repetitive multiplication.  And multiplication is repetitive addition.

Begin with point G on this curve, called the Generator Point.  If we have a private key of 0X0002, decimal value two, then the public address is the same as G added to itself, or G multiplied by 2.

I recognize that if we look at the curve, maybe graphed to show the two points, we cannot simply multiply point G by 2 to get the public address.  Or simply add G to G itself.  Those operations are not valid and don’t make sense. 

We must apply the arithmetic in accordance with the rules of the curve. 

But, we do have rules by which we can double G and/or add G to itself.  One set of rules has an equation that is used to calculate temporary variable used to determine the x and y values of the new point.  That one is:

s = ( 3 * (p1x) ** 2 + a ) / ( 2 * ( p1y ) )

This equation is about 2/3rds down the web page referenced above, under the header Double.  The equation uses color which will not work well here so I use p1x and p1y to refer to the x and y values of the first point.

The first question is trivial:  What does the a represent?  Is this the “a” from the equation where a = 0 and b = 7.  It may be a constant in the code but this is not apparent from the snipped provided.  In that case, it is interesting that “b” does not make an appearance in the doubling equations.

The second is a bit more involved.  Within the equation, we are using addition, multiplication, and exponentiation.  Not to the point itself, but to the constituent parts of the point, in accordance with the rules of the elliptic curve.   

To support this, mostly to verify or show wrong my claims, please visit to that web page, open the code section under “Double” and see that these regular arithmetic operations are utilized.

Why is division to the constituent parts of the point prohibited?
Post
Topic
Board Development & Technical Discussion
Re: modular inverse in bitcoin arithmetic
by
bkelly13
on 16/11/2024, 14:48:26 UTC
Short answer: that was quite unexpected.
Long answer:  Need more time to make a reasonable reply, much less comprehensive.

Thank you very much for your time and patience.
Post
Topic
Board Development & Technical Discussion
Topic OP
modular inverse in bitcoin arithmetic
by
bkelly13
on 16/11/2024, 06:09:44 UTC
Post on bitcointalk in technical discussion
I am trying to understand the bitcoin arithmetic, as opposed to the mathematics. A couple of websites mention that dividing with the elliptic curve points is impractical so they multiple by the inverse.  Just in case it matters my primary reference is this site:   
https://learnmeabitcoin.com/technical/cryptography/elliptic-curve/
Trying to stay with the basics, multiply a by the inverse of b is the same as dividing by b.  But arithmetically the inverse of a is found by dividing a into 1.  The result is between 0 and 1.  But to my limited knowledge, elliptic curves are integer arithmetic.
The declaration of the Ruby function is
def inverse( a, m = $p)
I don’t know Ruby. 
It looks like a is a single variable, and so is m, the modulus value, presumably “the” modulus used in the Bitcoin elliptic curve.  Both are integers, not points. 
So what really huge concept am I missing?
Post
Topic
Board Bitcoin Discussion
Re: US presidential candidate Donald Trump will speak at the 2024 Bitcoin Conference
by
bkelly13
on 19/07/2024, 22:45:31 UTC
It's getting interesting. I hope Mr Trump wins. He's smarter than Mr Biden. Not just because of crypto

https://x.com/BitcoinMagazine/status/1811181306438660375

https://ibb.co/y0ngGjW

Does is not bother you that he is:
a pathological liar.
a narcissist.
full of hate.
fundamentally dishonest.

And yes, each of those is not just provable, but proven.
Post
Topic
Board Bitcoin Technical Support
Re: step-by-step process for BTC transaction
by
bkelly13
on 18/07/2024, 20:42:56 UTC
It's not easy to understand and digest the stuff under https://learnmeabitcoin.com/technical/cryptography/elliptic-curve/ and maybe it's also beneficial to read about elliptic curve "magic" in other sources like Mastering Bitcoin or even completely different ones before the stones fall into their places.

Don't expect to understand it within minutes, hours or days unless you're a "Wunderkind" or math prodigy.

Agreed.  If I keep at it, some number of months.  Thank you for the link and for your reply.
Post
Topic
Board Bitcoin Technical Support
Re: step-by-step process for BTC transaction
by
bkelly13
on 18/07/2024, 20:35:39 UTC
The site does not make a clear declaration but my understanding is that this is named point P.  The core of all bitcoin calculations.  Is this correct?

...
For example,
If the private key (represented in base 10) is: 7
Then the step to generate the public key is: G + G + G + G + G + G + G

This looks like a pretty good explanation about how elliptic curve point addition is done with finite fields:
https://www.rareskills.io/post/elliptic-curves-finite-fields

Wonderful, the comment about adding in G (effectively multiplying) is something I really needed to see.  It has been worded in different ways and I was suspecting that is the situation.  Now I am reasonably confident.

As I add in G multiple times, the results will become larger than 256 bits and will require a modulo operation to reduce its size.  I forget the name of that constant, p I believe. The calculations will require thousands of additions, arithmetically changed into multiplications, and the numbers will exceed 256 bits.

What is the threshold to apply the modulus operation?

From memory at the moment, the site that mentioned the modulus operations showed the equation with the mod operation on both sides of the = character.  Is each side done independently, or both at the same time.

That leads to the question:  Will there ever be a time to truncate or round off numbers?  Will that be a truncate or round off operation?

Now to visit the mentioned site.
Thank you for taking the time to reply.
Post
Topic
Board Bitcoin Technical Support
Re: step-by-step process for BTC transaction
by
bkelly13
on 18/07/2024, 15:10:56 UTC
Let's start with this one:

1. Create 256-bit random number.  Yeah, a bit difficult to do properly.

This is actually quite easy to do, you just have to use the correct APIs.


Hello NotATether,
Thanks for the reply.  I understand, the random number is not a big problem.
The bit problems is the exact arithmetic steps of the various procedures.

For one example.  Presume my code does multiplies and divides to 512 bit precision.  Then look at the last three bits of the most significant 256 bits and find 111.  Then look at the next three bits of the lower group and find 111. 

Should the code truncate or round up?

One bit difference is the difference between success or failure. 

Thank you for your time.
Post
Topic
Board Bitcoin Technical Support
Re: step-by-step process for BTC transaction
by
bkelly13
on 18/07/2024, 05:19:29 UTC
Why don't you use well known and reputable ressources to learn step-by-step the basics of Bitcoin transactions?

I'd rather go to https://learnmeabitcoin.com (in the technical section it get's quite detailed and deep down the rabbit hole) or quite a bit dryer Mastering Bitcoin 3rd Edition. Sorry, I didn't bother to hop to your source link and read what's presented there. Could be good, could be bad, no judgment.


Cricktor, Thanks for the link.  From the main page I took the link named Technical.  In the next page are links named Private Key and Public Key.  The link Public Key provides a tool to make the translation on-line, but I could not recognize the specific steps to translate my private key number into a public key.

I tried this site also:  https://learnmeabitcoin.com/technical/cryptography/elliptic-curve/#mathematics
It provides values:

a = 0, b = 7 meaning the curve equation is y^2 = x^3 + 7

It describes p as being:  $p = 2 ** 256 - 2 ** 32 - 2 ** 9 - 2 ** 8 - 2 ** 7 - 2 ** 6 - 2 ** 4 - 1

Which I worked out to the hex number and which does not agree with another site that I cannot find again right now.  For now presume this one is correct.

So generate my random number to become my private key.

Then generate a public address.  Here is where several sites provide an online tool to enter a test private key and give you the public key.  But none of the sites I have found spell out the arithmetic steps to do this?  By arithmetic steps I ask for the addition, subtraction, multiply, and divide steps.  And even taking a square or cube root of a number.

I presume that my random number is the x part of an x,y point on the curve equation y2 = x3 + 7.

Then I must calculate y, the square root of x3 + 7.  And must do this with 256 bit arithmetic.  Actually, I suspect that 512 bits must be used for accuracy.  And then I must use modulo p to keep the numbers within the 256 bit range.

If correct, then what?

So, please, where can I find the arithmetic steps to transform a private key into a public address?
Post
Topic
Board Bitcoin Technical Support
Re: step-by-step process for BTC transaction
by
bkelly13
on 15/07/2024, 03:30:06 UTC
<snip>
Since it isn't really any more difficult for a computer to convert binary data to base58 than it is to convert that binary data to hex, why not?

Oh its a lot more difficult.  Converting binary to hex is a single pass process that just replaces each 4 bits with one character.  When creating the base 58 code, you must divide that 256 number by 58 once for each character in the result.  And since there are no 256 bit ALUs, it must be synthesized with multiple divides tracking the multiple quotients and remainders.  And the radix of 58 is prime with respect to radix 2.  A one bit change can change the entire base 58 encoding.

But, it really doesn't matter because it will not be changed.

However, I am still working on how bitcoin transactions work.  Got to this site:
https://hackernoon.com/what-is-the-math-behind-elliptic-curve-cryptography-f61b25253da3

Its pretty good.  I get to the point where it states:  The base point used by secp256k1 curve has the following x- and y- coordinates: ….

The site does not make a clear declaration but my understanding is that this is named point P.  The core of all bitcoin calculations.  Is this correct? 

Is this the point on the curve from which all operations begin?  Over simplifying a bit and in my words: Begin with P.  For each 1 bit in the private address, add in the coordinates of P, according to the bit position of each one.

Further down the site mentions using the modulus function and names that value p.  It names the modulus divisor as the largest prime smaller than 2^256 but does not provide a value. 

A search revealed two sites, one of which is:  https://t5k.org/lists/2small/200bit.html
From there is this row:

256   189, 357, 435, 587, 617, 923, 1053, 1299, 1539, 1883

But please notice that the formatting is quite unusual.  Six groups of three, then four groups of four.  Is this the correct value for p? 

Do you have a favorite place to look this up?

Thanks again for your time and patience.
Post
Topic
Board Bitcoin Technical Support
Re: When is a BTC address actually created?
by
bkelly13
on 26/04/2024, 04:16:37 UTC
...
So, to try and answer your question:
  • A bitcoin address is just a number, so any given address has always "existed" for as long as numbers have existed.
...
[/list]


I think I understand the answers, but also suspect the question is not being asked correctly.
I am thinking quite a bit different.  Presume someone creates a new private key and a new public address.  If, before doing anything else, search all the nodes and all the existing blocks and that public address will not be found.  My perspective is that it does not really exist in the BTC world.  Just because something is possible, does not mean it exists.

I currently presume that when someone initiates a transfer that results in coins being deposited in address X, this is when address X is first instantiated, when it first becomes part of the BTC world.  It is when the BTW world first becomes aware of that specific address.

Is this a valid statement?
Post
Topic
Board Bitcoin Technical Support
Merits 1 from 1 user
Topic OP
When is a BTC address actually created?
by
bkelly13
on 23/04/2024, 03:16:32 UTC
⭐ Merited by ABCbits (1)
Presume I create a new key, then calculate a public address from that key.  So far, it is just on my computer and is not what I would call a real address.  If I then send some coins to that address, does that automatically create the address in the real bitcoin world?  Maybe I go to Gemini and enter that public address as the receiving address and move some coins.  Does that result in the new address being created?  Are there other methods worth mentioning?

I suspect, that new addresses are created, in the real BTC world, when some amount of coin is sent to the address.  Is there more to it than this?

Post
Topic
Board Bitcoin Technical Support
Re: step-by-step process for BTC transaction
by
bkelly13
on 22/04/2024, 17:03:32 UTC
ABCbits: Thank you for the links, looking at them.

DannyHamilton: Yes, the deep end.  I have a bit of dyslexia and knew that the correct phrase is private key, just wrote it wrong.  I am not a mathematician, or even very good with math.  I just want to develop my own sense of confidence in this entity into which we place so much trust. 

I have a small amount of bitcoins in a commercial exchange and will probably put them in an offline wallet.  Someday soon.

I continue to be a bit surprised at how volatile BTC is, and most cryptos.  Similar to the stock markets of the world, but much more volatile.  Seems to me it should be more stable.  I really do like the concept of a currency that is independent of government control.  That is its main attraction for me.
Post
Topic
Board Bitcoin Technical Support
Merits 1 from 1 user
Topic OP
step-by-step process for BTC transaction
by
bkelly13
on 22/04/2024, 05:11:34 UTC
⭐ Merited by ABCbits (1)
I cannot find a simple step-by-step process to understand how to go from a BTC private address, in the form of a 256-bit binary number, to initiating an actual transaction.  A description or link to a good web page will be greatly appreciated.

Here is what I suspect happens.

1. Create 256-bit random number.  Yeah, a bit difficult to do properly.
2. translate to base 58 format.
   2.a. takes multiple steps, what are they?
3. Create seed phrases, how to do this?
4. There is more stuff needed to actually initiate a BTC transaction I don't understand, but keep this short and stop here.

This is probably already on this forum.  Do you have a search phrase that will discover it? Link to a specific thread?

Thank you for your time.
Post
Topic
Board Bitcoin Discussion
Re: Should I, we, run a bitcoin node?
by
bkelly13
on 01/11/2023, 01:55:01 UTC
There's some money involved if you run a lightning node, but this requires owning bitcoin, so I doubt that's what OP is asking about and what he's able to do at the moment.

How much BTC is needed to run a lightning node?  Is that BTC tied up with the node?  Is it put at a risk?

And on that risk note, answers in this thread indicate that my transactions are more secure if I have my own full node.  Looking in the other direction, my transactions are at more risk when I do not have my own node.  Just how much more risk is there?

If I am running a wallet such as Trezor, and I send or receive some BTC, how much risk am I exposed to?

I suspect that if I am using Coinbase, and put in a buy or sell for BTC, the only risk is that the dollar cost of BTC changes while the transaction is being consummated.  Is there another risk I am not aware of?

Post
Topic
Board Bitcoin Discussion
Re: Should I, we, run a bitcoin node?
by
bkelly13
on 31/10/2023, 21:19:04 UTC
Presume we are running a full node under some version of Linux. Let's say 2 to 3 Ghz clock rate, 16 Gig of memory, and nothing running but the Bitcoin full node software.  About how much will the CPU be utilized?  Will it be fairly steady?  Or I suspect with significant peaks for each block that is validated and stored? 

I mostly use Windows, but, am quite certain that Linux is much better at this task.

If you are running a full node, please advise as to some of your system specifications.

After the full blockchain has been gathered and stored, what is the average and peak network bandwidth?

Thank you for your time and patience.