[Python] How do I create a custom mathematical expression formula that describes an ethereum...

Discussão em 'Python' iniciado por Stack, Outubro 3, 2024.

  1. Stack

    Stack Membro Participativo

    I'm coding in python and I'm trying to create my own custom mathematical formula expression that will describe how a private key turns into an address. I know that this isn't commonly done but I'm trying to use this so I can set up my own cryptocurrency app that let's me perform tasks that I will use for this.

    By mathematical expression I mean something that is like y = (ax + b) but it will turn a private key into an address using the formula.

    The code I'm using so far is posted below.

    @combomethod
    def from_key2(self, private_key: PrivateKeyType) -> LocalAccount:
    #Put formula in integer3 to calculate address then put formula outside parenthesis


    integer2 = LocalAccount(keys.PrivateKey(private_key.to_bytes(32, 'big')), self).address
    integer3 = 'formula here from variable integer2'

    return integer3


    This is a copy of the from_key from Account.from_key() in eth_account. It turns a private key integer into an address. I want to use that formula to create my own mathematical expression in integer3 that will let me do the same thing but except I can use a mathematical expression to do it for my cryptocurrency platform.

    Continue reading...

Compartilhe esta Página