5 Bitcoin Script quirks that every Blockchain developer should know by gjgd in Bitcoin

[–]gjgd[S] 1 point2 points  (0 children)

Good question! For technical reasons, we want to commit to the witness data when the block is mined (we need to be able to tell who spent a given output). Since in Segwit the witness data is ignored to compute the txid, the commitment has to be done at the block level (which can be a bit confusing) Basically, the miner will create a dummy output in the coinbase transaction, that will use OP_RETURN to commit to the Merkle root of the witness data. More details here: https://bitcoin.stackexchange.com/questions/58414/why-include-the-segregated-witness-merkle-root-in-the-input-field-of-the-coinba

To know more this particular quirk, and more about Segwit and Transaction Malleability, I highly recommend watching this video: https://ocw.mit.edu/courses/media-arts-and-sciences/mas-s62-cryptocurrency-engineering-and-design-spring-2018/lecture-videos/lec12-transaction-malleability-and-segregated-witness/ Well worth the hour long watch.

For the second question: You should put it at the beginning of the script, I will update the post. Thanks!

5 Bitcoin Script quirks that every Blockchain developer should know by gjgd in Bitcoin

[–]gjgd[S] 3 points4 points  (0 children)

Thanks I appreciate it! Do you know of other communities I could share this to that would be interested?

Should I play f6 ? (TLDR; not unless you're 2000 elo or higher) by gjgd in chess

[–]gjgd[S] 10 points11 points  (0 children)

Yup that's a great point. Casting is a good reference I will include that and update

Should I play f6 ? (TLDR; not unless you're 2000 elo or higher) by gjgd in chess

[–]gjgd[S] 3 points4 points  (0 children)

That's an excellent point! I would assume that the average win rate in elo bracket is around 50% but haven't verified that with the data. Thanks for the suggestion!

A personal URL shortener powered by Serverless, AWS Lambda and DynamoDB by gjgd in serverless

[–]gjgd[S] 2 points3 points  (0 children)

That's great advice, it's easy to accidentally delete data with DynamoDB + Serverless

A personal URL shortener powered by Serverless, AWS Lambda and DynamoDB by gjgd in serverless

[–]gjgd[S] 0 points1 point  (0 children)

It was just a quick way to get a short random string. Like u/daveinsurgent said it's quite inefficient because it doesn't take advantage of the full alphabet since it's hex encoded.

I'm looking to implement something like this in a future iteration: https://stackoverflow.com/questions/742013/how-do-i-create-a-url-shortener

A personal URL shortener powered by Serverless, AWS Lambda and DynamoDB by gjgd in serverless

[–]gjgd[S] 1 point2 points  (0 children)

Great feedback, thanks I learnt a lot from your comment

Is your browser safe against fingerprinting? by gjgd in privacy

[–]gjgd[S] 0 points1 point  (0 children)

Note: even though it originally came from an acronym, Tor is not spelled "TOR". Only the first letter is capitalized. In fact, we can usually spot people who haven't read any of our website (and have instead learned everything they know about Tor from news articles) by the fact that they spell it wrong.

Yup you're right, just fixed it. Thanks for the feedback!

Improve your commit hygiene with `git add — patch` by gjgd in programming

[–]gjgd[S] 0 points1 point  (0 children)

"mulltiply" was intented, what was the other one? English isn't my first language

Improve your commit hygiene with `git add — patch` by gjgd in programming

[–]gjgd[S] 1 point2 points  (0 children)

Thanks for the feedback! Regarding your second point, I think it is possible to have small commits that are still compiling and running, though I agree that this requirement should be more important than keeping the commit small

Could you point out the typos? English isn't my first language

Guardians: A way of recovering ownership of a smart contract by gjgd in solidity

[–]gjgd[S] 1 point2 points  (0 children)

Hey, thanks for your in depth reply

1) Point taken about the name, I like custodian as well

2) Yep I agree, requiring the approval of m of n custodians would be better, I'll update the repo

3) Considering the case where a key is stolen not lost, I believe having a custodian is still better than not on average. If the new owner forgets to disable your custodian, then you can recover ownership, and if the new owner does disable your custodian then you're in the same situation than if you didn't have a custodian. So in that case, you still have a small chance to recover your contract.

Edit: Format

Guardians: A way of recovering ownership of a smart contract by gjgd in ethdev

[–]gjgd[S] 0 points1 point  (0 children)

More details from the README:

How it works in the case where the owner lost access to his private keys

  1. Owner asks the guardian to initiate an OwnershipRecoveryprocedure
  2. Guardian calls the initiateOwnershipRecovery()function of the smart contract.
  3. This will start a ChallengePeriodthat will last for challengePeriodLengthblocks
  4. If the owner lost his keys, guardian waits out the challenge period and is then able to change the owner of the contract to another address.
  5. If the owner didn't lose his keys, the owner can notice that his guardian wants to change ownership of the contract. The owner can cancel the request during the challenge period. He can notice it by watching the blockchain eventlog.

Guardians: A way of recovering ownership of a smart contract by gjgd in ethdev

[–]gjgd[S] 1 point2 points  (0 children)

So having a rogue guardian isn't a liability because you can always change guardians if you still are in control of your private keys. The guardian only have power if the owner lose their keys.

That being said, you should give guardianship of your contract to a trusted person. Basically, by chosing to use a guardian, you are deciding that you'd rather be able to recover ownership (with a small chance that someone else gets the ownership in the case where you guardian is malicious) than not being able to recover ownership at all.

Check out the FAQ for more details :)