Loading

Slzii.com Search

https://libauth.org

@bitauth/libauth
Documentation for @bitauth/libauth
@bitauth/libauthPreparing search index...The search index is not available@bitauth/libauth@bitauth/libauth An ultra-lightweight JavaScript library for Bitcoin Cash, Bitcoin, and Bitauth applications. Docs: Getting Started → API Reference LibauthAn 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. PurposeLibauth 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: 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. Smaller application bundles – Applications can import only the methods they need, eliminating the unused code (via dead-code elimination). Better auditability – Beyond having no dependencies of its own, Libauth's functional programming approach makes auditing critical code easier: smaller bundles, smaller functions, and less churn between versions (fewer cascading changes to object-oriented interfaces). 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). Quick StartTo get started, install @bitauth/libauth: npm install @bitauth/libauth# ORyarn add @bitauth/libauth Copy And import the functionality you need: import { secp256k1 } from '@bitauth/libauth';import { msgHash, pubkey, sig } from 'somewhere';secp256k1.verifySignatureDERLowS(sig, pubkey, msgHash) ? console.log('🚀 Signature valid') : console.log('❌ Signature invalid'); Copy See Installation for more guidance on getting set up. GuidesThese guides introduce some of the high-level concepts and functionality provided by Libauth. Installation Handling Errors Cryptography Keys Addresses Verifying Transactions Wallets & Transaction Creation More ExamplesIn 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. API OverviewBelow 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. Table of Contents Address Formats Base58 Addresses Bech32 CashAddress CashAddress-like Formats Crypto Formats Base-N Conversion Base64 Binary Strings (e.g. 00101010) Hex (Hexadecimal-Encoded Strings) Logging Numbers CompactUint (A.K.A. "VarInt" or "CompactSize") Satoshi Values VM Numbers (A.K.A. "ScriptNum") Miscellaneous Time UTF8 Keys BIP32 Hierarchical Deterministic (HD) Keys BIP39 Mnemonic Phrases Wallet Import Format (WIF) Key Utilities P2P Messages Decoding Utilities Transactions Outputs Dust Calculation Virtual Machines Built-In VMs Debugging Combinators Wallet Engine Bitcoin Cash Metadata Registries (BCMRs) CashAssembly Language & Compiler Multi-Party Compilation Wallet Templates Address FormatsBase58 Addresses encodeBase58Address/decodeBase58Address encodeBase58AddressFormat/decodeBase58AddressFormat lockingBytecodeToBase58Address/base58AddressToLockingBytecode Bech32 encodeBech32/decodeBech32 bech32PaddedToBin/binToBech32Padded regroupBits CashAddress encodeCashAddress/decodeCashAddress lockingBytecodeToCashAddress/cashAddressToLockingBytecode decodeCashAddressFormatWithoutPrefix encodeCashAddressVersionByte/decodeCashAddressVersionByte CashAddress-like Formats attemptCashAddressFormatErrorCorrection encodeCashAddressFormat/decodeCashAddressFormat encodeCashAddressNonStandard/decodeCashAddressNonStandard Crypto hash160 (sha256 -> ripemd160) hash256 (sha256 -> sha256) hmacSha256 hmacSha512 instantiateHmacFunction instantiatePbkdf2Function pbkdf2HmacSha256 pbkdf2HmacSha512 ripemd160 secp256k1 sha1 sha256 sha512 FormatsBase-N Conversion base58ToBin/binToBase58 createBaseConverter Base64 base64ToBin/binToBase64 isBase64 Binary Strings (e.g. 00101010) binStringToBin/binToBinString isBinString Hex (Hexadecimal-Encoded Strings) hexToBin/binToHex isHex swapEndianness Logging sortObjectKeys stringify stringifyTestVector Numbers 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 CompactUint (A.K.A. "VarInt" or "CompactSize") compactUintToBigInt/bigIntToCompactUint compactUintPrefixToSize readCompactUint readCompactUintMinimal Satoshi Values valueSatoshisToBin/binToValueSatoshis VM Numbers (A.K.A. "ScriptNum") vmNumberToBigInt/bigIntToVmNumber booleanToVmNumber Miscellaneous assertSuccess binsAreEqual encodeDataPush flattenBinArray range splitEvery unknownValue Time dateToLocktime/locktimeToDate dateToLocktimeBin decodeLocktime UTF8 length lossyNormalize segment utf8ToBin/binToUtf8 KeysBIP32 Hierarchical Deterministic (HD) Keys crackHdPrivateNodeFromHdPublicNodeAndChildPrivateNode decodeHdKey (decodeHdKeyUnchecked) decodeHdPrivateKey/encodeHdPrivateKey decodeHdPublicKey/encodeHdPrivateKey deriveHdPath deriveHdPathRelative deriveHdPrivateNodeFromSeed deriveHdPrivateNodeIdentifier/deriveHdPublicNodeIdentifier deriveHdPrivateNodeChild/deriveHdPublicNodeChild deriveHdPublicKey deriveHdPublicNode hdKeyVersionIsPrivateKey/hdKeyVersionIsPublicKey hdPrivateKeyToIdentifier/hdPublicKeyToIdentifier BIP39 Mnemonic Phrases deriveHdPrivateNodeFromBip39Mnemonic deriveSeedFromBip39Mnemonic encodeBip39Mnemonic/decodeBip39Mnemonic generateBip39Mnemonic Wallet Import Format (WIF) encodePrivateKeyWif/decodePrivateKeyWif Key Utilities generateDeterministicEntropy generateHdPrivateNode generatePrivateKey generateRandomBytes generateRandomSeed minimumEventsPerEntropyBits shannonEntropyPerEvent validateSecp256k1PrivateKey P2P MessagesDecoding Utilities readBytes readCompactUintPrefixedBin readRemainingBytes readUint32LE readUint64LE readMultiple readItemCount Transactions encodeTransaction/decodeTransaction (decodeTransactionUnsafe) encodeTransactionOutputs/decodeTransactionOutputs hashTransaction hashTransactionP2pOrder hashTransactionUiOrder Outputs isArbitraryDataOutput isSimpleMultisig isStandardOutputBytecode isStandardOutputBytecode2023 isStandardMultisig isWitnessProgram Dust Calculation getDustThreshold getDustThresholdForLength isDustOutput Virtual MachinesBuilt-In VMs createInstructionSetBCH createInstructionSetBCH2022 createInstructionSetBCH2023 createInstructionSetBCHCHIPs createInstructionSetXEC createVirtualMachine createVirtualMachineBCH createVirtualMachineBCH2022 createVirtualMachineBCH2023 createVirtualMachineBCHCHIPs createVirtualMachineXEC Debugging assembleBytecode assembleBytecodeBCH assembleBytecodeBTC disassembleBytecode disassembleBytecodeBCH disassembleBytecodeBTC generateBytecodeMap summarizeDebugTrace stringifyDebugTraceSummary summarizeStack Combinators combineOperations mapOverOperations pushToStack pushToStackChecked pushToStackVmNumber pushToStackVmNumberChecked useOneStackItem useTwoStackItems useThreeStackItems useFourStackItems useSixStackItems useOneVmNumber useTwoVmNumbers useThreeVmNumbers Wallet EngineBitcoin Cash Metadata Registries (BCMRs) importMetadataRegistry CashAssembly Language & Compiler allErrorsAreRecoverable cashAssemblyToBin compileScript containsRange createCompiler extractBytecodeResolutions extractEvaluationSamples extractEvaluationSamplesRecursive extractUnexecutedRanges getResolutionErrors mergeRanges parseScript resolveVariableIdentifier stringifyErrors verifyCashAssemblyEvaluationState walletTemplateToCompilerConfiguration walletTemplateToCompilerBCH Multi-Party Compilation extractMissingVariables extractResolvedVariables generateTransaction safelyExtendCompilationData P2PKH Utilities hdPrivateKeyToP2pkhLockingBytecode hdPrivateKeyToP2pkhCashAddress hdPublicKeyToP2pkhLockingBytecode hdPublicKeyToP2pkhCashAddress privateKeyToP2pkhLockingBytecode privateKeyToP2pkhCashAddress publicKeyToP2pkhLockingBytecode publicKeyToP2pkhCashAddress Wallet Templates importWalletTemplate VMB TestsLibauth'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. CashAssemblyCashAssembly is the assembly language used by Libauth's Wallet Templates. To learn more about CashAssembly, read the Bitauth IDE Guide. ContributingPull Requests welcome! Please see CONTRIBUTING.md for details. SettingsMember VisibilityProtectedPrivateInheritedExternalThemeOSLightDarkOn This PageLibauthPurposeQuick StartGuidesMore ExamplesAPI OverviewAddress FormatsBase58 AddressesBech32CashAddressCashAddress-like FormatsCryptoFormatsBase-N ConversionBase64Binary Strings (e.g. 00101010)Hex (Hexadecimal-Encoded Strings)LoggingNumbersCompactUint (A.K.A. "VarInt" or "CompactSize")Satoshi ValuesVM Numbers (A.K.A. "ScriptNum")MiscellaneousTimeUTF8KeysBIP32 Hierarchical Deterministic (HD) KeysBIP39 Mnemonic PhrasesWallet Import Format (WIF)Key UtilitiesP2P MessagesDecoding UtilitiesTransactionsOutputsDust CalculationVirtual MachinesBuilt-In VMsDebuggingCombinatorsWallet EngineBitcoin Cash Metadata Registries (BCMRs)CashAssembly Language & CompilerMulti-Party CompilationP2PKH UtilitiesWallet TemplatesVMB TestsCashAssemblyContributing@bitauth/libauthAuthenticationErrorBCH2022AuthenticationErrorBCH2023AuthenticationErrorBCHCHIPsAuthenticationErrorCommonBase58AddressErrorBase58AddressFormatVersionBaseConversionErrorBaseConverterCreationErrorBech32DecodingErrorBip39ErrorBitRegroupingErrorBuiltInVariablesCashAddressDecodingErrorCashAddressEncodingErrorCashAddressFormatCorrectionErrorCashAddressFormatEncodingErrorCashAddressNetworkPrefixCashAddressTypeCashAddressTypeBitsCashAddressVersionByteCashAddressVersionByteDecodingErrorLoading...Generated using TypeDoc
en
en
1771379521
https://libauth.org

Edit your site?

What are you doing?

0.005436897277832


Webdirectory
Webdirectory

Webdirectory
Documentation for @bitauth/libauth
Webdirectory