Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion: allow people to download the Bitcoin whitepaper from the blockchain using Electrum #6970

Closed
CodeForcer opened this issue Jan 26, 2021 · 4 comments

Comments

@CodeForcer
Copy link

CodeForcer commented Jan 26, 2021

Recently a criminal and fraudster posing as Satoshi Nakomoto has begun threatening to sue websites who are hosting the Bitcoin whitepaper, in an effort to intimidate the community through litigation.

In response, many companies have taken a stand against his behaviour and begun hosting the whitepaper themselves. My company for example, is hosting the paper in perpetuity here:
https://localcoinswap.com/bitcoin.pdf

For some time the Bitcoin whitepaper has actually been available from the blockchain itself, downloadable through a single Bitcoin cli command:

bitcoin-cli getrawtransaction 54e48e5f5c656b26c3bca14a8c95aa583d07ebe84dde3b7dd4a78f4e4186e713 | sed 's/0100000000000000/\n/g' | tail -n +2 | cut -c7-136,139-268,271-400 | tr -d '\n' | cut -c17-368600 | xxd -p -r > bitcoin.pdf

I would like to suggest that Electrum allow the whitepaper to be downloaded from the blockchain through the wallet, perhaps just unobtrusively in the help menu. It would be a cool demonstration of some of lesser known properties of Bitcoin (file hosting), as well as a statement in solidarity with the other companies, organisations, and individuals who are standing up to this attack on our freedom to share the magic of Bitcoin's creation.

@ecdsa
Copy link
Member

ecdsa commented Jan 26, 2021

that's funny, I already have a branch that does that :-)

@ecdsa ecdsa closed this as completed in d7515b9 Jan 26, 2021
@ZenulAbidin
Copy link
Contributor

ZenulAbidin commented Jan 27, 2021

While I understand I am not a contributor to Electrum, I am a Python programmer and I want to point out that the way d7515b9 fetches the white paper is error-prone.

It is splitting the bytes of the transaction by hand without taking into account the format of transactions as defined by various BIPs, and most importantly with no exception handling whatsoever. This means that this code below will fail if network.get_transaction() returns malformed output for whatever reason.

s = s.split("0100000000000000")[1:-1]
out = ''.join(x[6:136] + x[138:268] + x[270:400] if len(x) > 136 else x[6:] for x in s)[16:-20]

In particular, since according to my understanding network.get_transaction() requires an active internet connection, this commit is going to cause an uncaught exception to bubble up if Electrum is running on an offline computer, such as if it's being used as cold storage.

I suggest adding a menu entry that opens a browser URL directly to https://bitcoin.org/bitcoin.pdf instead.

@SomberNight
Copy link
Member

and most importantly with no exception handling whatsoever

I've added error-handling in d139953

It is splitting the bytes of the transaction by hand without taking into account the format of transactions as defined by various BIPs, [...] This means that this code below will fail if network.get_transaction() returns malformed output for whatever reason.

network.get_transaction() cannot return malformed output; it either raises or returns the expected str. The expected str is committed to by the txid. This is an assumption which if broken, we do want to know about it and we do want an exception to propagate out to the crash reporter.

@verretor
Copy link
Contributor

I suggest adding a menu entry that opens a browser URL directly to https://bitcoin.org/bitcoin.pdf instead.

bitcoin.pdf was removed from bitcoin.org a gew days ago.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants
@ecdsa @verretor @SomberNight @CodeForcer @ZenulAbidin and others