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
Copy file name to clipboardExpand all lines: .github/CONTRIBUTING.md
+9-1Lines changed: 9 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,14 @@ Thanks for your interest! Contributions are very welcome.
4
4
5
5
Below you'll find the conventions we're trying to follow. Of course, please feel free to send PRs to improve these guidelines too.
6
6
7
+
## Design Goals
8
+
9
+
This library should provide the primitives needed to hack on Bitcoin and Bitcoin-related ideas.
10
+
11
+
1.**flexible** - Consumers should be able to import only the functionality they need
12
+
2.**simple** - Functions should be simple and return one type
13
+
3.**portable** – All code should work on every platform (no Node.js bindings or separate browser versions)
14
+
7
15
## Design Guidelines
8
16
9
17
-**start small, compose** - Compose larger functions from their smallest possible components.
@@ -14,7 +22,7 @@ Below you'll find the conventions we're trying to follow. Of course, please feel
14
22
-**don't overvalue historical names** - Many Bitcoin implementations make imprecise (and even misleading) naming choices for historical reasons. We make little effort to match the type/function names of other Bitcoin implementations; names should be chosen to improve clarity.
15
23
-**don't add package dependencies** - This library should be as simple and stable as possible. Generally, if something is hard enough to warrant bringing in a dependency, it's something this library should provide. (Can you compile and expose a WASM version?)
16
24
17
-
## Some practical details
25
+
## Some Practical Details
18
26
19
27
-**accept `readonly`, return mutable** - We should always return mutable types to allow consumers the option of mutating results without running afoul of type-checking. For the same reason, when we accept a value, we should always accept it as `readonly` for maximum flexibility.
20
28
-**use `eslint-disable-next-line` or `eslint-disable-line`** - It's ok to disable eslint; in some cases, rules should be disabled every time they're hit (e.g. `no-bitwise`). By using single-line disables, we clearly mark intentional deviations from our conventions.
Copy file name to clipboardExpand all lines: README.md
+34-36Lines changed: 34 additions & 36 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,27 +5,22 @@
5
5
6
6
# Libauth
7
7
8
-
A flexible, strongly-typed, FP-inspired, highly-portable, typescript bitcoin library.
8
+
**An ultra-lightweight JavaScript library for Bitcoin, Bitcoin Cash, and Bitauth applications.**
9
9
10
-
## Work in Progress
10
+
Libauth has **no dependencies** and works in all JavaScript environments, including [Node.js](https://nodejs.org/), [Deno](https://deno.land/), and browsers.
11
11
12
-
While this library is under active development, current functionality is production-ready (WASM implementations of secp256k1, ripemd160, sha256, sha512, and sha1).
12
+
## Purpose
13
13
14
-
More functionality will be exposed and stabilized in future versions.
14
+
Libauth is designed to be **flexible**, **lightweight**, and **easily auditable**. Rather than providing a single, overarching object-oriented API, all functionality is composed from simple functions. This has several benefits:
15
15
16
-
## Design Goals
16
+
-**Flexibility** – Even highly-complex functionality is built-up from simpler functions. These lower-level functions can be used to experiment, tweak, and remix your own higher-level methods without maintaining a fork of the library.
17
+
-**Smaller application bundles** – Applications can import only the methods they need, eliminating the unused code (via [dead-code elimination](https://webpack.js.org/guides/tree-shaking/)).
18
+
-**Better auditability** – Beyond having no dependencies of its own, Libauth's [functional programming](https://en.wikipedia.org/wiki/Functional_programming) approach makes auditing critical code easier: smaller bundles, smaller functions, and less churn between versions (fewer cascading changes to object-oriented interfaces).
19
+
-**Fully-portable** – No platform-specific APIs are ever used, so the same code paths are used across all JavaScript environments (reducing the auditable "surface area" and simplifying library development).
17
20
18
-
This library should provide the primitives needed to [hack](http://www.paulgraham.com/gh.html) on Bitcoin and Bitcoin-related ideas.
21
+
## Getting Started
19
22
20
-
1.**flexible** - Consumers should be able to import only the functionality they need
21
-
2.**simple** - Functions should be simple and return one type
22
-
3.**portable** – All code should work on every platform (no Node.js bindings or separate browser versions)
23
-
24
-
Please see the [Design Guidelines](.github/CONTRIBUTING.md) for more info.
25
-
26
-
## Usage
27
-
28
-
To use, simply install `libauth`:
23
+
To get started, install `libauth`:
29
24
30
25
```sh
31
26
npm install libauth
@@ -47,37 +42,38 @@ import { msgHash, pubkey, sig } from './somewhere';
47
42
})();
48
43
```
49
44
50
-
**Note**: `libauth` uses [`BigInt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt), [`WebAssembly`](https://developer.mozilla.org/en-US/docs/WebAssembly), and es2017 features for some functionality. While support is required to use this functionality (Node.js v10 LTS or later), other parts of the library will continue to work in older environments.
51
-
52
-
To include the necessary TypeScript library files in you application, add `"lib": ["es2017", "esnext.bigint", "dom"]` to your `tsconfig.json`.
45
+
**Note**: `libauth` uses [`BigInt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt), [`WebAssembly`](https://developer.mozilla.org/en-US/docs/WebAssembly), and `es2017` features for some functionality. While support is required to use this functionality (Node.js v10 LTS or later), other parts of the library will continue to work in older environments. To include the necessary TypeScript library files in you application, add `"lib": ["es2017", "esnext.bigint", "dom"]` to your `tsconfig.json`.
53
46
54
-
## API
47
+
## Stable API
55
48
56
49
The following APIs are considered stable, and will only include breaking changes in major version upgrades.
0 commit comments