Rewind Bitcoin is a secure, feature-rich Bitcoin wallet designed to protect users' funds from theft and extortion through advanced vaulting mechanisms. This repository contains a core component of the Rewind Bitcoin project, allowing for decentralized, peer-to-peer backups of user vaults, ensuring data integrity and security.
The Community Backups functionality enables users to securely back up their vaults in a decentralized manner. The primary goal is to provide a secure, non-centralized backup solution that leverages peer-to-peer technology, ensuring users retain control over their encrypted backups, even if Rewind Bitcoin ceases to operate for any reason.
Key benefits:
- Decentralized backups: Users can maintain backups of their own vaults and backup vaults for all Rewind Bitcoin users, ensuring their data remains secure as long as a node is running.
- Secure and Encrypted: Backups are fully encrypted using a key derived from the mnemonic and vault id, ensuring that users who back up others' vaults cannot access the actual contents. Security is guaranteed as long as the mnemonic is securely stored.
- Community-driven: Encourage friends or family to use Rewind Bitcoin with confidence, knowing their vaults will be securely backed up by peers running Community Backup nodes.
- Allows users to input a recovery mnemonic to identify and restore vaults.
- Supports automated decryption and storage of recovered vault data.
- Offers endpoints to check vault status and retrieve encrypted vault data.
- This API can be configured as the data source in the Rewind Bitcoin wallet, allowing users to bypass Rewind's servers for enhanced privacy, even though all data is already encrypted.
The application supports multiple networks, including Bitcoin Mainnet, Testnet, and Tape (Rewind's test network). By default, all networks are enabled, but specific ones can be disabled using command-line options. The Tape Network offers a dedicated testing environment with free coins available through a faucet for experimentation.
Rewind Bitcoin Community Backups is built on the Pears platform, a peer-to-peer runtime environment for decentralized applications. By leveraging Pears, this program ensures that the application operates without relying on central servers, with the community maintaining the P2P network where the program lives.
- Pears Runtime: Required to run this program. If you already use Pears applications like Keet, the runtime is likely already installed.
- Node.js: Needed to install the Pears runtime if it is not already set up.
-
Install the Pears runtime:
npm i -g pear
-
To complete the setup, run the
pearcommand:pear
Run the application using pear:
pear run <app-id> [options]Replace <app-id> with the provided app key for this program.
To make the application available in a decentralized manner, you can optionally seed it (we kindly encourage you to do so):
pear seed <app-id>To ensure the integrity of the program, you can inspect its codebase directly:
pear dump <app-id> <folder>Usage: pear run <app-id> [options]
Options:
--help Show this help message
--enable-api Enable the REST API
--port <number> Specify the port for the REST API (default: random)
--interactive Enable interactive mode
--disable-bitcoin Disable Bitcoin P2P network
--disable-testnet Disable Testnet P2P network
--disable-tape Disable Tape P2P network
--enable-regtest <pubKey> Enable Regtest network with the specified public keyBy default, all public networks are enabled. At least one network must remain enabled.
pear run <app-id> --enable-api --port 8080pear run <app-id> --disable-tapeInteractive mode allows users to restore vaults using their recovery mnemonics.
-
Run the program in interactive mode:
pear run <app-id> --interactive
-
Enter your recovery mnemonic when prompted.
-
The program will:
- Search for matching vaults across enabled networks.
- Decrypt and save the vault data locally.
- Description: Retrieve vault data by
vaultId. The optionalnetworkIdspecifies the network (e.g.,testnet,tape). IfnetworkIdis omitted, the default isbitcoin. - Response:
200 OK: Returns the encrypted vault data as a binary stream.404 Not Found: Vault not found.
- Description: Check if a vault exists by
vaultId. The optionalnetworkIdspecifies the network (e.g.,testnet,tape). IfnetworkIdis omitted, the default isbitcoin. - Response:
200 OK:{ exists: true, message: "Data exists for vaultId: <vaultId>" }404 Not Found:{ exists: false, message: "No data found for vaultId: <vaultId>" }
- Description: Returns a
204 No Contentstatus. This endpoint can be used as a health check or a lightweight API response. - Response:
204 No Content: Indicates the server is operational.
Start the server:
pear run <app-id> --enable-api --port 8080Access the endpoints:
-
Check vault:
curl http://localhost:8080/vaults/<vaultId>/check
-
Get vault:
curl http://localhost:8080/vaults/<vaultId>/get
If you're using a specific network (e.g., testnet or tape), include the networkId in the URL:
-
Check vault:
curl http://localhost:8080/testnet/vaults/<vaultId>/check
-
Get vault:
curl http://localhost:8080/tape/vaults/<vaultId>/get
This project is licensed under the MIT License.
For more information, visit Rewind Bitcoin.