News for hackers. Stuff that matters.
Re:Web3 architecture and how it compares to traditional web ... by shiohime on Sunday October 10, 2021 @02:31AM (#28816267)
I've been playing around with creating a few dapps here and there and I do have to say I really enjoy being able to use wallets as a proof of identity rather than hooking in a dedicated authentication server. I haven't created anything to scale yet but I think simply using wallets instead of relying on oauth for simple applications is really lowering the amount of time I have to put up front into creating proof of concept applications.

Also, I really do think that NFT ownership serving as an access token into a service is a very neat feature that we'll start to see more of as people start getting more creative with NFTs instead of simply being an art asset. There's a lot there and we're barely scratching the surface imo.

Re:Web3 architecture and how it compares to traditional web ... by albertgoeswoof on Sunday October 10, 2021 @03:43AM (#28816570)
The auth thing is great! But from the end user and the developer perspective there’s no difference between an oauth provider and a wallet. You still have to set it up on the machine and “login”, same for the app developer
Re:Web3 architecture and how it compares to traditional web ... by shiohime on Sunday October 10, 2021 @02:29PM (#28820796)
Yeah, they are comparable, but there is definitely a difference, from both an end user, and developer. The flow is similar - you have to have a wallet, and you have to authenticate it. But really, that's about it.

From an end user perspective, all I need to do is press a button to connect my wallet, and I'm in. The site doesn't even need to reload or hit a callback uri. It's a much simpler flow than any of the oauth authentication flows. Also, as anyone can create a wallet and it is not tied to any other identifying information, it's a breath of fresh air to have some vague sense of anonymity than hooking everything into a centralized email account.

From a developer standpoint, all I need to do is use an API with a callback function that on success takes whatever data I need and update my application state appropriately. It really is smooth, and I don't need to do things like maintain session or handle access token expiration and request refresh tokens. I can sign messages on the frontend & verify signatures on the backend to ensure the user is who they claim to be. It's so simple compared to the stuff I had to implement in the corporate world for OAuth (granted, the projects I've been working on in the space are much less complex).

If you want to try it out yourself as an end user, just download a wallet extension and check out an nft marketplace such as solanart or opensea. You simply have to connect, and that's it. I find it fascinating personally and it's one of the pieces of web3 that I'm most excited for. I believe we're going to continue to see a lot of innovation in the space.

Re:Web3 architecture and how it compares to traditional web ... by Fiahil on Sunday October 10, 2021 @04:31AM (#28816780)
With most of the comments here criticizing blockchains, it's hard to get any meaningful discussion on the topic.

Having set up a lot of SSO and other auth mechanisms, I think there is a good opportunity for a combination of NFT-access-token + WebAuthn [1]. The nice thing about that would be a secure login without email/passwords combination that you can access with your biometrics. Imagine the same flow as login with 1Password without having to fill the form.

On the developer side, you don't have to setup the OIDC flow, database, or anything. You just rely on a generic service to provide you with a token. Less opportunity to mess it up, and it can work on localhost too.

Now, would be the question of a similar exercise for authorization.

[1] https://fr.m.wikipedia.org/wiki/WebAuthn

Re:Web3 architecture and how it compares to traditional web ... by shiohime on Sunday October 10, 2021 @05:10AM (#28816965)
I haven't thought of combining access tokens with biometrics, that could actually be pretty slick. I have no real exposure to WebAuthn, but yeah the more I work in the 3.0 space the more I think that NFTs are one the most misrepresented technologies I can imagine.

I'm writing an app that utilizes NFT ownership to authorize access to a service, and it's been really easy to implement, though I'm certain I'll need to continue making improvements to it. But my theory is that I can sign a message with my wallet on the frontend using NaCl, send that message and the signature to my backend and verify it, then verify token ownership using RPC. My PoC implementations have been working pretty well, but I am not sure of any holes that may exist in this approach, so it's still a work in progress.

Re:Web3 architecture and how it compares to traditional web ... by solarkraft on Sunday October 10, 2021 @04:49AM (#28816867)
I’ve used a basic version of OAuth before and found it very simple, so I’m amazed wallet authentication can even be simpler. How does the user prove they have the private key, do they make a verification transaction?

From the user’s perspective I see the (dubious) benefit of being able to use the same key for your money and online accounts, but that’s about it …

Re:Web3 architecture and how it compares to traditional web ... by shiohime on Sunday October 10, 2021 @05:24AM (#28817024)
I've been working on Solana and Ethereum dapps and it does rely on browser extensions at the moment (MetaMask or Phantom wallet for example). But basically they expose an API that lets you connect a wallet. In one app I'm working on right now in Solana, I'm able to connect in a one line api call (granted if I want to support other wallets I'll need to use an adapter npm module). Since you need to have the private key to set up a wallet, connecting is essentially "logging in". So really, I can make a website that lets you use a wallet with no money on it as authentication, if I wanted to, since it proves you are who you say you are unless your wallet's private keys are compromised.
Re:Web3 architecture and how it compares to traditional web ... by LindyTalker on Sunday October 10, 2021 @10:30AM (#28818709)
Would love to learn more about the dapps you’re building. Any site or anything I can check out?
Re:Web3 architecture and how it compares to traditional web ... by shiohime on Sunday October 10, 2021 @01:28PM (#28820220)
edit: Sorry, I think I misread your question. My current ongoing project is not yet public but will be unveiled and live in a few weeks, the others were entries into hackathons for proofs of concept, but I don't have those live. I'll leave the rest of my message (targetted for dev resources in general) below in case you or anyone else finds it helpful.

The only way I can recommend getting started is the way that I did a few months back - I strongly encourage checking out and entering random hackathons! https://gitcoin.co/hackathons

There's a lot going on in the space currently - many projects are trying to attract development talent so they will sponsor / participate in hackathons. imo they're fantastic opportunities to learn something new and potentially win some extra money.

I'd probably recommend ethereum as a first ecosystem to really dive into - the tooling is more mature than other dev-centric blockchains. However, keep in mind that ethereum as a base can be a tricky place to launch your app because of high transactional fees, and you would likely want to integrate a layer 2 like Arbitrum or support alternative coins in a final application. I'll link some pages to a few technologies I used when building some ethereum dapps

https://www.trufflesuite.com/truffle https://www.trufflesuite.com/ganache

for wallet integration, either of these work https://github.com/ChainSafe/web3.js https://github.com/ethers-io/ethers.js

I highly recommend checking out The Graph too - it allows for you to leverage graphQL on your smart contract data by creating a dedicated subgraph. With some careful integration, you can replace a dedicated backend that would normally be required for various APIs with this. It's a very exciting project imo. https://thegraph.com/en/

And of course, the solidity documentation is very helpful. Coming from a scripting heavy background, solidity was very easy for me to pick up and write a simple escrow service. https://docs.soliditylang.org/en/v0.8.9/

I'd also recommend checking out other chains once you become more comfortable with the system. I'm currently working on Solana and it's a bit more difficult to work with due to the tooling not being as mature, but it is a very interesting chain to work with and I hope that it can scale better than Ethereum has.

Re:Web3 architecture and how it compares to traditional web ... by LindyTalker on Tuesday October 12, 2021 @11:35AM (#28841030)
Thank you! Very kind of you to provide the info. Really exciting to enter the space
Re:Web3 architecture and how it compares to traditional web ... by jacoblambda on Sunday October 10, 2021 @05:18AM (#28817001)
You don't even need to make a transaction. Cryptocurrency based authentication mechanisms use the ledger as a "trust-less" root of trust. You know anything that's been on the ledger long enough is valid. From their all you need to do is authenticate with the same PKI that corresponds to said wallet.

A simplified example: You own an NFT and want to prove that you own it.

You can produce some chunk of data (not a transaction) that includes a reference to the NFT (be it the UTxO, Tx, or some hash) and sign it with the same key that owns the NFT (or a derivative key depending on the design of the system).

Since it's not a transaction it doesn't cost anything to produce and you can share it with the interested parties however you wish.

In a sense you can think of it like GPG (and GPG based SSH keys) except instead of the web of trust being a federated set of servers and key cross signing, it's a decentralised ledger.

It's not simpler but it can be easier because it largely comes out of the box set up. The PKI is already well established and you don't need to really spin up or configure anything complicated to use it. You just launch a wallet with the supported features and it "just works".