this post was submitted on 03 Aug 2023
66 points (83.7% liked)

Programming

17313 readers
275 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities [email protected]



founded 2 years ago
MODERATORS
 

Hello!

When I was creating a CTF for a conference, I've finally got to learn about how blockchain and smart contracts actually works in practice, and the whole concept is simply brilliant. A quick introduction for those unfamiliar with it would be in this summary, but just to summarize how I basically understand it, blockchain is simply a VM that runs code (smart contracts) a both the code, and result of every execution of it is calculated by a bunch of users (so, mining is basically running a VM) and appended into the blockchain based on some kind of consensus and proof of work. This means that you get a single source of truth and history of every execution of a smart contract that is decentralized and you can rely on it.

But, almost every use of blockchain or smart contracts I have seen has pretty large issues either in sustainability in the long term, or in cases where you simply need some form of an authority to prevent and punish misuse. While I'm not really that much familiar with every use of blockchain so far, I will first list what I've already thought about or seen, and the main issues that I think are a deal-breaker for choosing blockchain for that kind of tasks. It's possible that some of the issues are wrong or have already been solved, so please correct me if I'm wrong - my knowledge of blockchain isn't really that in-depth.

First and the most common use is the one you are probably most aware of - cryptocurrencies. If I ignore the biggest and most unfortunate issue of cryptocurrencies turning into an investment-only product, with hugely volatile and inflated price that is not backed by any kind of real value (sure, you can pay with BTC, but it's slow, expensive and super volatile to be useful, so the only real use is to literally sell it to others for a profit - which also basically means you are scamming someone out of their money down the line), I see the following problems with using blockchain for currencies:

  • Longevity - The ledger size is already getting massive, only after a few year. It's not sustainable, and it will eventually be really hard to keep the whole ledger at a large enough number of places to not run into problems of integrity. It's growing exponentionally, and is at around 500Gb after around 10 years.
  • Gas cost - It's getting harder and harder to mine and confirm new transactions, which increases the cost while also making less people able to mine new transactions without being at a loss. This will only get worse, and eventually lead to the 50% problem (if someone controls 50%+ of mining nodes, he can confirm fake transactions or do whatever he wants with the blockchain) being a real issue.
  • Lack of moderation - This may be one of the more controversial issues, because it goes directly against the whole idea of cryptocurrencies, but is one of the biggest problems I see that are in the way of crypto being able to be considered for wider use. We live in a world where some people are dicks that are not afraid to steal and cheat, and something like a currency simply has to be moderatable. You need to be able to punish criminals, and take back what they have stolen. If someone doesn't pay their debts and owns me money, the government should be able to just take the money if they have them. If someone uses an account for scamming and stealing, it should be possible to freeze it.

The last issue will eventually show in most of the other uses of blockchain as well, and while I have included it, I'm still not sure how I feel bout it. In an ideal world, you would not have to deal with something like this. I would also really like to have an option to do my transactions privately, without anyone being able to profile my behavior and data, but such a system would have to allow for some safeguards against missuse to be widely adoptable. (Which is an interresting off-topic question - would it be possible to create a system that is private, but also has the possibility for trusted authorities to freeze accounts and force transactions?) And the more that I think about it, the more I'm certain that I'd rather have a centralized system where you can punish criminals and scammers, than a system where lives of people are regularly ruined by someone stealing all of their savings unpunished. But it is a thin line - I only say that because I live in a country that is all-right and I can trust my government - for now. But I definitely agree that such a private unmoderated option should exist - but can't be considered for widespread use, which I've heard some people say that "crypto will replace cash in a few years". And this is why it never will, IMO. But this discussion shouldn't be about whether this is a good opinion or not - but more about "what blockchain is a good tool for".

Next one are NFTs. I will just quickly gloss over them, because they are even bigger scam than crypto is. Ever heard someone say "Someone has copied and minted my NFT?". Well, it's a shame that there isn't some kind of centralized authority that could, you know, not allow them to do that.

Another use I've heard someone praise as "the future" was lending money. I'm not sure what were they talking about, but the whole point was that you can... Escrow an amount you are borrowing, and then borrow the same amount? It didn't make any sense, so I guess I'm missing something, but then again - we have the same issues as above, while also it being just a bizare idea - why simply not use the amount you already have? The person tried to explain it to me, but it just feels gimmicky. And if you escrow a lesser amount, you then have the same problem with moderation as above - nothing can force you to return the money (unless it is already escrowed, but then, why??)

So far, every use of blockchain I have heard about would be better done in a centralized fashion, especially as far as longevity is concerned. The growing ledger size and increasing gas cost, along with the 50% problem simply makes most of these kind of uses too impractical to work on a larger scale.

But I really like the concept and idea of smart contracts, and I'm sure there has to be some kind of use that is not as "revolutionary" or large scale. I'm just having hard time coming up with any.

I have only one - voting, and maybe transparent randomization (i.e lottery). Smart contracts are an amazing way to collect votes transparently but privately, since you can be sure that no-one can cheat, if you set it up properly. It's also something that doesn't suffer from the longevity problem, because it's more of a one-shot use of blockchain, rather than something ongoing - which also justifies the price.

(tl;dr feel free to start here:) Which is what I'm interested in - does any of you have similar ideas for use of smart contracts and blockchain, that would be practical in a daily live? Be it one-shot smart contracts for a small task, such as voting or random winner selection, maybe some kind of escrow. It doesn't have to be a "society changing system", or something revolutionary. A common small code snippets or apps that would solve the trust issue inherent to a centralized task is what I'm after - but have hard time coming up with.

And just a disclaimer - I don't plan on building anything and am not fishing for the next blockchain thing, I barely even understand it. I would just like to incorporate blockchain into my programming repertoire as a tool, because the concept feels so clever, but is also misused or misunderstood due to hype, but it has to have it's uses that are overshadowed by people jumping on the blockchain bandwagon without considering whether it's really the best tool for the job.

But is has to be a good tool for some kind of problems, right? And I would like to start a discussion about what would that be, without it being affected by the hype and reputation surrounding blockchain. I feel like that would be an interesting though exercise, and I'm sure we can come up with some interesting little uses here and there, without it being gimmicky but actually the best tool for the job.

Thank you!

EDIT: And I'd like to add that I never got into the blockchain hype, and my opinion on how it's used so far is mostly negative. If a product mentions blockchain, I usually just avoid it as a gimmick. But that's why I'm genuinely interested in this discussion - I don't judge a tool about how people misuse it.

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] -3 points 1 year ago (2 children)

Land deeds and property titles.

Maintaining a provable chain of ownership and legal transfer of land and property is required for mortgages, for title insurance, inheretance, etc.

A public, decentralized ledger of land/property transfers could revolutionize home ownership, lending, insurance, etc

[–] tsz 17 points 1 year ago (1 children)

Land ownership (in the US) already is public. What problem would this solve? What problems would it create? How would the solutions outweigh the problems?

[–] [email protected] 8 points 1 year ago (3 children)

How does a central government database not also solve those problems?

[–] half_built_pyramids 6 points 1 year ago (1 children)

There's only a few recorders who actually check title, called Torrens, when you record something in the US. 99% of them work under abstract where literally anyone can record anything as long as they pay the county recorder and meet the basic requirements like have a notary stamp.

There's a good chance if you're in the US that I could just record a deed giving me ownership of your house or apartment complex. I'd have to fraudulently sign your name as grantor, but the county isn't going to stop me. You'll have to stop me.

There's a whole huge industry around recording and verifying deeds for sales to deal with that type of nonsense. First, they won't want to get dismantled. Fidelity is huge for example. Sort of like how TurboTax inserts themselves between you and paying taxes. Fidelity inserts themselves between you buying and selling a house.

A verified Blockchain would essentially turn everything into torrens instead of abstract title. I think that's a good thing and I'd rather pay the government to verify the transaction than done for profit company that's going to review title as quickly and cheaply as possible.

Nevermind having to deal with a title insurance industry -- like all insurance -- that's inherently be incentivised to reduce costs by not paying claims.

[–] TCB13 10 points 1 year ago (1 children)

A verified Blockchain would essentially turn everything into torrens instead of abstract title. I think that’s a good thing and I’d rather pay the government to verify the transaction than done for profit company that’s going to review title as quickly and cheaply as possible.

You can pay for the govt for that service without introducing blockchain-based BS in the process. After all that's what most countries do, land rights and transactions are recorded, stored and verified by some governmental branch.

[–] [email protected] -2 points 1 year ago (2 children)

A central database would be just a list of all the land and who owns it.

Right now, the deed system is a bunch of deeds that say "remember when I got this land, on page 302 of book 75 in the county recorder's office? Well now Jimantha owns it actually, since they bought it from me for ten dollars and a peppercorn.". This is great for accountability: it lets you trace ownership history and provides a piece of evidence to substantiate every transfer, and so helps you answer inconvenient questions like "why should you own that house when it was my grandmother's house and I want to own it?". It also lets you roll transfers back if they are found to be fraudulent, and neatly captures how all current ownership is contingent on the theft of the whole place from any disposessed original inhabitants.

This is also basically how ownership works in many current blockchain systems: you select something you own based on the transaction that gave you ownership, and then you say who should own it now in a signed message.

But the blockchain systems verify signatures cryptographically, whereas the county recorder verifies the authority to transfer stuff on the "you think someone would just tell lies? On the Internet?" principle. And the centralized database doesn't even keep the transfers around for review, it just has the database operator in charge of who owns any given thing at the moment.

Would you rather walk up to a grumpy person with a shotgun and demand that they move out while brandishing a printout of an SQLite database recently recovered after the ransomware attack at the county administrative building? Or with a deed with their spouse's signature on it?

Then the problem is to make the deeds more machine-readable, and to get better at not putting in deeds from people who have no business writing to that part of the ledger, for which pieces of blockchain technology might be useful.

[–] [email protected] 4 points 1 year ago (1 children)

How does forced repossession of property work? You didn't pay your bills. The only asset you have is the land. Court authorized giving it up in a lawsuit. I don't know. Either way, there must be some way to enforced transfers without voluntarily relying on the person.

And who's managing the keys? The land owner? What happens if they lose them? What happens if they die prior to transferring property?

[–] [email protected] -1 points 1 year ago (1 children)

Tying keys to natural people is indeed an unsolved problem.

The system can be designed to recognize more people than just the current owner as authorized to do a transfer. You could do the whole tax record tracking in the same system, to ensure that property can be seized for back taxes exactly when back taxes are owed.

[–] [email protected] 4 points 1 year ago (1 children)

Then it has the same weaknesses you pointed out in a centralized system, except it's less efficient and uses more power...

[–] [email protected] -1 points 1 year ago

Not all of the same weaknesses. If it's just "let the judge move stuff around because they're a judge", then yeah. But if you implement any sort of security on it, you can say that the judge can only move stuff when also countersigned by the jury, who were demonstrably selected by a fair random draw, or something.

And even if you don't do that you still have a great record of which judge exactly is stealing everyone's stuff.

You can't just wave a blockchain wand and get a government that works, but you can just wave a blockchain wand and get an accountable record of things.

[–] [email protected] 3 points 1 year ago (1 children)

A central database would be just a list of all the land and who owns it.

Says who? Why would it not be a list of who owned/owns that land and when they owned it?

Would you rather walk up to a grumpy person with a shotgun and demand that they move out while brandishing a printout of an SQLite database recently recovered after the ransomware attack at the county administrative building? Or with a deed with their spouse’s signature on it?

Yes, the document from the county administration would be much better, than some "magic" contract from the internet that may or may not be enforced by the county.

[–] [email protected] -1 points 1 year ago (1 children)

If the county isn't actually using the system you try to present evidence from, of course it will not work.

If you have a list of who owned the land and when, and you have evidence to support each transfer, then you have a log-structured or relatively blockchain-like database.

[–] [email protected] 3 points 1 year ago* (last edited 1 year ago) (1 children)

Why would the county not use their own system? What are you even talking about? You seem to simultaneously make arguments for and against blockchains in the same sentence.

[–] [email protected] 2 points 1 year ago

Yes, the document from the county administration would be much better, than some “magic” contract from the internet that may or may not be enforced by the county.

If the magic contract from the Internet is not actually likely to be enforced by the county, then the county is not actually using the magic Internet contract system. If the system were adopted by the county, then the official records from the system would be known to be enforceable.

I sound like I am for and against blockchain because I am. I don't think you can stand up any existing blockchain system and start slapping government functions onto it and get a good result. People won't understand it well enough or have sufficient resources to be true peers in the system, and if they did it wouldn't scale very well.

But I do think that governmental systems can be improved by taking inspiration form blockchain technology and drawing on its underlying philosophical principles of accountability and consensus.

[–] [email protected] -2 points 1 year ago* (last edited 1 year ago) (2 children)

How do you prove someone in the central government didn't take a bribe and tamper with the records? What if you're from a country where the central government is less than stable? How would you prove ownership if something were to happen to that database? How do you prove that someone is who they say they are? How do citizens and businesses access that database? Is there a standardized format for it? Does it use some proprietary software built by the lowest bidder?

Not saying that blockchain has all the answers or that it is the right tool in all cases, but these are some of the problems it is trying to solve.

[–] [email protected] 5 points 1 year ago

If you live in such a shitty country, the records would probably not be respected anyway. Also a blockchain still has to allow new inputs from a trusted source. And that source could still make up a fake sale and give your land to someone else.

(And no, priavate wallets wouldn't work to protect that transaction... because what if you lose your wallet?)

[–] [email protected] 4 points 1 year ago

If the government is unstable what authority do you have to claim the land is yours. Land ownership is literally backed only by the government. Forced change of ownership must also be possible, therefore the same weaknesses would exist in Blockchain as elsewhere. Tracking property who's ownership isn't inherently authorized by the system itself is pointless. The rules will change. The government will never back a system that controls physical property unless they have the authority to change it. You can try to argue individual sovereignty, but that simply doesn't exist. You only own the land as long as the government backs you up on that. If the government collapses, no Blockchain will convince a new government that they can't take the land from you.