Skip to content

Commit

Permalink
wip - using ECDSA tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
BraydenLangley committed Mar 1, 2024
1 parent cde156e commit 6d17bf3
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions docs/low-level/USING_ECDSA.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Low-level: Making Use of ECDSA with Public and Private Keys

In this tutorial, we will learn how to use ECDSA with asymmetric public and private key pairs. Note, this is a low-level tutorial and should only be used if you would like to add advanced features to your applications.

## Getting Started

First, you will want to make sure you have installed the required dependencies.

```ts
import { PrivateKey, Utils } from '@bsv/sdk'
```

```ts
const privateKey = PrivateKey.fromRandom()
const message = Utils.toArray('Message to sign!')
const signature = privateKey.sign(message)
const valid = privateKey.verify(message, signature)
// console.log(valid) --> true
```

0 comments on commit 6d17bf3

Please sign in to comment.