Skip to content

Commit 0096e68

Browse files
eric-stacksgitbook-bot
authored andcommitted
GITBOOK-35: update Turnkey guide again
1 parent 418104f commit 0096e68

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

docs/build/more-guides/signing-with-turnkey.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,19 @@ Currently, Turnkey does not natively support Stacks, but can be simply integrate
1414

1515
Turnkey supports Stacks address derivation with `ADDRESS_FORMAT_COMPRESSED` and `ADDRESS_FORMAT_UNCOMPRESSED` address formats. Stacks addresses are derived from the secp256k1 curve, which Turnkey fully supports.
1616

17+
{% hint style="info" %}
18+
Use a secp256k1 generated public key to derive Stacks addresses and sign Stacks transactions. In most cases with Turnkey, using an Ethereum account's public key would satisfy this.
19+
{% endhint %}
20+
21+
```typescript
22+
import { publicKeyToAddress } from "@stacks/transactions"
23+
24+
const stxAddress = publicKeyToAddress(matchingAccount?.publicKey!)
25+
26+
// STX address: SP1Z6MYME47PW04D1J15K368XZE02VWQ2A5SRC4HV
27+
// publicKey: 03169b8f8bbad2cc6435893c5f255cd5201d272befa8556c82136bf9b36aa0d778
28+
```
29+
1730
### Transaction construction and signing
1831

1932
A sample script that demonstrates how to sign a Stacks transaction with Turnkey. Stacks uses the secp256k1 cryptographic curve for transaction signing, but there some specific data formatting that takes place for the signing process.

0 commit comments

Comments
 (0)