• © Goverland Inc. 2026
  • v1.0.8
  • Privacy Policy
  • Terms of Use
DecentralandDecentralandby0xBB7B59Afa3A0E5Be143b8fE9C641F00c1ecB9d690xBB7B…9d69

Polkadot.js login

Voting ended about 2 years agoSucceeded

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?

This proposal is summarized due to technical limitations. To view it complete and vote on it, visit the DCL DAO Governance dApp

Off-Chain Vote

yes
812.58K VP11.6%
no
3.19M VP45.5%
abstain
3.01M VP42.9%
Download mobile app to vote

Timeline

Feb 01, 2024Proposal created
Feb 01, 2024Proposal vote started
Feb 11, 2024Proposal vote ended
Feb 13, 2024Proposal updated