# How I can extract or generate signature?

**URL:** <https://forums.sui.io/t/how-i-can-extract-or-generate-signature/5079>\
**Category:** Technical Support\
**Tags:** sui, testnet\
**Created:** [February 10, 2023, 9:59am UTC](https://forums.sui.io/t/how-i-can-extract-or-generate-signature/5079 "2023-02-10T09:59:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![NefeluM](https://dub1.discourse-cdn.com/sui/user_avatar/forums.sui.io/nefelum/32/2801_2.png) [@NefeluM](https://forums.sui.io/u/NefeluM)\
**Post date:** [February 10, 2023, 9:59am UTC](https://forums.sui.io/t/how-i-can-extract-or-generate-signature/5079/1 "2023-02-10T09:59:05Z")

</div>

Hello, I have a seed phrase (mnemonic). How I can convert it to Signature for sui json-rpc transactions? Can I use my software (for example - python) without sui cli-client? And how I can do this? For example, sui\_executeTransactionSerializedSig need signature.

---

<div class="post-metadata">

**Author:** ![SarvariSetare](https://dub1.discourse-cdn.com/sui/user_avatar/forums.sui.io/sarvarisetare/32/8216_2.png) [@SarvariSetare](https://forums.sui.io/u/SarvariSetare)\
**Post date:** [February 22, 2023, 2:25pm UTC](https://forums.sui.io/t/how-i-can-extract-or-generate-signature/5079/2 "2023-02-22T14:25:34Z")

</div>

> [@NefeluM](#):
>
> ransactionSerializedSig need signature.

@NefeluM  
I also had a problem with access not with mnemonic. I tried to use keys from devnet to testnet and their types was different and there wasn’t instruction how to solve that. Only at the discord one of the moderators shared thу link. But I didn’t understand any word of this 🙈 🙈 🙈

> <https://github.com/MystenLabs/sui/blob/a69fd88a5842f521a603e3dd192dbf9fd0fe4fb3/sdk/typescript/src/cryptography/ed25519-keypair.ts#L125-L148>

Maybe someone help me finally

---

<div class="post-metadata">

**Author:** ![fastfrank](https://dub1.discourse-cdn.com/sui/user_avatar/forums.sui.io/fastfrank/32/1138_2.png) [@fastfrank](https://forums.sui.io/u/fastfrank)\
**Post date:** [February 24, 2023, 10:16am UTC](https://forums.sui.io/t/how-i-can-extract-or-generate-signature/5079/3 "2023-02-24T10:16:48Z")

</div>

As far as keypairs go, prior to Sui 0.21.0 the keypair encoding structurally (using ed25519 as example):

1. Keypair on disk is encoded as base64 string
2. Decoding that string to bytes resulted in a 65 byte list
3. Byte 0 contained the key scheme:  
Value of `0` indicates ed25519  
Value of `1` indicates secp256k1  
Value of `2` indicates secp256r1
4. For ed25519: The next 32 bytes were the Public key
5. For ed25519: The remaining 32 bytes were the Private key

However; in 0.21.0 it was changed where the Public key was dropped.  
Now the keystring decodes to a 33 byte list  
The first byte is still the key scheme  
The remaining 32 are the Private key

---

<div class="post-metadata">

**Author:** ![fastfrank](https://dub1.discourse-cdn.com/sui/user_avatar/forums.sui.io/fastfrank/32/1138_2.png) [@fastfrank](https://forums.sui.io/u/fastfrank)\
**Post date:** [February 24, 2023, 10:20am UTC](https://forums.sui.io/t/how-i-can-extract-or-generate-signature/5079/4 "2023-02-24T10:20:25Z")

</div>

The seed phrase (words) need to be converted to bytes representing a `seed` to your key generation.

You need to do this to get a private key and from that a public key

You also need to identify the derivation path, varies based on key type

You can generate the key pair using the sui keytool

See: `sui keytool import -h` on the command line.
