Live data from Hacker News

A from-scratch tour of Bitcoin in Python

karpathy.github.io

41–50 of 293 posts

Re: A from-scratch tour of Bitcoin in Python

#41
post #35

Earlier quoted context omitted.

Just don't re-use addresses. Bitcoin does not expose your public key until you spend from it.

> Bitcoin does not expose your public key until you spend from it. Are you sure, what about when someone sends to it?

Sending to an address means sending it to a "hash" of a public key (or a more complex script) on all modern formats. Then such script and data is revealed on spend.

Re: A from-scratch tour of Bitcoin in Python

#42
post #25

Earlier quoted context omitted.

There's a lot of research and practical work on quantum-proof cryptography which is already in use in some cryptocurrencies - 'just' need to hardfork and update it when it's ready for Bitcoin

What cryptocurrencies are currently using post-quantum cryptography?

Only one I'm aware of is QRL ("quantum-resistant ledger").

https://www.theqrl.org/

Re: A from-scratch tour of Bitcoin in Python

#43

Earlier quoted context omitted.

https://twitter.com/karpathy/status/1407378320551923718 :) But more seriously, I just really love learning and worked on this on the side, in small increments in between the cracks, and purely from interest for fun.

How many hours a day do you work? And what does your daily schedule look like?

[deleted]

Re: A from-scratch tour of Bitcoin in Python

#44
post #6

I wonder how strong would Elliptic Curve Cryptography be compared to other methods if there is a major breakthrough in quantum computing.

I wish this were talked about more. Quantum computing is the biggest long-term threat to crypto imo. What's the plan once elliptic curve cryptography can be broken? There will be a point in time where there are just a few quantum computers that can break everything before the general public has access to quantum computing. Can crypto work in that scenario? Normal computers wouldn't be able to work with the beastly al…

The first entities that are likely to achieve practical quantum computers will either be governments or big tech companies like Google. And it will be a big deal, so there would likely be several years of warning before it could be at the point where it would make sense to use it to steal someone's bitcoins (I guess the original Satoshi coin address would be the biggest bounty). And in the time period between when the big development is first announced and before it's practical, Bitcoin and other cryptocurrency projects can do a fork to a new digital signature scheme that is quantum proof (such as LegRoast) so that anyone who is concerned can move their coins to a new secure address. So while it would certainly be disruptive, it wouldn't necessarily spell the doom of Bitcoin.

Re: A from-scratch tour of Bitcoin in Python

#45
post #24

I'm amazed that he has time for this kind of hobby work.

For others: Andrej Karpathy is the director of artificial intelligence and Autopilot Vision at Tesla.

Was on front page yesterday for a presentation on Tesla's Autopilot / Autonomous features: https://www.youtube.com/watch?v=NSDTZQdo6H8

Re: A from-scratch tour of Bitcoin in Python

#47
post #11

Earlier quoted context omitted.

Shor's algorithm, which runs partially on a classical computer and a portion on a quantum computer, breaks elliptic-curve cryptography.

Yes, with major caveats - knowing the public key and having 100s of messages signed by corresponding private key. Nowadays people only expose their public key one time per transaction, and never reuse their address. So to steal coins, not only do you have only ~10 mins between blocks to find the private key, currently Shor's algorithm is unfeasible with only 1 signed message.

Not only do many people still reuse keys, but there is also still a huge amount of bitcoin in P2PK outputs, i.e. with exposed public keys.

Re: A from-scratch tour of Bitcoin in Python

#48
post #2

> We don’t just get to share code, we get to share a running computer, and anyone anywhere can use it in an open and permissionless manner Can someone explain what this means? Its not explained anywhere in the post.

Bitcoin transactions, or more precisely transaction outputs, are little scripts that are executed in a VM. To spend a transaction output, you have to "solve it" by providing it an input which makes it return true. The most common transaction script checks that you possess a private key through a signature check, but it's possible to make more complex scripts like the "Pay To Multisig" script. Of course, Bitcoin scripts are quite limited and, unlike Ethereum smart contracts, they are non-Turing-complete and can't store state.

Permissionless just means anyone can create transactions because there's essentially no way to block someone from doing so, unlike say a transaction on PayPal.

Post reply on HN