You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I've seen a lot of documentation, I think it's very good but unfortunately I still can't sign a transaction. I've come here in the hope that someone will be able to help me. I'll try to describe my problem as fully as possible.
my userseed looks like this : "pirate bateau chimie .... "
my seed looks like this : "0000FD163D0CAD7CF62A6239A037EDABC27AD8467AD2898F899A88C7F9B52D771792"
I know that this code is not at all correct, and that I don't understand all these different keys, if anyone can help me.
Hello.
The ownership's mechanism is a way to delegate secrets to set of authorized public keys.
The secret is encrypted with a AES key, which is encrypted for a set of public keys.
Here some remark about this on your code
constauthorizedKeys=[{publicKey: seed,// It should be the authorized public key and not the seedencryptedSecretKey: Crypto.ecEncrypt(secretKey,seed),// The second parameter of the function should be the authorized public key},];
You can also note that: const secretKey = Crypto.deriveAddress(userSeed, 0) this is not really secure, because the key can be disclosed if the address is known. You should rely on randomSecret generation.
But I don't see the contract's interaction you mentioned in your title ?
@bchamagne I'll probably take the first option and wait, because I think I'm having trouble understanding the path from the secret key to the signing of the transaction.
@samuelmanzanera I'm trying to interact with the dex , with the aeETH/UCO pool , to create a swap
I'd suggest to test on the testnet first ;)
To interact with the dex you don't need ownership, but you need to transfer funds AND call the named action. If you don't call the contract, you'll just transfer funds and loose them.
Activity
bchamagne commentedon Jun 12, 2024
Hello, I see a few mixups here and there!
Fortunately @Rudy-Perrin made a recent pull request to simplify the ownerships.
You can see the code to do what you try to do (I think) here: https://github.com/archethic-foundation/libjs/pull/196/files#diff-cc63f119b1879db255abe3dbb493232f19c026790a1514a05a135ef618fdaa23R718
The function will ship in next version of libjs which is imminent I believe.
Your best course of action is either:
samuelmanzanera commentedon Jun 12, 2024
Hello.
The ownership's mechanism is a way to delegate secrets to set of authorized public keys.
The secret is encrypted with a AES key, which is encrypted for a set of public keys.
Here some remark about this on your code
You can also note that:
const secretKey = Crypto.deriveAddress(userSeed, 0)this is not really secure, because the key can be disclosed if the address is known. You should rely on randomSecret generation.But I don't see the contract's interaction you mentioned in your title ?
GuillaumeFerreira commentedon Jun 12, 2024
Thank you both for your replies.
@bchamagne I'll probably take the first option and wait, because I think I'm having trouble understanding the path from the secret key to the signing of the transaction.
@samuelmanzanera I'm trying to interact with the dex , with the aeETH/UCO pool , to create a swap
to interact with the dex contract, is this the right way to do it? to send UCOs and receive aeETHs?
bchamagne commentedon Jun 14, 2024
I'd suggest to test on the testnet first ;)
To interact with the dex you don't need ownership, but you need to transfer funds AND call the named action. If you don't call the contract, you'll just transfer funds and loose them.