Live data from Hacker News

A from-scratch tour of Bitcoin in Python

karpathy.github.io

271–280 of 293 posts

Re: A from-scratch tour of Bitcoin in Python

#271

Earlier quoted context omitted.

A bank account balance is representative value of dollars that bank owes you. If someone tries to steal it by pretending to be you even if they just steal your PIN, they are committing fraud. If someone steals a private key by committing another crime like stealing a laptop, that is a crime because you own the laptop. If they learn of your private key without committing a crime, that is not theft. You don't own 'spac…

The bank PIN is just a number. Your bank account balance is just a number in a database. Your private key is just a number. Your bitcoin balance is just a number in a database (a blockchain is a kind of database). There is no distinction that makes stealing dollars using a bank PIN fraud but stealing bitcoin using a private key not fraud somehow.

Bank deposits are securities. You have a claim on your bank when you make a deposit. If you think there is no difference between a bank account and a bitcoin private public key pair then bitcoin is a security. You are making the argument bitcoin is a security. Who is the issuer? I would say the miners are selling securities and you give them money (like a deposit) in exchange for the miners continuing to mine in the future, so when you decide to spend your bitcoin, bitcoin will still be running. If bitcoin is a security issued by the miners then yes bitcoin becomes more than just a number.

Re: A from-scratch tour of Bitcoin in Python

#272
post #62

If you, like me, were curious about what the secret key 1 is on the mainnet, then here you are: 1 1BgGZ9tcN4rm9KBzDn7KprQz87SZ26SAMH https://www.blockchain.com/btc/address/1BgGZ9tcN4rm9KBzDn7KprQz87SZ26SAMH Some others: 2 1cMh228HTCiwS8ZsaakH8A8wze1JR5ZsP https://www.blockchain.com/btc/address/1cMh228HTCiwS8ZsaakH8A8wze1JR5ZsP 3 1CUNEBjYrCn2y1SdiUMohaKUi4wpP326Lb https://www.blockchain.com/btc/address/1CUNEBjYrCn2y1S…

If you are really curious, all the secrets are out there.

https://keys.lol/bitcoin/22486853933768128433444208678976948...

Finding one with a balance is the hard part.

Re: A from-scratch tour of Bitcoin in Python

#273
post #208

This is reminds me of Ken Shirriff's 2014 "Bitcoins the Hard Way" blog post that also used Python to build a Bitcoin transaction from scratch: http://www.righto.com/2014/02/bitcoins-hard-way-using-raw-bi... (The subtitle of the blog is "Computer history, restoring vintage computers, IC reverse engineering, and whatever" and it is full of fascinating articles, several of which have been featured here on HN)

Thanks for the nice mention of my blog. I was wondering if anyone remembered my old bitcoin article :-)

I go back to it twice yearly

Re: A from-scratch tour of Bitcoin in Python

#274

Earlier quoted context omitted.

The bank PIN is just a number. Your bank account balance is just a number in a database. Your private key is just a number. Your bitcoin balance is just a number in a database (a blockchain is a kind of database). There is no distinction that makes stealing dollars using a bank PIN fraud but stealing bitcoin using a private key not fraud somehow.

Bank deposits are securities. You have a claim on your bank when you make a deposit. If you think there is no difference between a bank account and a bitcoin private public key pair then bitcoin is a security. You are making the argument bitcoin is a security. Who is the issuer? I would say the miners are selling securities and you give them money (like a deposit) in exchange for the miners continuing to mine in the…

If bank deposits were securities governed by securities law then they would be regulated by the SEC. They are not.

It doesn't matter anyway because Bitcoin is not a bank deposit, nor is it a security. Under the law it is generally treated as property. It's still a crime to steal property.

My point is that the fact that it's all numbers in a computer does not make it somehow legal to steal it. What you own is not the abstract number of your private key, but the concrete database entries in a specific blockchain database.

While not relevant, it's also not even true in a pedantic sense that you "can't legally own a number". All digital files are simply long numbers, and copyright assigns ownership of those numbers to people. Also, the DeCSS case established de facto ownership of a private key, making it illegal to copy, so yes you can actually have a kind of ownership even of just a private key under the law. Again, not relevant or necessary for Bitcoin, but interesting.

Re: A from-scratch tour of Bitcoin in Python

#275

  # secret_key = random.randrange(1, bitcoin_gen.n) # this is how you _would_ do it
I know the article is mainly for learning purposes but someone should point out that the `random` module in python is not meant for cryptography. Please use the built-in `secrets` module or `os.urandom` instead.

Re: A from-scratch tour of Bitcoin in Python

#276

Earlier quoted context omitted.

There has been great progress in scaling the original protocol through the Bitcoin SV implementation: - Transaction fees are ~$0.0001 - The network has shown capacity for 50k tps - On March 14, 2021, the network processed a world record 638 MB block - As of June 4, 2021 the chain size exceeded that of the BTC implementation and is currently 418.17 GB - New business based on micropayments have emerged like twetch, str…

There has been great progress in scaling on just about every other cryptocurrency, including many flavours of bitcoin. BTC is the only coin who finds scaling too difficult.

It does not scale, at the expense of centralization.

A centralized cryptocoin is just MySql with extra steps.

Re: A from-scratch tour of Bitcoin in Python

#277

Earlier quoted context omitted.

Bank deposits are securities. You have a claim on your bank when you make a deposit. If you think there is no difference between a bank account and a bitcoin private public key pair then bitcoin is a security. You are making the argument bitcoin is a security. Who is the issuer? I would say the miners are selling securities and you give them money (like a deposit) in exchange for the miners continuing to mine in the…

If bank deposits were securities governed by securities law then they would be regulated by the SEC. They are not. It doesn't matter anyway because Bitcoin is not a bank deposit, nor is it a security. Under the law it is generally treated as property. It's still a crime to steal property. My point is that the fact that it's all numbers in a computer does not make it somehow legal to steal it. What you own is not the…

You are incorrect. Deposits in banks are securities, I suggest you read this section titled "Every security that is issued must be held by someone until it is retired" here: https://www.hussmanfunds.com/comment/mc210614/

Copyright doesn't cover the computer reference machine code number, it covers actual intellectual content.

Just like it is not settled whether Ethereum or Bitcoin is a security- thoughts on this can and will change, new regulators get elected... neither is settled whether you can actually say that you own a number.

The community has misplaced confidence imo.

Re: A from-scratch tour of Bitcoin in Python

#278

Earlier quoted context omitted.

If bank deposits were securities governed by securities law then they would be regulated by the SEC. They are not. It doesn't matter anyway because Bitcoin is not a bank deposit, nor is it a security. Under the law it is generally treated as property. It's still a crime to steal property. My point is that the fact that it's all numbers in a computer does not make it somehow legal to steal it. What you own is not the…

You are incorrect. Deposits in banks are securities, I suggest you read this section titled "Every security that is issued must be held by someone until it is retired" here: https://www.hussmanfunds.com/comment/mc210614/ Copyright doesn't cover the computer reference machine code number, it covers actual intellectual content. Just like it is not settled whether Ethereum or Bitcoin is a security- thoughts on this can…

We're talking about the law, not some guy's blog. If you believe that bank accounts and Bitcoin are securities under the law, then you are incorrect. It doesn't matter whether some guy calls bank accounts securities on his blog. That doesn't change the law.

Saying the law could change is literally always true, it means nothing. Will it change? You could make an argument for Ethereum, and I tend to agree that the community is overconfident about the regulations around Ethereum and other coins. However for Bitcoin specifically the SEC has been very clear and consistent in stating that it is not and has never been a security. Their justifications are sound. So no, it almost certainly won't change for Bitcoin.

Copyright covers the specific number in addition to the general intellectual content of the number. You could say it covers a family of related numbers. That's stronger than just covering a single number.

Re: A from-scratch tour of Bitcoin in Python

#279
post #244

Earlier quoted context omitted.

There was never any need to scale it at the protocol level. The overwhelming majority of Bitcoin transfers presently happen off-chain, within exchanges. Very few people seem to understand this.

I don't understand. How do Bitcoin transfers happen off-chain? Are those Bitcoin transactions that don't actually use the blockchain?

The exchange itself holds a fluctuating amount of Bitcoin and then updates entries in its own database when transfers occur between exchange participants to reflect a change in ownership. These constitute the vast majority of transactions that occur and none of them are recorded to the blockchain.

Re: A from-scratch tour of Bitcoin in Python

#280
post #160

"NIST publishes recommendations on which ones to use, but people prefer to use other curves (like secp256k1) that are less likely to have backdoors built into them" Does this make any sense? How is a curve going to have backdoors on it? Or he means a specific implementation? Or is this a joke? I'm confused

Here's a computerphile video that explains it very simply: https://youtu.be/nybVFJVXbww

> But then the Snowden leaks came along, and it looks even more suspicious.

> Money was changing hands between the NSA and companies, to have them install this as their standard for number generation. That's deeply suspicious.

(-from the video)

That's one piece of information I didn't know, and doesn't usually get mentioned in the discussions I've seen about this.

Post reply on HN