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?