{"id":18031493,"url":"https://github.com/bitcoinwarrior1/bitcoin-timelock-alerts","last_synced_at":"2025-04-04T21:43:12.737Z","repository":{"id":258440923,"uuid":"863849842","full_name":"bitcoinwarrior1/bitcoin-timelock-alerts","owner":"bitcoinwarrior1","description":"Receive alerts for when CSVs and CLTVs time conditions are met.","archived":false,"fork":false,"pushed_at":"2024-10-01T05:40:47.000Z","size":218,"stargazers_count":0,"open_issues_count":7,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-10T06:24:16.813Z","etag":null,"topics":["alerts","bitcoin","timelock"],"latest_commit_sha":null,"homepage":"https://chatgpt.com/share/66f62361-e484-8007-aeba-17f111dfb56f","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bitcoinwarrior1.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-27T03:09:52.000Z","updated_at":"2024-10-17T00:05:34.000Z","dependencies_parsed_at":null,"dependency_job_id":"11eb6378-54f4-4b99-ba94-9dc8efde5f14","html_url":"https://github.com/bitcoinwarrior1/bitcoin-timelock-alerts","commit_stats":null,"previous_names":["bitcoinwarrior1/bitcoin-timelock-alerts"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitcoinwarrior1%2Fbitcoin-timelock-alerts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitcoinwarrior1%2Fbitcoin-timelock-alerts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitcoinwarrior1%2Fbitcoin-timelock-alerts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitcoinwarrior1%2Fbitcoin-timelock-alerts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bitcoinwarrior1","download_url":"https://codeload.github.com/bitcoinwarrior1/bitcoin-timelock-alerts/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247256072,"owners_count":20909240,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["alerts","bitcoin","timelock"],"created_at":"2024-10-30T10:09:21.376Z","updated_at":"2025-04-04T21:43:12.713Z","avatar_url":"https://github.com/bitcoinwarrior1.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bitcoin-timelock-alerts\n\nReceive alerts for when CSVs and CLTVs time conditions are met.\n\n## Getting Started\n\nFirst, run the development server:\n\n```bash\nnpm run dev\n# or\nyarn dev\n# or\npnpm dev\n# or\nbun dev\n```\n\nOpen [http://localhost:3000](http://localhost:3000) with your browser to see the\nresult.\n\nYou can start editing the page by modifying `app/page.tsx`. The page\nauto-updates as you edit the file.\n\nThis project uses\n[`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to\nautomatically optimize and load Inter, a custom Google Font.\n\n## Use cases\n\n### Green app 2FA expiry \u0026 other security services that leverage timelocks\n\nBlockstream green has a 2FA multisig feature that leverages CSVs. The UTXO unlocking script requires two signatures (one from you, and one from blockstream), until the CSV timelock is reached and the funds become spendable with just your key. Users need to create new UTXOs to reset the multisig, and forgetting to do so removes the protection that the multsig provides.\n\nUsers of this feature can use this service to remind them that they need to create new timelocks.\n\n### Escrow, delayed payments \u0026 financial services\n\nMany services leverage timelocks, such as escrows, delayed payments and estate planning. This service can provide alerts to let users know when the timelock payment is due to become valid.\n\n### Lightning\n\nLayer 2 protocols like the Lightning Network rely on relative timelocks (CSV) to manage closing channels or dispute periods. This service can be used to remind users when a timelock becomes due, enabling them to prevent force closures.\n\n### HODLing\n\nSome users lock up their coins to prevent them from premature selling. This service can remind them when the timelock is set to expire. Users may then wish to reset the timelock, or spend the funds.\n\n## Business model\n\n### Free\n\nThe free tier will allow users to download ical files for a particular transaction.\n\n### Paid\n\nThe paid tier will allow users to track particular addresses by sending in an `xPub` or array of `addresses`. The paid tier will include the following premium features:\n\n1. Email alerts\n2. Dynamic tracking of their wallets, allowing new transactions to be automatically tracked\n3. The ability to add `xPubs`, enabling new addresses to be derived and tracked for new transactions\n\nUsers will pay a monthly subscription, the price will be determined by the amount of inputs to track.\n\n## Requirements \n\n### MVP\n1. Create a web interface that lets a user paste an address or UTXO \n2. Show an error if the UTXO or address does not contain any timelock scripts\n2. Grab all the timelock conditions from the UTXO(s), including the timestamp and unlock conditions\n3. Create an iCal file for each timelock \u0026 its condition(s)\n4. Download the calendar file \n\n### Post MVP premium requirements \n1. Email alerts (including alerts for new inputs, and spending of tracked inputs) \n2. Real time monitoring of addresses/xPubs for new inputs\n\n## Architecture\n\n### Backend\n\n#### getTimeLocks\n\nThis function gets the CSVs or CLTVs for a particular transaction.\n\n\u003ctable\u003e\n  \u003ctr\u003e\n   \u003ctd\u003e\u003cstrong\u003eName\u003c/strong\u003e\n   \u003c/td\u003e\n   \u003ctd\u003e\u003cstrong\u003eType\u003c/strong\u003e\n   \u003c/td\u003e\n   \u003ctd\u003e\u003cstrong\u003eDescription\u003c/strong\u003e\n   \u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n   \u003ctd\u003e\u003ccode\u003etransactionHash\u003c/code\u003e\n   \u003c/td\u003e\n   \u003ctd\u003e\u003ccode\u003estring\u003c/code\u003e\n   \u003c/td\u003e\n   \u003ctd\u003eThe transaction hash of a Bitcoin transaction\n   \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\nThis function takes a transaction hash and searches the blockchain for the locking script. If no timelock is found, it throws an error.\n\nReturns:\n\n\u003ctable\u003e\n  \u003ctr\u003e\n   \u003ctd\u003e\u003cstrong\u003eName\u003c/strong\u003e\n   \u003c/td\u003e\n   \u003ctd\u003e\u003cstrong\u003eType\u003c/strong\u003e\n   \u003c/td\u003e\n   \u003ctd\u003e\u003cstrong\u003eDescription\u003c/strong\u003e\n   \u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n   \u003ctd\u003e\u003ccode\u003etimelocks\u003c/code\u003e\n   \u003c/td\u003e\n   \u003ctd\u003e\u003ccode\u003enumber[]\u003c/code\u003e\n   \u003c/td\u003e\n   \u003ctd\u003eThe timelock timestamp for the transaction \n   \u003c/td\u003e\n  \u003c/tr\u003e\n\u003ctr\u003e\n   \u003ctd\u003e\u003ccode\u003econditions\u003c/code\u003e\n   \u003c/td\u003e\n   \u003ctd\u003e\u003ccode\u003estring[]\u003c/code\u003e\n   \u003c/td\u003e\n   \u003ctd\u003eThe conditions to spend the transaction, once the timelock(s) are reached\n   \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n#### getCalendarInvite\n\nThis function gets an iCal file for a particular timelock. Each transaction could have multiple timelocks, and thus multiple calendar files.\n\n\u003ctable\u003e\n  \u003ctr\u003e\n   \u003ctd\u003e\u003cstrong\u003eName\u003c/strong\u003e\n   \u003c/td\u003e\n   \u003ctd\u003e\u003cstrong\u003eType\u003c/strong\u003e\n   \u003c/td\u003e\n   \u003ctd\u003e\u003cstrong\u003eDescription\u003c/strong\u003e\n   \u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n   \u003ctd\u003e\u003ccode\u003etimelock\u003c/code\u003e\n   \u003c/td\u003e\n   \u003ctd\u003e\u003ccode\u003eDate\u003c/code\u003e\n   \u003c/td\u003e\n   \u003ctd\u003e The reminder date \n   \u003c/td\u003e\n  \u003c/tr\u003e\n\u003ctr\u003e\n   \u003ctd\u003e\u003ccode\u003econdition\u003c/code\u003e\n   \u003c/td\u003e\n   \u003ctd\u003e\u003ccode\u003estring\u003c/code\u003e\n   \u003c/td\u003e\n   \u003ctd\u003eThe conditions to spend the transaction once the timelock is reached\n   \u003c/td\u003e\n  \u003c/tr\u003e\n\u003ctr\u003e\n   \u003ctd\u003e\u003ccode\u003etransactionHash\u003c/code\u003e\n   \u003c/td\u003e\n   \u003ctd\u003e\u003ccode\u003estring\u003c/code\u003e\n   \u003c/td\u003e\n   \u003ctd\u003eThe transaction hash for the particular transaction \n   \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\nReturns: \n\n\u003ctable\u003e\n  \u003ctr\u003e\n   \u003ctd\u003e\u003cstrong\u003eName\u003c/strong\u003e\n   \u003c/td\u003e\n   \u003ctd\u003e\u003cstrong\u003eType\u003c/strong\u003e\n   \u003c/td\u003e\n   \u003ctd\u003e\u003cstrong\u003eDescription\u003c/strong\u003e\n   \u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n   \u003ctd\u003e\u003ccode\u003eiCal\u003c/code\u003e\n   \u003c/td\u003e\n   \u003ctd\u003e\u003ccode\u003estring\u003c/code\u003e\n   \u003c/td\u003e\n   \u003ctd\u003eThe iCal file data\n   \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n### getTimeLocksFromAddressUTXOs\nThis function gets UTXOs from an address and finds the timelock conditions. \n\n\u003ctable\u003e\n  \u003ctr\u003e\n   \u003ctd\u003e\u003cstrong\u003eName\u003c/strong\u003e\n   \u003c/td\u003e\n   \u003ctd\u003e\u003cstrong\u003eType\u003c/strong\u003e\n   \u003c/td\u003e\n   \u003ctd\u003e\u003cstrong\u003eDescription\u003c/strong\u003e\n   \u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n   \u003ctd\u003e\u003ccode\u003eaddress\u003c/code\u003e\n   \u003c/td\u003e\n   \u003ctd\u003e\u003ccode\u003estring\u003c/code\u003e\n   \u003c/td\u003e\n   \u003ctd\u003eThe bitcoin address\n   \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\n```ts\ntype UTXOsWithTimeLocks = {\n    txHashes: string[],\n    timelocks: number[],\n    conditions: string[],\n}\n```\n\nReturns:\n\u003ctable\u003e\n  \u003ctr\u003e\n   \u003ctd\u003e\u003cstrong\u003eName\u003c/strong\u003e\n   \u003c/td\u003e\n   \u003ctd\u003e\u003cstrong\u003eType\u003c/strong\u003e\n   \u003c/td\u003e\n   \u003ctd\u003e\u003cstrong\u003eDescription\u003c/strong\u003e\n   \u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n   \u003ctd\u003e\u003ccode\u003eUTXOsWithTimeLocks\u003c/code\u003e\n   \u003c/td\u003e\n   \u003ctd\u003e\u003ccode\u003eUTXOsWithTimeLocks\u003c/code\u003e\n   \u003c/td\u003e\n   \u003ctd\u003eAn object of type UTXOsWithTimeLocks\n   \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n### Database\nThis project uses MongoDB.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitcoinwarrior1%2Fbitcoin-timelock-alerts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbitcoinwarrior1%2Fbitcoin-timelock-alerts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitcoinwarrior1%2Fbitcoin-timelock-alerts/lists"}