{"id":18835178,"url":"https://github.com/blockchainsllc/in3-trie","last_synced_at":"2026-01-26T17:30:21.162Z","repository":{"id":44134171,"uuid":"157353679","full_name":"blockchainsllc/in3-trie","owner":"blockchainsllc","description":"Implementation of the patricia merkle tree","archived":false,"fork":false,"pushed_at":"2022-02-12T00:23:29.000Z","size":271,"stargazers_count":3,"open_issues_count":5,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-30T07:43:35.629Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/blockchainsllc.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}},"created_at":"2018-11-13T09:25:03.000Z","updated_at":"2024-12-02T00:23:10.000Z","dependencies_parsed_at":"2022-09-19T09:30:51.794Z","dependency_job_id":null,"html_url":"https://github.com/blockchainsllc/in3-trie","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blockchainsllc%2Fin3-trie","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blockchainsllc%2Fin3-trie/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blockchainsllc%2Fin3-trie/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blockchainsllc%2Fin3-trie/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/blockchainsllc","download_url":"https://codeload.github.com/blockchainsllc/in3-trie/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239769738,"owners_count":19693929,"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":[],"created_at":"2024-11-08T02:14:54.281Z","updated_at":"2026-01-26T17:30:21.115Z","avatar_url":"https://github.com/blockchainsllc.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# in3-trie\nImplementation of the patricia merkle tree in typescript.\nThis also includes Merkle proofs.\n\n\n## Usage\n\n```js\nimport {serialize} from 'in3'\nimport Trie,{verifyProof} from 'in3-trie'\n\nconst encode = serialize.rlp.encode\n\n// create a new Merkle Tree\nconst trie = new Trie()\n\n// put all transactions of a block into the tree\nfor (let i=0;i\u003cblock.transactions.length;i++) \n  await trie.setValue(encode(i), encode(serialize.toTransaction(block.transactions[i])))\n\n// verify the transactionRoot\nif (trie.root.equals( Buffer.from(block.transactionsRoot.substr(2),'hex')))\n   console.log('transaction verified')\nelse\n   console.log('transaction not verified - wrong TransactionHash')\n\n// create a merkle Proof for the first transaction\nconst path = encode(0)\nconst expectedValue = encode(serialize.toTransaction(block.transactions[0]))\nconst proof = await trie.getProof(path)\n\n// verify this merkle proof and throw if it does not match\nverifyProof(trie.root, path, proof, expectedValue)\n\n```\n\nPer default sha256 as hash and rlp-encoding is used to serilialize nodes, but you can configure your own hash and codec.\nAlso by configuring a db, you can also use the leveldb to work with.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblockchainsllc%2Fin3-trie","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblockchainsllc%2Fin3-trie","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblockchainsllc%2Fin3-trie/lists"}