{"id":17521826,"url":"https://github.com/loehnertz/tanglestash","last_synced_at":"2025-04-23T16:43:23.980Z","repository":{"id":65514394,"uuid":"115413036","full_name":"loehnertz/Tanglestash","owner":"loehnertz","description":"IOTA meets BitTorrent: An algorithm to persist any file onto the tangle of IOTA","archived":false,"fork":false,"pushed_at":"2018-02-09T11:54:17.000Z","size":182,"stargazers_count":45,"open_issues_count":0,"forks_count":6,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-19T17:41:57.057Z","etag":null,"topics":["dag","distributed-storage","filesharing","iota","nodejs","storage","tangle","torrent"],"latest_commit_sha":null,"homepage":"http://tanglesta.sh/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/loehnertz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-12-26T10:38:51.000Z","updated_at":"2023-01-02T22:03:50.000Z","dependencies_parsed_at":"2023-01-26T21:05:15.641Z","dependency_job_id":null,"html_url":"https://github.com/loehnertz/Tanglestash","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loehnertz%2FTanglestash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loehnertz%2FTanglestash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loehnertz%2FTanglestash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loehnertz%2FTanglestash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/loehnertz","download_url":"https://codeload.github.com/loehnertz/Tanglestash/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250472115,"owners_count":21436081,"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":["dag","distributed-storage","filesharing","iota","nodejs","storage","tangle","torrent"],"created_at":"2024-10-20T12:07:05.610Z","updated_at":"2025-04-23T16:43:23.963Z","avatar_url":"https://github.com/loehnertz.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![license](https://img.shields.io/npm/l/tanglestash.svg)](LICENSE)\n[![npm](https://img.shields.io/npm/v/tanglestash.svg)](https://www.npmjs.com/package/tanglestash)\n[![npm](https://img.shields.io/npm/dt/tanglestash.svg)](https://www.npmjs.com/package/tanglestash)\n[![daviddm](https://david-dm.org/loehnertz/Tanglestash.svg)](https://david-dm.org/loehnertz/Tanglestash)\n# Tanglestash\nIOTA meets BitTorrent: An algorithm to persist any file onto the tangle of IOTA\n\n\n## Features\n\n- Persist any data onto the tangle of IOTA\n- Retrieve data that was persisted with this module beforehand\n- Optionally encrypt your data with a password (via AES)\n- Store a string or even a whole file without any prior conversion\n\n\n## GUI\n\n**Check out my other project [tanglesta.sh](http://tanglesta.sh/) here on GitHub\nwhich implements this module into a full-blown desktop app available for Windows, macOS and Linux.**\n\n\n## Idea\n\nI really like the idea of the tangle of IOTA and I think that this cryptocurrency\nhas a bright future. I run a full node myself and want the idea to succeed.\nThe more I messed with IOTA, the further this idea formed in my mind to use\nthe 2187 trytes of each transactions signature to store any data on the\ndecentralised tangle.\n\nThis module can persist any string or even files directly onto the tangle\nvia creating a torrent-esque chain of transactions that reference other transactions\nholding the data while also referencing their direct predecessor in the chain.\nThat way, this module can also retrieve any data that was persisted beforehand by\njust passing the 'entry-hash' into it, which is the first transaction hash of the created chain.\nThe data can be optionally encrypted with a secret via AES so that even if someone\ngets hold of an 'entry-hash', the data will still be illegible.\nData is stored as a Base64 string and files will be automatically encoded if passed\ninto the algorithm as well as decoded if retrieved – no prior conversion of the file needed.\\\nHere is a diagram of the data structure I came with for this project:\\\n\\\n![Diagram of the data structure](https://i.imgur.com/eDF7FxS.png)\n\n\n## Disclaimer\n\nI know that primarily the persisting to the tangle is painfully slow compared to a traditional HTTP upload.\\\nKeep in mind though that this project is more of a proof-of-concept rather than a finished product.\\\nThe reason that it takes so long is mainly the current speed of the PoW, which might get faster in the future with new techniques.\n\n**Additionally, it is important to note that this module just works with Node.js version 8 owing to the fact that a dependency is currently not functioning under version 9.**\n\n\n## Installation\n\nNPM\n```\nnpm install --save tanglestash\n```\n\nYarn\n```\nyarn add tanglestash\n```\n\n\n## Usage\n\nFirst off, create a new instance of the modules class\n```js\nlet tanglestash = new Tanglestash(provider, datatype, seed);\n```\nwith the following arguments:\n1. **`provider`**: `String` A URI of an IOTA full node\n2. **`datatype`**: `String` Either 'file' or 'string' based on the data that will later be used\n3. **`seed`**: `String` `[Optional]` An IOTA wallet seed; will be automatically generated if not passed here\n\n\n---\n\n### `readFromTangle`\n\nRetrieves data that was persisted onto the tangle in the past.\n\n#### Input\n```js\ntanglestash.readFromTangle(entryHash, secret)\n```\n\n1. **`entryHash`**: `String` Any transaction hash that was output after successfully persisting data beforehand; called 'entry-hash'\n2. **`secret`**: `String` `[Optional]` The password the data was encrypted with; if any\n\n#### Return Value\n\n1. **`Promise.\u003c*\u003e`** - A file buffer of the retrieved data or a string based on `this.datatype`\n\n---\n\n### `saveToTangle`\n\nPersists data onto the tangle.\n\n#### Input\n```js\ntanglestash.saveToTangle(data, secret)\n```\n\n1. **`data`**: `String` The data as a string or file path based on `this.datatype`\n2. **`secret`**: `String` `[Optional]` The password the data should be encrypted with; if any\n\n#### Return Value\n\n1. **`Promise.\u003cstring\u003e`** - The last transaction hash of the created chain; called 'entry-hash'\n\n---\n\n### `getNewIotaAddress`\n\nRetrieves a new valid IOTA wallet address based on `this.seed`.\n\n#### Input\n```js\ntanglestash.getNewIotaAddress()\n```\n\n#### Return Value\n\n1. **`Promise.\u003cstring\u003e`** - The retrieved wallet address\n\n---\n\n### `getAllMarkyEntries`\n\nReturns all the `marky` entries used to time the main processes.\nIf you've never used `marky` before, learn more about it [here](https://www.npmjs.com/package/marky).\n\n#### Input\n```js\ntanglestash.getAllMarkyEntries()\n```\n\n#### Return Value\n\n1. **`Array.\u003cobject\u003e`** - All the timing entries created by `marky`\n\n\n## License\n\nThis project is licensed under the [MIT license](LICENSE).\\\nThe included [dynamic libraries](lib/libccurl) are compiled from the [ccurl](https://github.com/iotaledger/ccurl) repository licensed under [MIT license](https://github.com/iotaledger/ccurl/blob/master/LICENSE).\n\n\n## Donations\n\nIf you like this module and want to support it, you can of course donate some IOTA 😊 \\\n`QIFKUOEQBCEV9NKFWDBTQYBHLFFORLVKDQSYDSZQQMKTCBLBFDQMJWIOUDH9DLZXVKGNQGKLSAJCQQMEDESLCTHGZD`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floehnertz%2Ftanglestash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Floehnertz%2Ftanglestash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floehnertz%2Ftanglestash/lists"}