Gathering detailed insights and metrics for @bitauth/libauth
Gathering detailed insights and metrics for @bitauth/libauth
Gathering detailed insights and metrics for @bitauth/libauth
Gathering detailed insights and metrics for @bitauth/libauth
npm install @bitauth/libauth
Typescript
Module System
Min. Node Version
Node Version
NPM Version
TypeScript (82.21%)
JavaScript (17.4%)
Rust (0.25%)
Dockerfile (0.14%)
Total Downloads
4,471,943
Last Day
1,022
Last Week
38,305
Last Month
188,581
Last Year
2,756,375
277 Stars
323 Commits
52 Forks
12 Watching
11 Branches
12 Contributors
Latest Version
3.0.0
Package Id
@bitauth/libauth@3.0.0
Unpacked Size
4.22 MB
Size
0.98 MB
File Count
340
NPM Version
10.5.0
Node Version
20.12.1
Publised On
10 Apr 2024
Cumulative downloads
Total Downloads
Last day
-22.9%
1,022
Compared to previous day
Last week
-6.3%
38,305
Compared to previous week
Last month
-24.1%
188,581
Compared to previous month
Last year
141.8%
2,756,375
Compared to previous year
45
An ultra-lightweight JavaScript library for Bitcoin Cash, Bitcoin, and Bitauth applications.
An ultra-lightweight JavaScript library for Bitcoin Cash, Bitcoin, and Bitauth applications.
Libauth has no dependencies and works in all JavaScript environments, including Node.js, Deno, and browsers.
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:
To get started, install @bitauth/libauth
:
1npm install @bitauth/libauth 2# OR 3yarn add @bitauth/libauth
And import the functionality you need:
1import { secp256k1 } from '@bitauth/libauth'; 2import { msgHash, pubkey, sig } from 'somewhere'; 3 4secp256k1.verifySignatureDERLowS(sig, pubkey, msgHash) 5 ? console.log('🚀 Signature valid') 6 : console.log('❌ Signature invalid');
See Installation for more guidance on getting set up.
These guides introduce some of the high-level concepts and functionality provided by Libauth.
In addition to the usage examples in these guides, note that Libauth includes comprehensive tests that can help demonstrate usage of all functionality.
For example, utilities related to hexadecimal-encoded strings are defined in hex.ts
; for thorough usage examples, see the co-located hex.spec.ts
. You can also use GitHub search to see how a particular utility is used throughout the library, e.g. splitEvery
.
Below is a partial selection of functionality provided by Libauth. If you're looking for something else, be sure to search the API Reference.
High-level utilities are composed from lower-level utilities which are also exported, so it's often possible to remix behavior in your own codebase with relatively little duplication or maintenance burden. See the Defined in ...
link on each utility's API reference page to review and copy the implementation.
encodeBase58Address
/decodeBase58Address
encodeBase58AddressFormat
/decodeBase58AddressFormat
lockingBytecodeToBase58Address
/base58AddressToLockingBytecode
encodeCashAddress
/decodeCashAddress
lockingBytecodeToCashAddress
/cashAddressToLockingBytecode
decodeCashAddressFormatWithoutPrefix
encodeCashAddressVersionByte
/decodeCashAddressVersionByte
attemptCashAddressFormatErrorCorrection
encodeCashAddressFormat
/decodeCashAddressFormat
encodeCashAddressNonStandard
/decodeCashAddressNonStandard
hash160
(sha256
-> ripemd160
)hash256
(sha256
-> sha256
)hmacSha256
hmacSha512
instantiateHmacFunction
instantiatePbkdf2Function
pbkdf2HmacSha256
pbkdf2HmacSha512
ripemd160
secp256k1
sha1
sha256
sha512
00101010
)bigIntToBinUint256BEClamped
/binToBigIntUint256BE
bigIntToBinUint64LE
(bigIntToBinUint64LEClamped
)/binToBigIntUint64LE
bigIntToBinUintLE
/binToBigIntUintLE
binToBigIntUintBE
/bigIntToBinUintBE
int32SignedToUnsigned
/int32UnsignedToSigned
numberToBinInt16LE
/binToNumberInt16LE
numberToBinInt32LE
/binToNumberInt32LE
numberToBinInt32TwosCompliment
numberToBinUintLE
/binToNumberUintLE
numberToBinUint16BE
numberToBinUint16LE
(numberToBinUint16LEClamped
)/binToNumberUint16LE
numberToBinUint32BE
numberToBinUint32LE
(numberToBinUint32LEClamped
)/binToNumberUint32LE
compactUintToBigInt
/bigIntToCompactUint
compactUintPrefixToSize
readCompactUint
readCompactUintMinimal
crackHdPrivateNodeFromHdPublicNodeAndChildPrivateNode
decodeHdKey
(decodeHdKeyUnchecked
)decodeHdPrivateKey
/encodeHdPrivateKey
decodeHdPublicKey
/encodeHdPrivateKey
deriveHdPath
deriveHdPathRelative
deriveHdPrivateNodeFromSeed
deriveHdPrivateNodeIdentifier
/deriveHdPublicNodeIdentifier
deriveHdPrivateNodeChild
/deriveHdPublicNodeChild
deriveHdPublicKey
deriveHdPublicNode
hdKeyVersionIsPrivateKey
/hdKeyVersionIsPublicKey
hdPrivateKeyToIdentifier
/hdPublicKeyToIdentifier
deriveHdPrivateNodeFromBip39Mnemonic
deriveSeedFromBip39Mnemonic
encodeBip39Mnemonic
/decodeBip39Mnemonic
generateBip39Mnemonic
generateDeterministicEntropy
generateHdPrivateNode
generatePrivateKey
generateRandomBytes
generateRandomSeed
minimumEventsPerEntropyBits
shannonEntropyPerEvent
validateSecp256k1PrivateKey
readBytes
readCompactUintPrefixedBin
readRemainingBytes
readUint32LE
readUint64LE
readMultiple
readItemCount
encodeTransaction
/decodeTransaction
(decodeTransactionUnsafe
)encodeTransactionOutputs
/decodeTransactionOutputs
hashTransaction
hashTransactionP2pOrder
hashTransactionUiOrder
isArbitraryDataOutput
isSimpleMultisig
isStandardOutputBytecode
isStandardOutputBytecode2023
isStandardMultisig
isWitnessProgram
createInstructionSetBCH
createInstructionSetBCH2022
createInstructionSetBCH2023
createInstructionSetBCHCHIPs
createInstructionSetXEC
createVirtualMachine
createVirtualMachineBCH
createVirtualMachineBCH2022
createVirtualMachineBCH2023
createVirtualMachineBCHCHIPs
createVirtualMachineXEC
assembleBytecode
assembleBytecodeBCH
assembleBytecodeBTC
disassembleBytecode
disassembleBytecodeBCH
disassembleBytecodeBTC
generateBytecodeMap
summarizeDebugTrace
stringifyDebugTraceSummary
summarizeStack
combineOperations
mapOverOperations
pushToStack
pushToStackChecked
pushToStackVmNumber
pushToStackVmNumberChecked
useOneStackItem
useTwoStackItems
useThreeStackItems
useFourStackItems
useSixStackItems
useOneVmNumber
useTwoVmNumbers
useThreeVmNumbers
allErrorsAreRecoverable
cashAssemblyToBin
compileScript
containsRange
createCompiler
extractBytecodeResolutions
extractEvaluationSamples
extractEvaluationSamplesRecursive
extractUnexecutedRanges
getResolutionErrors
mergeRanges
parseScript
resolveVariableIdentifier
stringifyErrors
verifyCashAssemblyEvaluationState
walletTemplateToCompilerConfiguration
walletTemplateToCompilerBCH
hdPrivateKeyToP2pkhLockingBytecode
hdPrivateKeyToP2pkhCashAddress
hdPublicKeyToP2pkhLockingBytecode
hdPublicKeyToP2pkhCashAddress
privateKeyToP2pkhLockingBytecode
privateKeyToP2pkhCashAddress
publicKeyToP2pkhLockingBytecode
publicKeyToP2pkhCashAddress
Libauth's test suite includes a set of cross-implementation Virtual Machine Bytecode (VMB) test vectors for each supported VM. See Libauth VMB Tests
for details.
CashAssembly is the assembly language used by Libauth's Wallet Templates. To learn more about CashAssembly, read the Bitauth IDE Guide.
Pull Requests welcome! Please see CONTRIBUTING.md
for details.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
security policy file detected
Details
Reason
license file detected
Details
Reason
project is fuzzed
Details
Reason
binaries present in source code
Details
Reason
SAST tool is not run on all commits -- score normalized to 5
Details
Reason
dependency not pinned by hash detected -- score normalized to 3
Details
Reason
1 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 1
Reason
Found 3/22 approved changesets -- score normalized to 1
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
branch protection not enabled on development/release branches
Details
Reason
24 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-12-16
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More