Skip to content

Derive Creator Pubkey #105

Open
Open
@leowvazd

Description

@leowvazd

Hey guys,

At the level of curiosity and to share knowledge, with the new versions of the code, I understood that to derive creator vault we need the creator. This creator is retrieved from a data_log of an already confirmed creation that we got on chain.

But is there a way to derive this creator in the same way we derive creator vault in the code? Is this creator derived, for example, from user?

(I think there is some relationship, because in the user wallet below there are several attempts that generate the same creator from the same user)

Here's an example of mine:

I know that from SolScan:

user = "28RyKqczfJPkHDtb33ScWE3SPedcJAYmoJFfFKqvdGV6"

we got:

creator = 3xkwSoSfvBt6hqcW6eyEpxe3PaJw2bMxYFEugQp4LJQ2

and its expected (and correct!) derivation:

creator_vault = 2t7V4u1ik4C4xmUMqasNca8U2kBkGwAHUe4WGddAJWXD

I tried somethings like:

from solders.pubkey import Pubkey
user = Pubkey.from_string("28RyKqczfJPkHDtb33ScWE3SPedcJAYmoJFfFKqvdGV6")
PUMP_PROGRAM = Pubkey.from_string("6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P")
expected_creator = "3xkwSoSfvBt6hqcW6eyEpxe3PaJw2bMxYFEugQp4LJQ2"
test_seeds = [
    [b"creator", bytes(user)],
    [b"user-creator", bytes(user)], 
    [b"token-creator", bytes(user)],
    [b"pump-creator", bytes(user)],
    [b"creator-account", bytes(user)],
    [b"user", bytes(user)],
    [b"authority", bytes(user)],
    [b"signer", bytes(user)],
    [bytes(user), b"creator"],
    [bytes(user), b"user"],
    [b"creator_account", bytes(user)],
    [b"user_creator", bytes(user)],
    [b"pump_creator", bytes(user)],
]

for i, seeds in enumerate(test_seeds):
    try:
        creator, bump = Pubkey.find_program_address(seeds, PUMP_PROGRAM)
        print(f"Padrão {i+1}: {creator}")
        if str(creator) == expected_creator:
            print(f"FOUND! Seeds: {seeds}")
            break
    except Exception as e:
        print(f"Padrão {i+1}: Error - {e}")

But I still can't how we get the creator derivation right.

Thanks!

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions