2

I can get account information by passing address in api.query.system.account in Polkadot.js/api.

However, if I pass empty address(''), then I can get still response.

For example free balance data in response shows 42400000000.

I want to know whose account data response is.

2
  • 4
    I assume that you are getting this response when querying a Kusama node. If you do the same query to a Polkadot node, it should report an empty account. My best guess for the existence of this balance under the empty address is that someone sent those funds to this address in the past as a test or by mistake. Now this funds are locked/burnt forever since this empty address is not accessible by a private key or any other origin. You can actually see the same situation on Westend testnet, where the empty address has free: 3,064,499,998,607.
    – Iker
    May 24, 2022 at 15:07
  • what if i want to pass an empty option into api.query.system.account(), which then produces an array of all addresses rather than info on just one? substrate.stackexchange.com/questions/6377/… Dec 16, 2022 at 11:47

1 Answer 1

5

@Iker has the right answer above (as a comment). So I wrote this small script to check on some chains -

import { ApiPromise, WsProvider } from "@polkadot/api"

const HOSTS = [
    "wss://rpc.polkadot.io",
    "wss://kusama-rpc.polkadot.io",
    "wss://rococo-rpc.polkadot.io",
    "wss://westend-rpc.polkadot.io"
]
const EMPTY = new Uint8Array(32)

async function main () {
    for (let i = 0; i < HOSTS.length; i++) {
        const host = HOSTS[i]
        const provider = new WsProvider(host)
        const api = await ApiPromise.create({ provider })
        const val = await api.query.system.account(EMPTY)

        console.log(
            host,
            api.createType("AccountId", EMPTY).toString(),
            JSON.stringify(val.toHuman(), null, 2)
        )

        provider.disconnect()
    }
}

main().catch(console.error)

On the list of hosts, I found 2 non-empty: Kusama & Westend. Since I logged the actual empty accountId, I also checked this against Subscan for the transfers -

  • Westend 62 transfers into this address
  • Kusama 4 transfers into this address
1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.