Live data from Hacker News

Tinychain: a pocket-sized implementation of Bitcoin

github.com

21–30 of 45 posts

Re: Tinychain: a pocket-sized implementation of Bitcoin

#21
I would love to see this for Ethereum. I was able to understand the Bitcoin protocol fairly quickly with a little reading, but I haven't come across much good writing on the mechanics of the Ethereum protocol. All of the intro texts I've seen are about like "Step 1: install the client" kind of stuff.

I'm not interested so much in how to write smart contracts, so much as how the miners work, how conflicts are resolved, and how the incentive schemes play out.

Would love to get some reading suggestions!

Re: Tinychain: a pocket-sized implementation of Bitcoin

#22

I would love to see this for Ethereum. I was able to understand the Bitcoin protocol fairly quickly with a little reading, but I haven't come across much good writing on the mechanics of the Ethereum protocol. All of the intro texts I've seen are about like "Step 1: install the client" kind of stuff. I'm not interested so much in how to write smart contracts, so much as how the miners work, how conflicts are resolved…

I agree, Ethereum needs better reading material. I bought an Ethereum book by Henning Diedrich and it's pretty light to be honest.

Re: Tinychain: a pocket-sized implementation of Bitcoin

#23
post #4

I'm working on my own blockchain (not specifically bitcoin) implementation just to wrap my head around everything. One thing I'm not getting that also wasn't answered by the source code is how you check timestamps. I understand the whole network time = median offset + local time thing, however I'm a bit fuzzy on how you check timestamps on previous blocks when you're initially downloading the chain. How do you know t…

In my toy blockchain implementation, I just went with two constraints: 1) every timestamp must be strictly larger than the one of the previous block (this makes difficulty calculation easier) 2) timestamps may not be in the future (except for a little wiggle room for unsynchronized clocks) My reasoning was roughly as follows: Miners are incentivized to pick very large timestamps, because the longer it takes to mine X…

Your method is easily exploited by a malicious miner. Clocks across the network are going to have some inherent amount of skew. By forcing blocks to have incrementing timestamps and also by refusing to accept blocks in the future, you have made it easy for me as a miner to commit abuse. Instead of picking the exact current time, I will pick a time that is as far in the future as the network allows (taking full advantage of the wiggle room).

Because other miners are required to use a higher timestamp for their block to be valid, they have no ability to correct my outlier time. You have essentially allowed me to put the blocktime permanently forward by the allotted wiggle room, and also you have allowed me to consume all that space you allocated for miners who have clock skew.

It's overall a small attack, but highlights that even tiny decisions can have consequences that impact security. Bitcoin accounts for this by requiring that timestamps be greater than the median of the past 11 blocks, and that's enough to prevent one evil miner from forcing the block times forward for all blocks.

Re: Tinychain: a pocket-sized implementation of Bitcoin

#24
post #4

I'm working on my own blockchain (not specifically bitcoin) implementation just to wrap my head around everything. One thing I'm not getting that also wasn't answered by the source code is how you check timestamps. I understand the whole network time = median offset + local time thing, however I'm a bit fuzzy on how you check timestamps on previous blocks when you're initially downloading the chain. How do you know t…

You need to check two things. First you need to check that this block had a timestamp higher than the median of the past 11 blocks (it's a consensus rule). Second you need to check that the timestamp is not unacceptably far in the future. For historic blocks, it definitely won't be because the timestamp will be far in the past (as the block was created far in the past).

Latest block or not, it just needs to follow those rules. That does mean it's possible for a block with an invalid timestamp to become valid after some time has passed. But if it is invalid, nobody will be mining on it, so it's unlikely to remain part of the longest chain.

Re: Tinychain: a pocket-sized implementation of Bitcoin

#25

I would love to see this for Ethereum. I was able to understand the Bitcoin protocol fairly quickly with a little reading, but I haven't come across much good writing on the mechanics of the Ethereum protocol. All of the intro texts I've seen are about like "Step 1: install the client" kind of stuff. I'm not interested so much in how to write smart contracts, so much as how the miners work, how conflicts are resolved…

Not sure if this will help you: https://medium.com/@shiyan/ethereum-summary-a53c4a8e66d?sour...

Re: Tinychain: a pocket-sized implementation of Bitcoin

#27
post #24
post #4

I'm working on my own blockchain (not specifically bitcoin) implementation just to wrap my head around everything. One thing I'm not getting that also wasn't answered by the source code is how you check timestamps. I understand the whole network time = median offset + local time thing, however I'm a bit fuzzy on how you check timestamps on previous blocks when you're initially downloading the chain. How do you know t…

You need to check two things. First you need to check that this block had a timestamp higher than the median of the past 11 blocks (it's a consensus rule). Second you need to check that the timestamp is not unacceptably far in the future. For historic blocks, it definitely won't be because the timestamp will be far in the past (as the block was created far in the past). Latest block or not, it just needs to follow th…

The median thing makes sense, thanks!

Re: Tinychain: a pocket-sized implementation of Bitcoin

#28

I would love to see this for Ethereum. I was able to understand the Bitcoin protocol fairly quickly with a little reading, but I haven't come across much good writing on the mechanics of the Ethereum protocol. All of the intro texts I've seen are about like "Step 1: install the client" kind of stuff. I'm not interested so much in how to write smart contracts, so much as how the miners work, how conflicts are resolved…

I agree, Ethereum needs better reading material. I bought an Ethereum book by Henning Diedrich and it's pretty light to be honest.

What are the top (say, three) things you'd like to learn from such a book?

I agree, insides on the Ethereum tech (like how their proof of work relates to smart contract state, where the DAG fits in) are very brief / difficult to digest at some points.

Ethereum is elegant in many ways - for example, strengthening security by rewarding the linking of orphan blocks in the network. I think there's a need for some better education between the marketing material and War and Peace white/yellow paper ;)

Re: Tinychain: a pocket-sized implementation of Bitcoin

#29
post #8

Currently reading through a book on bitcoin, so this is extremely timely! Got me thinking, what are some solid bitcoin/cryptocurrency resources that the HN community would recommend?

I link to some of my favorite resources at the end of this section: https://github.com/jamesob/tinychain#what-is-bitcoin I also recommend subscribing to the bitcoin-core-dev mailing list.

Are there real hackers?? Yes !! Cos Cyber hacking has caused problems for various companies and customers.. protocolhacks{@}gmail.com, is group of hack team providing help to those who are willing to take the bull buy the horn and SAY NO to online fraudsters Have you been into a very long term relationship before or you currently have someone you havnt seen now for days,weeks,months or even years???? beware of scams PROTOCOL HACKS,protocolhacks@gmail.com we are a team of hackers everywhere on social dating sites,,eradicating and exposing those who call themselves lovers with hidden identities jst to get people scammed,say NO! now and contact us,we solve all problems.Do you need to keep an eye on your spouse by gaining access to their emails,private facebook,whatsapp,skype n many more account? and others to make sure they're not getting into trouble? University grades changing Bank accounts hack Twitters hack email accounts hack Grade Changes hack Website crashed hack server crashed hack Retrieval of lost file/documents Erase criminal records hack Databases hack Sales of Dumps cards of all kinds.. Our lives are now heavily mediated by technology (emailing, social media, e-banking etc). We are increasingly and often continuously online, open to engagement in a myriad of services and simultaneously open to cyberattack. Making sure clients are satisfied. Prices are heavily dependent on the problem you want us to solve

Re: Tinychain: a pocket-sized implementation of Bitcoin

#30

I would love to see this for Ethereum. I was able to understand the Bitcoin protocol fairly quickly with a little reading, but I haven't come across much good writing on the mechanics of the Ethereum protocol. All of the intro texts I've seen are about like "Step 1: install the client" kind of stuff. I'm not interested so much in how to write smart contracts, so much as how the miners work, how conflicts are resolved…

Not sure if this will help you: https://medium.com/@shiyan/ethereum-summary-a53c4a8e66d?sour...

This is great. I already understood most of BTC and ETH protocols, but learned some new bits, thanks for sharing!
Post reply on HN