Hacker News new | past | comments | ask | show | jobs | submit login
[flagged] How to send $ETH in 19 lines of Python (replit.com)
37 points by sorenrood on May 5, 2021 | hide | past | favorite | 71 comments



I wish the software engineering community would stop with the click-bait headlines.

Write a game in 2 lines of Python:

    import MonolithicGameSDK
    MonolithicGameSDK.run()


201X+ headlines in general. Title should be changed to "I imported a python library and used it without throwing an Exception, and so can you!"


Click-bait Headlines Considered Harmful


This is misleading, the code doesn't send the $ETH, it's calling a third party API (infura) to do it


You can do the same with a local client, just call localhost instead of Infura.

You need to install an Ethereum client locally of course, but it’s pretty straightforward.


Is there a good replacement for hackernews? The crypto-skepticism that derails every single thread even tangentially related to crypto currency has totally undermined my desire to participate in this community. It appears the "hackers" have moved on.


Yes, it's called lobste.rs. Yet they started suffering from the same 'too sensitive SF crowd lenses', where they see the world with their very narrow view and anything that's not in their narrow space - will be of course downvoted. I kinda miss old groups where you would be able to read "not so popular" comments, without damaging your eyes due to them being greyed out, or without a need to select it to see the text. HN crowd is very specific, in a bad way.


If you click on the timestamp of a downvoted comment, it should go to a page where the text is fully readable. Yes it's an extra hop, but that's a small price to pay for an immune system.


Lobste.rs is a club where the bouncers are extremely selective over who is allowed to come in and partake, only to find most tables are empty.


That's because many of us are skeptical of the current cryptohype. I'm sure many innovative things will come out of all these experiments, but right now, it feels like many people are taking the opportunity to con other people into using real money to buy their virtual money brand.

If you want a cryptocurrency-friendly forum, the r/CryptoCurrency subreddit would be ideal.


Pretty neat! I wrote and now co-maintain a library that has similar ease-of-use for Bitcoin: https://github.com/ofek/bit

Even fewer LoC :)


Is there any word on if browsers (chrome, firefox, or safari) will support crypocurrency transactions so I don't have to download a 3rd party plugin?


brave is bundled with metamask. its not technically native, but it works very nicely.


I wrote a Replit tutorial on sending Ethererum from wallet to wallet in Python. It takes only 19 lines of code and is super easy to set up!


How do you test it? I'd like to test without depending on some remote service, which could be unreliable.


You can create your own local eth network (i.e: with https://www.trufflesuite.com/ganache)


I link to the test transaction at the bottom of the post!


You can connect to the testnet and use the faucet.


wait, replit doesn't have memberless repls ? how much did it change since the last year..


With geth you can do it in 2 lines


Yeah, right. Sending my private key straight to $thirdparty.


This doesn't do that, but okay, there are other criticisms to be had of this article


Stupid


Tell me how to do something worth doing with ETH and I'll be impressed.

Cue the intellectualization from "investors."


When I was buying ethereum at 17 dollars and getting a mortgage. I was buying it hoping sometime in the future I could renew the mortgage with an ethereum contract.

It could detail in code the principal, functions to trigger interest rate increases/decreases, functions to cancel, early termination fees, payment addresses, max payments per year, end dates, and whatever else a mortgage contract would need.

As a developer I would have felt much more comfortable with that than legal papers, brochures and pamphlets.


> buying ethereum at 17 dollars

Not so humble brag...

*Back to reading*

Yeah, recently bought a place and yes, the process is hostile to the consumer (200 pages of legal sized dense contract, give me a break).

However, did you ever think that there could be a, you know, simpler solution than, say, CRYPTOGRAPHY LOL

PS: cash-out now if you want to humble brag after ******* happens!


Does programmatic money not sound exciting to you? I see way more skepticism than support on HN but it surprises me. Can you really not picture any uses for a financial system with Turing completeness?


I've been playing with programmatic money since selling runescape gold for PayPal dollars. I guess I just need more idk


Huh? That's not what "programmatic money" means. You're confusing it with digital currency.

Programmatic money means you can define code/program with the money itself. In a trivial case I could easily program the money (called a smart contract) to pay you $1 every day. I could put $1000 in that contract and you could have near-total confidence of that payout schedule. The code itself is a property of that money, and its execution is enforced by the same system that secures the overall ledger.


Incorrect. You're confusing "enough trust to make the world go around" with "so trustworthy we're neglecting that it's bad for the world."

And I mean the latter more in terms of the brain drain than ecologically, which ironically may not get solved because of that brain drain.


The government needs to be in control of the money supply. Monetary and fiscal policy are important levers for maintaining the health of our economy. The government uses money to bolster trade, issue debt, maintain a high standard of living, etc.

Crypto is a bunch of investors and engineers that think that they should be in charge rather than our elected governments. It's not even a geniocracy since it rewards only early investors. It's an oligarchy of the lucky few that think they should have more leverage than governments and the populace. It disenfranchises the government's ability to help the poor, underserved, and disadvantaged.

Crypto not from the government is dangerous.

I predict that as this plays out more governments will move to shut it down.


While clearly an unpopular comment, the "investors" would like you to think that somehow the risks in crypto are any better than the comparably stable government system.


> The government needs to be in control of the money supply.

Not interested in bureaucrats determining my purchasing power, sorry


So rather than systems with oversight, faces, and names attached to them, you would prefer an entirely programmatic system where all transactions are final and irreversible which is not beholden to any intervention? There’s an old adage about how all programmers hate technology or something like that and I worry that we are flying too close to the sun here with the crypto hubris.


> all programmers hate technology

The latest wave of "investors" aren't programmers.

But yeah, the trust issue illustrated by your comment speaks volumes. I just wish people didn't think our problems were as easy as "sprinkle a little tech on it."


> So rather than systems with oversight, faces, and names attached to them, you would prefer an entirely programmatic system where all transactions are final and irreversible which is not beholden to any intervention?

Yes, correct.


What good is a system, if it only benefits a few? And levers are used at the wrong time, benefits only a few people?


Antarctica will be happy to have you. /s

But seriously, functional governments are what hold society together. We can't have a system without levers.


Functional societies existed long before central banking and costless money creation


Straw man.

Those societies also existed alongside slavery and tons of other bad shit. So how does that change the value of a functional government?


Central banking caused the end of slavery? now that's a hot take


Have you heard of blood diamonds? I bet ETH solves that problem with a ledger /s


It's interesting that the Kimberley Process intended to prevent conflict diamonds is a chain of warranties, one of the criticisms thereto was that there was little proof that the previous warranty ever existed.

So even though you're being sarcastic, you might be on to something there :) (I'm not suggesting this is possible, just idle musings)


More like, cue the crypto critics.

There are a million and one places to talk about the veracity of cryptocurrency. This thread doesn't seem like one of those places.


Too late, and those other places are not where I am so


What do you define as "worth doing"? DeFi alone has tons of potential answers to that question. Then there's decentralized exchanges... or do you not think decentralized currency exchange is "worth doing"?


Yes, please screw the rich guys taking tolls on exchanges. This can be done way simpler and more efficiently without ETH.


Is there anything you would like to do that you need ETH for?

Are you looking for inspiration or are you looking to talk about use cases that you will never be in the market for?


How do they know what they need ETH for if they don't know what it's actually useful for? I'd be curious what a few of your top "you need ETH for this" cases are.


So are you fishing for ideas now?

I'm not going to "prove myself" here so that you can give me the blessing to ask a valid question.

In sibling comment I mentioned DAO, but those are a bit out of reach for more than just the technology are far to immature.

Everything else sounds like the next new future fallacy [1]. But no, your "libertarian" ideals won't flourish when you sprinkle in a little crypto and run your servers out of china.

[1] https://andrewchen.com/the-next-feature-fallacy-the-fallacy-...


I mean, I've learned enough to have plenty of ideas for "how to use ETH" but nothing makes the cut.

NFTs are **.

DAO is too grandiose, especially to be hosted on ETH.

And that leads to my comment.


okay, there is a robust repurchase agreement (repo) market on the Ethereum network that allows for anyone to enter the repo market to settle trades of practically unlimited sizes.

before last year this was exclusively the domain of investments banks given the privilege of using the Federal Reserve's overnight repo market. Where the Federal Reserve would provide hundreds of billions of liquidity and destroy it at the end of the trade, allowing the banks to use credit to finish deals overnight.

in the Ethereum network anyone is allowed to use this, it is called "flash loans" in that market, and as always, writing any transaction on the Ethereum network requires the use of ETH, the native fuel necessary to commit transaction to the state machine and save the state.

flash loans = repo market

the difference being that on the Ethereum network, people borrow from liquidity pools, instead of newly created dollars like when a central bank is involved. this has much greater accountability and confidence. the transactions are executed in one block, if it is not possible for the operation to return capital to the liquidity pool then the transaction fails and it was never executed, but the person that attempted it still pays the transaction fee in ETH as the nodes still did use compute time.

Ether is just necessary to access compute nodes on the Ethereum network - specifically to write, as reading is free - no different than dollars are necessary to access compute nodes on the AWS Lambda network. Its not that complicated. If you don't need to write to compute nodes, and you are also not providing collateral to liquidity pools, then you don't need Ether.


In this perfect new world do bad decisions also haunt you forever? Like student loan debt, your ETH reputation will follow you through bankruptcy (but obviously crypto-vestors are all too financially savvy to worry about that).


"much greater accountability" not equal "perfect new world"

my response to you was completely devoid of ideology and you keep trying to shoehorn snarky versions of enthusiast ideology into it

any way regardless of if you were actually asking a question or if you had already made an answer to it, the answer to that question is no, they don't haunt you forever and if the observable nature of blockchain transactions bothers you there are plenty of projects reducing that as well, which some segment of the market might find valuable


"We don't trust each other so we need immutable ledgers" sounds like "we need more horsepower so we need stronger horses!"

Works in theory...

Edit:

@vmception: If something leads everyone and their grandmothers to "invest" then it deserves scrutiny. And there is nothing to respond to.

I mean "yes sir, that's right, you have knowledge of financial instruments and speculation, very good, now I'd like to ask why you're OK with people mistaking this as a serious investment instead of the quant-level speculation you are referring to, sir, thanks."


In response to your edit

"I'd like to ask why you're OK with people mistaking this as a serious investment instead of the quant-level speculation you are referring to"

I literally do not care how people use their money but if you actually read between the lines, I have been saying that ETH is not something you should hoard. You only need as much ETH as necessary to write to compute nodes based on the computational expensiveness of the operation. You can do fairly arbitrary executions as long as you are willing to pay for it. I don't personally care what those executions are. But of the subset of those executions, the repo market and liquidity pool providing has stood out to me. And as I've said two or three times now, if you want to speculate on other people doing those "quant-level speculations" because now you don't need to be a top investment bank anymore and instead can just watch a few youtube videos to borrow and repay a few hundred million dollars for a few seconds, then go ahead an hoard ETH.

My actual opinions on unsophisticated people investing has nothing to do with Ethereum specifically. I am opposed to any barrier on investing when there are no barriers on gambling. Negative expected values games are available to all, but for something with positive expected value we want to coddle "grandmothers"? Miss me with that nonsense.

You act like you are here to provide scrutiny but were predictably never here to discuss any use case. You act like you were diplomatically asking for use case, and then never discuss any one of them only to move the goal post until revealing what everyone could tell you were trying to get at. Thats why I asked you, are you in the market for anything? Its useful to me to be able to borrow hundreds of millions of dollars for 5 seconds to earn a few basis points on an arbitrage I identified, without asking anybody. You can pretend that a MySQL database is better for that, but nobody is offering that service and it is fairly impossible to because of the financial legal barriers for a central party to offer a service that are exclusive to a central party, primarily around custody of funds, fiduciary duties, money service licenses, broker dealer licenses, settlement and inefficient state currency controls. The current evolution of the onchain services do not have custody to begin with, which are legal explicitly written exemptions to all of those laws.


you never respond to anything I say and that's annoying

and to the things you do randomly say - as if procedurally generated - so what?

stop trolling, do you want or need to commit state to compute nodes on that network or not? do you want or need to provide liquidity or not? do you like to speculate on other people doing those things more in the future or not? if the answer to all is "no" then move on


Receive ETH, and turn it into dollars.

Tutorials should focus on getting money, not sending it out, if they want to get people's interest.


Found one! This right here is worth doing. Thank you.


Yes trustless and distributed things have no value, crypto is stupid, BTC is a waste of energy, yada yada yada.


I never said no-value. And my opinion on the valuation is no better than yours.

I'm seriously wondering how many things you did this year where you were like "damn, I sure wish this were decentralized and cryptographically secure, yeah, that would make this 10X better for sure, yeah!"


I'm not looking for a 10x improvement, I'm thinking of getting closer to the ideal. So many things are hidden behind layers of obfuscation and forced trust (authority). If society as a whole put many of these functions on chain, at least the hiding would go away.

Long term, I'd love to see fully open implementations of the justice system, education, political donations, property/ip rights, DNS, adtech, on the chain. I don't care if they make money, I'm not saying there are riches here. But I for one would have loved blind grading that is verifiably blind, when I was in school. Teachers had too much arbitrary power. I also would love to earn from my own advertising data, and willingly be able to give it to sites. I could keep going.

Blockchains are obviously a buzzword, and the current crypto hype isn't without plenty of scams. But revolutions don't occur in days or weeks. The push towards trustless and decentralized systems is happening right now, and in my opinion, benefits society. It could take decades to replace systems currently in place.


It’s useful as a means to trade even scammier coins. Not so much beyond that.


I guess that's "worth it" for some people here.

The joke is, those people already missed out.

"Crypto", no way that moniker lasts, is already in the greedy phase. Stay back, especially if those crypto dreams include money you shouldn't gamble with (student loans, seriously, don't do it).


Making insane yield (50%-300% apr, depending on the time) on dollars


That’s exactly the problem for me: I’m the kind of person who sees money as “a token to be traded for goods and / or services”, and why would any normal person (ie, not counting crypto investment nerds) want to trade their eth if the most profitable thing to do is to hoard it?


Why do you buy things when you could only ever save?


With stable currencies, if I buy $10 of stuff today, then I have $10 of stuff, and at the end of the week my bank account will be $10 (+/-0.01%) lower than where it would have been had I saved the money. I don’t regret this purchase.

With inflation-stage cryptocurrencies (Which I’m assuming ETH is, given that the article says "At the time of writing, ETH is at an all-time-high”), if I buy $10 of stuff today, then I have $10 of stuff, and at the end of the week my bank account has missed out on $300 of inflation. I should’ve saved my memecoins and used some other currency instead.


Don't ask a question that starts with "Why" (unless you're seeking a defensive response aka negotiating).

And the answer to your question is learn about the stopping problem https://en.wikipedia.org/wiki/Optimal_stopping


"That's what Bernie Madoff said."

But for real, that doesn't make the cut. 1) maybe I don't have capital to invest, 2) your "yield" calculation ignores all risk.


It sounds like you have some additional constraints that you didn't make clear in your original question.

You said, "Tell me how to do something worth doing with ETH and I'll be impressed."

Also, you need things that you can do without capital, and that fit a specific risk profile that you haven't elaborated on. It sounds like you're assuming that making these yields are too risky for you, so are you looking for zero risk, or can you accept some risk?

Can you specify up front your constraints?

Here are two things you could do with ETH right now:

1. You could use it as the coordination layer for a decentralised git repository, that is fully distributed and censorship resistant. Hopefully you can see how this could easily be adapted to many similar use cases: https://github.com/cardstack/githereum

2. You could purchase flight delay insurance that pays out automatically if your flight is delayed: https://etherisc.com/

> Cue the intellectualization from "investors."

Cue the moving of the goalposts




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: