diff --git a/.env b/.env new file mode 100644 index 00000000..2f4f9db5 --- /dev/null +++ b/.env @@ -0,0 +1,9 @@ +# network + +BITCOIN_NETWORK_TESTNET= true + +# coinjoin fee + +# 0.04...0.5 +CJ_FEE= +CJ_CONTRACT= diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index cbebcc67..bbcbbe7d 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -1,5 +1,5 @@ --- -name: PR +name: Feature request about: Suggest an idea for this project title: '' labels: '' diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..f4a79c76 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,11 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: "nodejs" # See documentation for possible values + directory: "/firebolt/app" # Location of package manifests + schedule: + interval: "weekly" diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 00000000..d513e761 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,82 @@ +# For most projects, this workflow file will not need changing; you simply need +# to commit it to your repository. +# +# You may wish to alter this file to override the set of languages analyzed, +# or to provide custom queries or build logic. +# +# ******** NOTE ******** +# We have attempted to detect the languages in your repository. Please check +# the `language` matrix defined below to confirm you have the correct set of +# supported CodeQL languages. +# +name: "CodeQL" + +on: + push: + branches: [ "main" ] + pull_request: + # The branches below must be a subset of the branches above + branches: [ "main" ] + schedule: + - cron: '38 5 * * 4' + +jobs: + analyze: + name: Analyze + # Runner size impacts CodeQL analysis time. To learn more, please see: + # - https://gh.io/recommended-hardware-resources-for-running-codeql + # - https://gh.io/supported-runners-and-hardware-resources + # - https://gh.io/using-larger-runners + # Consider using larger runners for possible analysis time improvements. + runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }} + timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }} + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: [ 'java-kotlin', 'javascript-typescript', 'swift' ] + # CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ] + # Use only 'java-kotlin' to analyze code written in Java, Kotlin or both + # Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both + # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + + # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs + # queries: security-extended,security-and-quality + + + # Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v2 + + # ℹ️ Command-line programs to run using the OS shell. + # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun + + # If the Autobuild fails above, remove it and uncomment the following three lines. + # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. + + # - run: | + # echo "Run, Build Application using script" + # ./location_of_script_within_repo/buildscript.sh + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 + with: + category: "/language:${{matrix.language}}" diff --git a/.github/workflows/devskim.yml b/.github/workflows/devskim.yml new file mode 100644 index 00000000..60bf5722 --- /dev/null +++ b/.github/workflows/devskim.yml @@ -0,0 +1,34 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +name: DevSkim + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + schedule: + - cron: '21 21 * * 6' + +jobs: + lint: + name: DevSkim + runs-on: ubuntu-20.04 + permissions: + actions: read + contents: read + security-events: write + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Run DevSkim scanner + uses: microsoft/DevSkim-Action@v1 + + - name: Upload DevSkim scan results to GitHub Security tab + uses: github/codeql-action/upload-sarif@v2 + with: + sarif_file: devskim-results.sarif diff --git a/.github/workflows/nextjs.yml b/.github/workflows/nextjs.yml new file mode 100644 index 00000000..26446cd6 --- /dev/null +++ b/.github/workflows/nextjs.yml @@ -0,0 +1,95 @@ +# Sample workflow for building and deploying a Next.js site to GitHub Pages +# +# To get started with Next.js see: https://nextjs.org/docs/getting-started +# +name: Deploy Next.js site to Pages + +on: + # Runs on pushes targeting the default branch + push: + branches: ["main"] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + # Build job + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Detect package manager + id: detect-package-manager + run: | + if [ -f "${{ github.workspace }}/yarn.lock" ]; then + echo "manager=yarn" >> $GITHUB_OUTPUT + echo "command=install" >> $GITHUB_OUTPUT + echo "runner=yarn" >> $GITHUB_OUTPUT + exit 0 + elif [ -f "${{ github.workspace }}/package.json" ]; then + echo "manager=npm" >> $GITHUB_OUTPUT + echo "command=ci" >> $GITHUB_OUTPUT + echo "runner=npx --no-install" >> $GITHUB_OUTPUT + exit 0 + else + echo "Unable to determine package manager" + exit 1 + fi + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: "20" + cache: ${{ steps.detect-package-manager.outputs.manager }} + - name: Setup Pages + uses: actions/configure-pages@v4 + with: + # Automatically inject basePath in your Next.js configuration file and disable + # server side image optimization (https://nextjs.org/docs/api-reference/next/image#unoptimized). + # + # You may remove this line if you want to manage the configuration yourself. + static_site_generator: next + - name: Restore cache + uses: actions/cache@v3 + with: + path: | + .next/cache + # Generate a new cache whenever packages or source files change. + key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }} + # If source files changed but packages didn't, rebuild from a prior cache. + restore-keys: | + ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}- + - name: Install dependencies + run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }} + - name: Build with Next.js + run: ${{ steps.detect-package-manager.outputs.runner }} next build + - name: Static HTML export with Next.js + run: ${{ steps.detect-package-manager.outputs.runner }} next export + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: ./out + + # Deployment job + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml new file mode 100644 index 00000000..6ee98fb7 --- /dev/null +++ b/.github/workflows/static.yml @@ -0,0 +1,43 @@ +# Simple workflow for deploying static content to GitHub Pages +name: Deploy static content to Pages + +on: + # Runs on pushes targeting the default branch + push: + branches: ["main"] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + # Single deploy job since we're just deploying + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Setup Pages + uses: actions/configure-pages@v3 + - name: Upload artifact + uses: actions/upload-pages-artifact@v2 + with: + # Upload entire repository + path: '.' + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v2 diff --git a/.gitignore b/.gitignore index b5c11ffa..555e3d89 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ Package.json -Package-lock.json diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..afea1a7f --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,7 @@ +## Firebolt Wallet releases and development + +See last development around Firebolt wallet + +## Releases + +TBD diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ad8c70bd..eb1b6278 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -3,5 +3,5 @@ - If you is having issues with app open "Issues" here on the Github - If you have some idea in add new feature make PR - We not will accept integration with altcoins from Taproot Assets or RGB, any PR will be closed and declined -- We not will support layer or sidechains via PR +- We not will support layer or sidechains (Liquid, RSK) via PR - We not will support Fedimint integration via PR diff --git a/Cargo.toml b/Cargo.toml index 6f66a188..fd8f723f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ name = "payjoin" -version = "0.10.0" +version = "0.13.0" license = "MIT OR Apache-2.0" edition = "2023" diff --git a/LICENSE b/LICENSE index cb8ef4ff..2e688bff 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2023 Area Layer⚡️ +Copyright (c) 2024 Area Layer⚡️ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/LICENSE-APACHE b/LICENSE-APACHE deleted file mode 100644 index b376a107..00000000 --- a/LICENSE-APACHE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2023 Area Layer - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/MAINTAINERS.md b/MAINTAINERS.md new file mode 100644 index 00000000..5335ce68 --- /dev/null +++ b/MAINTAINERS.md @@ -0,0 +1,10 @@ +# Core Maintainers + +## 22388o + +- Github: @22388o + +## Rsync25 + +- Github: @Rsync25 +- Twitter: @Rsync25 diff --git a/MANIFEST.yml b/MANIFEST.yml new file mode 100644 index 00000000..4f6aabe4 --- /dev/null +++ b/MANIFEST.yml @@ -0,0 +1,8 @@ +Name: Firebolt +Type: Cryptography, Lightning +Kind: FOSS +Version: Beta-v1.0.0.rc6 +License: MIT License +Language: Javascript, Klotin, Rust and Swift +Author: 22388o and Rsync25 +Maintained: Area Layer diff --git a/README.md b/README.md index fb909b82..db4f0350 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,9 @@ # FireBolt ⚡ +[![Bitcoin-only](https://img.shields.io/badge/bitcoin-only-FF9900?logo=bitcoin)](https://twentyone.world) +[![LN](https://img.shields.io/badge/lightning-792EE5?logo=lightning)](https://mempool.space/lightning) + App wallet for Android, iOs and PWA with Nostr, HyperCore, Nostr, Lightning Network, TBD, CoinJoin and PayJoin

@@ -9,14 +12,20 @@ App wallet for Android, iOs and PWA with Nostr, HyperCore, Nostr, Lightning Netw

-

FireBolt

+

FireBolt⚡

--- -**⚠️ Alpha software may put your money at risk.** +**⚠️ Beta software may put your money at risk** + +**⚠️This wallet is WIP** + +**⚠️ We recommend using only small amounts** + +**⚠️ No use this BIP-39 in others wallets** -**⚠️ We recommend using only small amounts.** +**⚠️ Use small amounts for test Coinjoin** - **Android - Download latest APK (Soon)** @@ -27,7 +36,7 @@ App wallet for Android, iOs and PWA with Nostr, HyperCore, Nostr, Lightning Netw --- ## Overview -Save your self sovereign +Cypherpunk App Firebolt is a wallet designed by a Bitcoiner for Bitcoiners looking for privacy using Payjoin, Lightning Network, Coinjoin, Bitcoin, Hypercore, Nostr and TBD @@ -49,11 +58,15 @@ The other main features Firebolt supports are as follows: 🪙 Payments via Lightning Network +⚡Non custodial via on-chain and Lightning Network + ⚛️ Coinjoin and Payjoin for privacy +🫂Buy Bitcoin via P2P apps (PeachBitcoin, Bisq, RobotSats) + ## Feature -- Lightning Network (LND/LDK/CLN/Greenlight) +- Lightning Network (LND/LDK/CLN) - Nostr @@ -77,8 +90,13 @@ The other main features Firebolt supports are as follows: - Management Nostr Keys +- Miniscript + - Contact list via Nostr (NPub) and DID (Web5) +- Buy Bitcoin via P2P apps (PeachBitcoin, Bisq, RobotSats) + + ## Roadmap - [ ] Mainnet @@ -91,7 +109,6 @@ The other main features Firebolt supports are as follows: - [x] LDK integration -- [x] GreenLight integration - [X] LND integration @@ -129,15 +146,49 @@ The other main features Firebolt supports are as follows: - [X] Taproot Channels (WIP) -- [ ] Finish modules iOs, Androind and PWA with React +- [x] Finish modules iOs, Androind and PWA with React (WIP) + +- [x] Beta app (iOs, PWA and Android) [WIP] + +- [x] PWA (WIP) + +- [ ] RBF + +- [x] Buy Bitcoin via P2P apps (PeachBitcoin, Bisq, RobotSats) with links to the apps -- [ ] Beta app (iOs, PWA and Android) +- [ ] Submarine Swap + +- [ ] Backup for TBD keys + +- [ ] Neutrino + +- [ ] Hardwallets (Trezor, Bitbox, Ledger) + +- [ ] Paynym + +- [ ] WASM + +- [ ] Complete PRs + +- [ ] Release Beta wallet in 2024 + +- [ ] Compile code + +- [ ] Fix Web5, Nostr, Lightning and Bitcoin cross libraries -- [ ] PWA ## Run App Docs (soon) + ## Contribution [Check the details here](https://github.com/AreaLayer/FireBolt/blob/main/CONTRIBUTING.md) + + +## Contributors + + + + + diff --git a/SECURITY.md b/SECURITY.md index c4d0ce53..c1a862df 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -8,7 +8,7 @@ currently being supported with security updates. | Version | Supported | | ------- | ------------------ | | alpha-v1.0.10 | :white_check_mark: | -| beta-v1.0.0 | +| beta-v1.0.0 | ❎ ## Reporting a Vulnerability diff --git a/android/app/src/main/klotin/com/example/bit_nostr_hypercore_wallet/bitcoin.kt b/android/app/src/main/klotin/com/example/bit_nostr_hypercore_wallet/bitcoin.kt new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/android/app/src/main/klotin/com/example/bit_nostr_hypercore_wallet/bitcoin.kt @@ -0,0 +1 @@ + diff --git a/android/app/src/main/klotin/com/example/bit_nostr_hypercore_wallet/coinjoin.kt b/android/app/src/main/klotin/com/example/bit_nostr_hypercore_wallet/coinjoin.kt new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/android/app/src/main/klotin/com/example/bit_nostr_hypercore_wallet/coinjoin.kt @@ -0,0 +1 @@ + diff --git a/android/app/src/main/klotin/com/example/bit_nostr_hypercore_wallet/hypercore.kt b/android/app/src/main/klotin/com/example/bit_nostr_hypercore_wallet/hypercore.kt new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/android/app/src/main/klotin/com/example/bit_nostr_hypercore_wallet/hypercore.kt @@ -0,0 +1 @@ + diff --git a/android/app/src/main/klotin/com/example/bit_nostr_hypercore_wallet/nostr.kt b/android/app/src/main/klotin/com/example/bit_nostr_hypercore_wallet/nostr.kt new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/android/app/src/main/klotin/com/example/bit_nostr_hypercore_wallet/nostr.kt @@ -0,0 +1 @@ + diff --git a/android/app/src/main/klotin/com/example/bit_nostr_hypercore_wallet/web5.kt b/android/app/src/main/klotin/com/example/bit_nostr_hypercore_wallet/web5.kt new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/android/app/src/main/klotin/com/example/bit_nostr_hypercore_wallet/web5.kt @@ -0,0 +1 @@ + diff --git a/app/bitcoin/send_receive.js b/app/bitcoin/send_receive.js index a0aa710f..72c4397b 100644 --- a/app/bitcoin/send_receive.js +++ b/app/bitcoin/send_receive.js @@ -12,6 +12,7 @@ const destinationAddress = 'DESTINATION_ADDRESS'; // Connect to the Bitcoin testnet network const provider = 'https://testnet.blockchain.info/api'; const explorer = 'https://live.blockcypher.com/btc-testnet/tx/'; +const NETWORK = bitcoin.networks.testnet; // Create a new Bitcoin testnet wallet const wallet = new bitcoin.ECPair.fromPrivateKey(Buffer.from(privateKey, 'hex'), { network: testnet }); diff --git a/app/coinjoin/algorithm.js b/app/coinjoin/algorithm.js deleted file mode 100644 index 7eddca1e..00000000 --- a/app/coinjoin/algorithm.js +++ /dev/null @@ -1,79 +0,0 @@ -const bitcoin = require('bitcoinjs-lib'); -const lightning = require('lightning-js'); -const ldk = require('ldk-node-js'); -const testnet = bitcoin.network.testnet; - -// Connect to the Bitcoin testnet network -const provider = 'https://testnet.blockchain.info/api'; -const explorer = 'https://mempool.space/testnet/tx' - -// Generate a master public key (xpub) for the wallet -const masterPublicKey = 'xpub...'; - -// Derive a new child public key for each CoinJoin transaction -function deriveAddress(index) { - const node = bitcoin.bip32.fromBase58(masterPublicKey); - const childNode = node.derivePath(`0/${index}`); - const publicKey = childNode.publicKey; - const address = bitcoin.payments.p2pkh({ pubkey: publicKey }).address; - return address; -} - -// Index -const coinJoinIndex = 3; // Index of the CoinJoin transaction -const coinJoinAddress = deriveAddress(coinJoinIndex); - -console.log('CoinJoin address:', coinJoinAddress); -// Sample participant inputs -const participant1Input = { - txid: '...', // Transaction ID of the UTXO - vout: 0, // Output index of the UTXO - privateKey: '...', // Private key corresponding to the UTXO -}; - -const participant2Input = { - txid: '...', - vout: 1, - privateKey: '...', -}; - -// Sample outputs -const output1 = { - address: '...', // Destination address for output 1 - value: 0.01, // Value in BTC -}; - -const output2 = { - address: '...', // Destination address for output 2 - value: 0.02, -}; - -// Create a new Bitcoin transaction -const txb = new bitcoin.TransactionBuilder(bitcoin.networks.bitcoin); - -// Add participant inputs to the transaction -txb.addInput(participant1Input.txid, participant1Input.vout); -txb.addInput(participant2Input.txid, participant2Input.vout); - -// Add outputs to the transaction -txb.addOutput(output1.address, output1.value * 1e8); -txb.addOutput(output2.address, output2.value * 1e8); - -// Sign the inputs with respective private keys -const keyPair1 = bitcoin.ECPair.fromWIF(participant1Input.privateKey); -const keyPair2 = bitcoin.ECPair.fromWIF(participant2Input.privateKey); - -txb.sign(0, keyPair1, null, null, participant1Input.value); -txb.sign(1, keyPair2, null, null, participant2Input.value); - -// Build the final transaction -const tx = txb.build(); - -// Serialize the transaction for broadcasting -const serializedTx = tx.toHex(); - -console.log('CoinJoinXT transaction:', serializedTx); - -const AcceptInvoice = { -txid: -invoice: diff --git a/app/coinjoin/coinswap.js b/app/coinjoin/coinswap.js index 88a2d148..3d55f09b 100644 --- a/app/coinjoin/coinswap.js +++ b/app/coinjoin/coinswap.js @@ -1,9 +1,9 @@ const bitcoin = require('bitcoinjs-lib'); -const firebolt = require('algorithm'); +const firebolt = require('main_function'); const axios = require('axios'); // Bitcoin network configuration -const network = bitcoin.testnet.bitcoin; +const network = bitcoin.networks.testnet; // Generate a new Bitcoin address function generateAddress() { diff --git a/app/coinjoin/main_function.js b/app/coinjoin/main_function.js new file mode 100644 index 00000000..10bc38ff --- /dev/null +++ b/app/coinjoin/main_function.js @@ -0,0 +1,82 @@ +const bitcoin = require('bitcoinjs-lib'); +const lightning = require('lightning-js'); +const ldk = require('ldk-node-js'); +const testnet = bitcoin.network.testnet; +const { alice, bob, carol, dave, eve, mallory } = require('./wallets.json') + +// Connect to the Bitcoin testnet network +const provider = 'https://testnet.blockchain.info/api'; +const explorer = 'https://mempool.space/testnet/tx' + + +/// Alice to Carol +const keyPairAlice1 = bitcoin.ECPair.fromWIF(alice[1].wif, network) +const keyPairCarol1 = bitcoin.ECPair.fromWIF(carol[1].wif, network) +const keyPairEve1 = bitcoin.ECPair.fromWIF(eve[1].wif, network) +const keyPairMallory1 = bitcoin.ECPair.fromWIF(mallory[1].wif, network) + +// Get TX +const nonWitnessUtxo = Buffer.from('TX_HEX', 'hex') + + +// Each participant signs their input. +const psbt = new bitcoin.Psbt({network}) + .addInput({ + hash: 'TX_ID', + index: TX_OUT, + nonWitnessUtxo + }) + .addInput({ + hash: 'TX_ID', + index: TX_OUT, + nonWitnessUtxo + }) + .addInput({ + hash: 'TX_ID', + index: TX_OUT, + nonWitnessUtxo + }) + .addInput({ + hash: 'TX_ID', + index: TX_OUT, + nonWitnessUtxo + }) + .addOutput({ + address: bob[1].p2pkh, + value: 2e7, + }) + .addOutput({ + address: dave[1].p2pkh, + value: 2e7, + }) + .addOutput({ + address: mallory[2].p2pkh, + value: 2e7, + }) + .addOutput({ + address: alice[2].p2pkh, + value: 2e7, + }) + .addOutput({ + address: eve[1].p2pkh, + value: 5e6 - 5e4, + }) + .addOutput({ + address: mallory[1].p2pkh, + value: 1e7 - 5e4, + }) + +// Finalize PSBT + +psbt.finalizeAllInputs() + + +console.log('Transaction hexadecimal:') +console.log(psbt.extractTransaction().toHex()) + + + + + + + diff --git a/app/coinjoin/transactions.js b/app/coinjoin/transactions.js index 8c6c4ffc..844a2685 100644 --- a/app/coinjoin/transactions.js +++ b/app/coinjoin/transactions.js @@ -1,3 +1,12 @@ const bitcoin = require('bitcoinjs-lib'); -async function trasaction +async function trasaction = { + utxo: uxto, + input: input, + output: output, + + +async function validation = { + + +async function lightning = { diff --git a/app/coinjoin/wallet_tool.js b/app/coinjoin/wallet_tool.js index 5f22ca86..f5978204 100644 --- a/app/coinjoin/wallet_tool.js +++ b/app/coinjoin/wallet_tool.js @@ -9,6 +9,8 @@ function cjxt_single() { function load_coinjoinxt_config() { // Simulate loading the coinjoinxt config + const coinjoinxt_config = new coinjoinxt_config + } function wallet_tool_main(walletDir) { diff --git a/app/lightning/greelight.js b/app/lightning/greelight.js deleted file mode 100644 index 4a771c9b..00000000 --- a/app/lightning/greelight.js +++ /dev/null @@ -1,2 +0,0 @@ -const glclient = require('gl-client'); -const buffer = require("buffer"); diff --git a/app/lightning/send_receive.js b/app/lightning/send_receive.js index 6ef191fe..43992e9f 100644 --- a/app/lightning/send_receive.js +++ b/app/lightning/send_receive.js @@ -38,6 +38,7 @@ const sendPayment = () => { dest: destinationNode, amt: invoiceAmount, amt: preImage, + pstr: preImage, }; lightning.sendPayment(options, (error, response) => { @@ -63,3 +64,49 @@ const createInvoice = () => { } }); }; +// Taproot Channels +cosnt TaprootChannels = +this.postRequest( + data.simpleTaprootChannel + ? { + private: data.privateChannel, + scid_alias: data.scidAlias, + local_funding_amount: data.local_funding_amount, + min_confs: data.min_confs, + node_pubkey_string: data.node_pubkey_string, + sat_per_vbyte: data.sat_per_vbyte, + spend_unconfirmed: data.spend_unconfirmed, + fund_max: data.fundMax, + outpoints: data.utxos + ? data.utxos.map((utxo) => { + const [txid_str, output_index] = utxo.split(':'); + return { + txid_str, + output_index: Number(output_index), + }; + }) + : undefined, + commitment_type: 'SIMPLE_TAPROOT', + } + : { + private: data.privateChannel, + scid_alias: data.scidAlias, + local_funding_amount: data.local_funding_amount, + min_confs: data.min_confs, + node_pubkey_string: data.node_pubkey_string, + sat_per_vbyte: data.sat_per_vbyte, + spend_unconfirmed: data.spend_unconfirmed, + fund_max: data.fundMax, + outpoints: data.utxos + ? data.utxos.map((utxo) => { + const [txid_str, output_index] = utxo.split(':'); + return { + txid_str, + output_index: Number(output_index), + }; + }) + : undefined, + } +); + + ); diff --git a/app/mod.rs b/app/mod.rs new file mode 100644 index 00000000..6dcea4bb --- /dev/null +++ b/app/mod.rs @@ -0,0 +1,2 @@ +pub mod send +pub mod receive diff --git a/app/pages/buy_bitcoin.html b/app/pages/buy_bitcoin.html new file mode 100644 index 00000000..e3d164b7 --- /dev/null +++ b/app/pages/buy_bitcoin.html @@ -0,0 +1,43 @@ + + + + P2P Apps + + +

Buy your Bitcoin with P2P apps

+ + + +

Add a P2P Application

+
+ + + + + +
+ + + + diff --git a/app/ui/index.js b/app/ui/index.js index 5361fbda..402400d5 100644 --- a/app/ui/index.js +++ b/app/ui/index.js @@ -12,6 +12,8 @@ function showPage(pageId) { // Home page document.getElementById('createWallet').addEventListener('click', function() { // TODO: Implement wallet creation logic + const walet = createwallet; + console.log('Create Wallet clicked'); }); diff --git a/app/ui/wasm.ts b/app/ui/wasm.ts new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/app/ui/wasm.ts @@ -0,0 +1 @@ + diff --git a/doc/development.md b/doc/development.md new file mode 100644 index 00000000..c145f964 --- /dev/null +++ b/doc/development.md @@ -0,0 +1,4 @@ + +# Firebolt Development + +TBD diff --git a/doc/files.md b/doc/files.md new file mode 100644 index 00000000..65f434e1 --- /dev/null +++ b/doc/files.md @@ -0,0 +1,25 @@ +# Files for Firebolt wallet ⚡ + +Discover files present into wallet + +## Files + +- App: Main functions around App +- Bitcoin +- Coinjoin +- Data +- Hypercore +- Lightning +- Nostr +- Pages +- Payjoin +- Rust +- Server +- TBD +- UI +- Android +- Components +- Constants +- iOs +- PWA +- Src diff --git a/doc/run.md b/doc/run.md index bad73298..6442f9ae 100644 --- a/doc/run.md +++ b/doc/run.md @@ -144,3 +144,7 @@ To ensure your PWA works well on mobile devices, use your mobile browser or a to **8. Progressive Enhancement:** Consider implementing progressive enhancement techniques to provide a seamless experience on a wide range of devices and network conditions. + +## Run App (User mode) + +Soon diff --git a/ios/app/coinjoin.swift b/ios/app/coinjoin.swift new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/ios/app/coinjoin.swift @@ -0,0 +1 @@ + diff --git a/ios/app/hypercore.swift b/ios/app/hypercore.swift new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/ios/app/hypercore.swift @@ -0,0 +1 @@ + diff --git a/ios/app/lightning.swift b/ios/app/lightning.swift new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/ios/app/lightning.swift @@ -0,0 +1 @@ + diff --git a/ios/app/nostr.swift b/ios/app/nostr.swift new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/ios/app/nostr.swift @@ -0,0 +1 @@ + diff --git a/package-lock.json b/package-lock.json index 245eb356..0fe982e8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,8 +1,9 @@ { -"name":"FireBolt", -"version":"1.0.0-beta.rc1", -"license":"MIT", -"author": "AreaLayer", +"name":"FireBolt" +"version":"1.0.0-beta.rc4" +"license":"MIT" +"author": "AreaLayer" + }, "package" @@ -19,3 +20,5 @@ }, "android" }, +"ldk" +"version":"^0.0.118.0" diff --git a/package.json b/package.json index c3276190..24f9fa0a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name":"FireBolt", -"version":"1.0.0-beta.rc1", +"version":"1.0.0-beta.rc4", "license":"MIT", "author": "AreaLayer", diff --git a/pwa/manifest.json b/pwa/manifest.json index a4c90c37..1ff7b6bc 100644 --- a/pwa/manifest.json +++ b/pwa/manifest.json @@ -1,7 +1,7 @@ { - "name": "My PWA Example", - "short_name": "PWA Example", - "description": "A simple Progressive Web App example", + "name": "Firebolt", + "short_name": "Super non-custodial app with Lightning Network, Hypercore, TBD and Nostr", + "description": "Non custodial wallet", "start_url": "/index.html", "display": "standalone", "background_color": "#ffffff", diff --git a/pwa/public/page.html b/pwa/public/page.html index 8b137891..36ff749c 100644 --- a/pwa/public/page.html +++ b/pwa/public/page.html @@ -1 +1,31 @@ + + + + + + Firebolt + + + + + + + + + + + + + + diff --git a/pwa/service/coinjoin.jsx b/pwa/service/coinjoin.jsx new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/pwa/service/coinjoin.jsx @@ -0,0 +1 @@ + diff --git a/pwa/service/payjoin.jsx b/pwa/service/payjoin.jsx new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/pwa/service/payjoin.jsx @@ -0,0 +1 @@ + diff --git a/wallet.json b/wallet.json new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/wallet.json @@ -0,0 +1 @@ +