DEV Community

Cover image for February 17th, 2022: What did you learn this week?

February 17th, 2022: What did you learn this week?

Nick Taylor on February 18, 2022

It's that time of the week again. So wonderful devs, what did you learn this week? It could be programming tips, career advice etc. ![Yoda woopi...
Collapse
 
aruna profile image
aruna-x

I learned that git switch is useful for moving changes over to a new branch if you forget to checkout before working 🙃 Stuff happens 🤷‍♀️

In the process of getting feedback about my recently engineered portfolio site, I also learned to better value my talents as a dev, instead of being so modest I “undersell” myself. I have no interest in overselling either - but self confidence is somewhere in the middle, and I’m learning to be there more often. Getting ample feedback about my projects from my dev friends helps that along :)

Collapse
 
nickytonline profile image
Nick Taylor

Awesome!

Hackerman from Kung Fury putting on a Nintendo Power glove

Collapse
 
kayis profile image
K • Edited

I'm currently creating a Web3 course and so I read about elliptic curve cryptography. I wanted to understand what the keys in Ethereum actually are.

ECC is based on elliptic curves; basically, math functions on a 2D space (x/y).

ECC on Ethereum uses a particular standard curve, called secp256k1.

This curve is defined by the equation y²=x³+7 mod p or y=sqrt(x³+7) mod p

The curve doesn't use the real numbers, but a fixed set of numbers called a finite field.

A fixed set of numbers, in this case, means there are 115792089237316195423570985008687907853269984665640564039457584007908834671663 numbers in the field that secp256k1 is defined for. This number is the p from the equation above, a large prime number. Crazy big, but still smaller than all real numbers, lol.

The idea here is if you calculate something and it gets greater than p, you get an overflow and go on from 0.

The private key is just a random integer between 0 and p.

This integer defines how often a base point g on that curve has to be added to itself to get the public key. The base point g is also predefined by secp256k1, and since it's a point on that curve, it's an x and y coordinate on the curve, and basically two big integers.

So, if the private key was 5, the public key would be the result of g+g+g+g+g.

The + isn't a common addition but a more complex operation that uses two points (in this case, both g) to calculate a new point on the curve.

So, the public key would be a point, or an x and y coordinate on that y²=x³+7 mod p curve. Both x and y will be integers smaller than p because of overflow etc.

So to sum all up.

The private key is a random 256bit integer smaller than that big prime I mentioned.

The public key is two integers, essentially x and y coordinates, defining a point on the secp256k1 curve. You get this point by executing a special kind of addition on a predefined base point "private key times".

Collapse
 
nickytonline profile image
Nick Taylor

That's awesome! 🔥

Yes, that's awesome!

Collapse
 
mrsharm profile image
Mukund Raghav Sharma (Moko)
  • Started a course my Mitch Horowitz.
  • Got a job offer to work with one of my Heroes in the Garbage Collection space. Going nuts about it but have set myself on a journey to master everything about the CLR.
  • More Virtual Memory work via this
  • Learnt that you can embed a style inside any tag such as: <p> <style "background-color:red"> hi </style></p>`.
  • Read more from Company of One been so behind on my reading because I have been incredibly busy with interview stuff.
Collapse
 
nickytonline profile image
Nick Taylor

Nice!

A kangaroo playing an electric guitar

Collapse
 
dbc2201 profile image
dbc2201

I started learning JavaFX again, left it some years ago because my job didn't allow much time for it. The new thing I learned about it is there isn't enough documentation or resources to properly get started, it feels staggered. Compared to the UI libraries of C#, Microsoft did a very good job to make it feel more cohesive with the .net platform for developers, wish Oracle could do the same.

Collapse
 
nickytonline profile image
Nick Taylor

Borat saying Great Success!

Collapse
 
snikhill profile image
Nikkhiel Seath

I learnt that I need to conserve my keystrokes and use writing as a medium to convey my point to a larger audience.
Based on this advice, I wrote documents for a service that I am implementing at work.

Along with this, I am adding a blog functionality to my website (using DatoCMS) and shall be sharing/learning in public using my writing. (I shall keep you updated on this).

I am continuing my financial education using books and have finally sought a financial adviser to better guide me through my journey.

May I please know what you learnt @nickytonline ?

Collapse
 
nickytonline profile image
Nick Taylor • Edited

Jean-Luc Picard from Star Trek TNG saying Well done!

What I learnt this past week was that there are now Netlify scheduled functions.

Collapse
 
meatboy profile image
Meat Boy

Recipe for carrot muffins. Seriously, my biggest discovery of the week :D

Collapse
 
nickytonline profile image
Nick Taylor

Nice!

Nice

Collapse
 
nkemdev profile image
Nkem

I am currently learning Javascript with Scrimba. Learning by building apps.

Collapse
 
nickytonline profile image
Nick Taylor

Pam from The Office saying Nice!

Collapse
 
cerchie profile image
Lucia Cerchie

I learned how to get started with a MongoDB database

Collapse
 
nickytonline profile image
Nick Taylor

Let's go!

A kid twirling in a cowboy outfit firing pistols that are their fingers

Collapse
 
waylonwalker profile image
Waylon Walker

visidata is such a good tui for almost all things json, including aws eventbridge rules comfing from the cli.

waylonwalker.com/til/aws-eventbrid...

Collapse
 
nickytonline profile image
Nick Taylor

BB-8 giving a thumbs up

Collapse
 
deathvenom54 profile image
Deathvenom

Completed my project github.com/DeathVenom54/github-dep...
Proud of it, and explaining article coming soon :D

Collapse
 
nickytonline profile image
Nick Taylor

Noice!

Noice!

Collapse
 
ryannerd profile image
Ryan Jentzsch

This is embarrassing but I'll share anyway. I've been developing software for over 25 years. I spent 3 hours today trying to figure out why in my react app that I assigning the variable document to a File object and document kept showing as undefined. Well, friends document is a reserved word in JS (at least that's how Babel seems to be treating it under the hood). But instead of throwing errors that I did something stupid it failed silently and just assigned undefined. Very frustrating.