Author

Topic: Point addition / double formulas in Bitcoin (Read 239 times)

member
Activity: 348
Merit: 34
April 22, 2021, 02:35:25 PM
#4
abc
023ef30130654689a64c864d6dd38760481c55fc525e2c6c7084e2d2d3d4d51be9
043ef30130654689a64c864d6dd38760481c55fc525e2c6c7084e2d2d3d4d51be9f7d86b288c09d db5311f292285168000e43e4b62201bd8de23a391daa8e00ce8

def
036a6e1dc6f203f7fdd97965892301e5fb995a37318c410543835f0edcd3456c49
046a6e1dc6f203f7fdd97965892301e5fb995a37318c410543835f0edcd3456c492a072b9898b93 e9eb05f9ad86a97546d83b579bf6efd3482f93baca13784496b

abcdef
0312faae608bd6562562b8f85564664cd1fdcd667f6b24b2b221ef86b9231f4d74
0412faae608bd6562562b8f85564664cd1fdcd667f6b24b2b221ef86b9231f4d74512ee8cd9b343 31afd05ccb8d81d1393c150c73ec5695845b731f7e6e0086719

here abc is 1 point, and 2nd point is def
if we can join or merge like abc add to def
where result would be abcdef point

abc+def = 18AB
one new func could be inside
like abc+def = abcdef
like point +point = pp ( line extended) ( not 2p)

point 1
point 2
a =1+2 = 3
more advance looking func

point 1
point 2
a =1+2 = 12

any one have experiance this calc
newbie
Activity: 9
Merit: 4
February 01, 2018, 11:17:31 AM
#3
If you have some basics in python, you can check the bitcoin library.
It's complete and simpler than the C++ core library.
Check https://github.com/vbuterin/pybitcointools/blob/aeb0a2bbb8bbfe421432d776c649650eaeb882a5/bitcoin/main.py
staff
Activity: 3458
Merit: 6793
Just writing some code
February 01, 2018, 10:44:44 AM
#2
The code that Bitcoin Core uses for ecdsa operations on the secp256k1 curve can be found here: https://github.com/bitcoin-core/secp256k1 (it's its own library). There are comments throughout the code and some additional documentation on the readme that should help you understand what it is actually doing.
newbie
Activity: 1
Merit: 0
February 01, 2018, 10:17:19 AM
#1
I am currently writing my master thesis about elliptic curve cryptography and Bitcoin. For the section about the performance of secp256k1 and possible improvements I wanted to look at how point addition and multiplication has been implemented in Bitcoin.
I am not the best programmer (I am doing my master in mathematics) and so I wanted to know if there is a theoretical explanation, or where I can find the source code of this part of Bitcoin, to try to figure it out with the help of some IT friends.

I found this paper (https://eprint.iacr.org/2016/103.pdf) "Speed Optimizations in Bitcoin Key Recovery Attacks"
where it says in section 4.2.3. Secp256k1 point addition formulas: "Bitcoin developers implemented a mixed coordinate formula (Jacobian-Affine)
version based on >>Weierstraß Elliptic Curves and Side-Channel Attacks<< by Eric Brier and Marc Joye :

https://s17.postimg.org/eotd6k6nz/point_multi_BTC.png

Is this still the version up to date?

In (https://www.microsoft.com/en-us/research/wp-content/uploads/2016/06/complete-2.pdf) "Complete Addition Formulas for Prime Order Elliptic Curves" by Joost Renes, Craig Costello and Lejla Batina it sais that
"compared to the incomplete addition function secp256k1 gej add var used in the Bitcoin
code, our complete addition function in Algorithm 7 saves 4S at the cost of 8a+1mul int5;
compared to Bitcoin's incomplete mixed addition function secp256k1 gej add ge var, our
complete mixed addition saves 3S at the cost of 3M + 2a + 1mul int; and, compared to
Bitcoin's doubling function secp256k1 gej double var, our formulas save 2S + 5mul int at
the cost of 3M+ 3a. In this case it is unclear which set of formulas would perform faster,
but it is likely to be relatively close and to depend on the underlying field arithmetic and/or
target platform. Furthermore, the overall speed is not just dependent on the formulas: the
if statements present in the Bitcoin code also hamper performance. On the contrary, the
complete algorithms in this paper have no if statements."
This paper is from the 28th of April 2016. Which changes of the formulas have been done since then?

I hope someone might take the time to explain the current implementations in Bitcoin, or has another reference of a paper or a forum topic where I can find some answers!
Jump to: