[DAO:1e14000] Polkadot.js login

by 0xb2223f4038def8a62a86e3c4b108cdfe00a74c4f (chillin#4c4f)

Should the problem/opportunity outlined be refined and taken to the next level?

Problem Statement

Polkadot users don’t generally want to login with Ethereum…
If we allow them to login with Polkadot then we can expect a greater involvement from their community.

Proposed Solution

import { ApiPromise, WsProvider } from '@polkadot/api';
import { web3FromSource } from '@polkadot/extension-dapp';

try {
    const wsProvider = new WsProvider(networks[network].wsEndpoint);
    const api = await ApiPromise.create({ provider: wsProvider });
    const injector = await web3FromSource('polkadot-js');
    api.setSigner(injector.signer);

    const nonce = await api.rpc.system.accountNextIndex(address);
    console.log('Nonce:', nonce.toNumber());

    // Ensure that 'transfer' is a valid method from the Polkadot API
    const payload = api.createType('ExtrinsicPayload', {
        method: transfer.toHex(), // Make sure this is correct
        nonce: nonce.toHex(),
        specVersion: api.runtimeVersion.specVersion,
        genesisHash: api.genesisHash,
        blockHash: api.genesisHash
    }, { version: 4 });

    if (injector && injector.signer) {
        const { signature } = await injector.signer.signRaw({
            address,
            data: u8aToHex(payload.toU8a(true)),
            type: 'bytes'
        });

        console.log('Transaction signed:', signature);
setUserData({ DOTid: address });

    } else {
        throw new Error('Signer not found');
    }
} catch (error) {
    console.error('An error occurred:', error);
}

Target Audience/Customer Base

Polkadot has one of the largest developer communities.
Over 50 individual blockchain networks running under the Polkadot umbrella.
Also has millions of users with $B’s of locked value…

Why is this relevant now?

I’ve been waiting for this for a while…
If we accept google sign in then why not polkadot?

Vote on this proposal on the Decentraland DAO

View this proposal on Snapshot

Hi! I quickly searched Polkadot’s DAO to see if anyone has ever expressed concern or scrutiny of not being able to login into Decentraland with a polkadot related wallet. I do not see any forums discussing this limitation. Do we know how many polkadot wallet users feel impacted by this limitation?

DAO: OpenGov | Polkassembly

However, I am down for more people to be able to log into Decentraland. I am voting Yes to push it forward and then discuss if it makes sense. But I’d recommend having some poll with the Polkadot community.

I’ve been speaking with 100s of polkadot people personally…
Here was a recent interaction:

If you’re a non-EVM polkadot project then you don’t have any business with ethereum… So it makes no sense to log in with metamask or google…
On top of that you can’t do transactions with polkadot in-game (you kinda can now thanks to me)…
For example… You could do an OpenGov competitor platform in decentraland… (something I could do with my infrastructure)
But if you can’t login AND you can’t sign transactions in-game then it’s too many barriers to entry…

If you could just login with polkadot and could sign transactions in-game… Then it gives developers more flexibility…

Care to chime in on your abstains? (which basically results in a no…)
@LandlordDao @OGContraBand @potradamus

I don’t think I voted on this did I? I just didn’t have a strong opinion one way or another on this. Most people in crypto have an eth wallet and I didn’t know how much development effort it would be required

why abstains is a NO? lol

my bad… i thought you was weedmaps :laughing:

Polkadot.js login

This proposal is now in status: REJECTED.

Voting Results:

  • Yes 11% 812,574 VP (18 votes)
  • No 47% 3,193,623 VP (7 votes)
  • Abstain 42% 3,008,497 VP (26 votes)