{"_id":"@ignored/trie","_rev":"14-db7a0c165d9cf596dec0c059e3b97151","name":"@ignored/trie","dist-tags":{"latest":"5.0.0-beta.6"},"versions":{"5.0.0-beta.3":{"name":"@ignored/trie","version":"5.0.0-beta.3","keywords":["merkle","radix","trie","ethereum"],"author":{"name":"EthereumJS Team"},"license":"MPL-2.0","_id":"@ignored/trie@5.0.0-beta.3","maintainers":[{"name":"fvictorio","email":"victorio.franco@gmail.com"},{"name":"alcuadrado","email":"email@patriciopalladino.com"}],"contributors":[{"url":"https://github.com/kumavis","name":"Aaron Kumavis","email":"http://aaron.kumavis.me/"}],"homepage":"https://github.com/ethereumjs/ethereumjs-monorepo/tree/master/packages/trie#readme","bugs":{"url":"https://github.com/ethereumjs/ethereumjs-monorepo/issues?q=is%3Aissue+label%3A%22package%3A+trie%22"},"dist":{"shasum":"1a3b6af18cec8f9d0860531d8e2324e2c12b5e49","tarball":"https://registry.npmjs.org/@ignored/trie/-/trie-5.0.0-beta.3.tgz","fileCount":112,"integrity":"sha512-o3qPEn1ydGiivkMv8C4mgdmiLY/qtFQektnn1ev7q5Utb28p9Eo+iSNMQXfh359PqccRLR4dszQtBK0o8iwBWw==","signatures":[{"sig":"MEQCIBjSfvaNCudgvhgx42k1bfRTcJmrbAmGdB9GY8jcJF52AiBVPZgpXX/VFUkq5/XbzkTz1GK909fV3QbepylVvDA8Dg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":256692,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi/QVHACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpzog/9FUatPZNS7jKWnBXWGUj20bhMGEbkB5v8rtgeQIcdBAvt95bc\r\nmQSzCp9YjJ7ToRVzwsERcJ/XbXqsfD8i+nFehJJ4YCy1MJ3SW+m+bxRv7VKU\r\nSt5J37oYMc/TsEV3GOa+KXpCD6JN2NG34ZZ+K1Qqo9jHdKsdGQEBKDB+2F9l\r\nx+pYpdjvKjQ9tBOhkTk3zcBWXKhINDvmjsFMo/ZwxTlFNizkK6uZEoEzcPzN\r\nKDJrAhcC57SzBkwKutDvSK0tbB0utXuW9+Xk74MGEyFFBeZTiEHObiZaM2mx\r\ndKdKb2Ao4wLEcD/PPScseZkSRify5RB75YK/OQRT+0Rm1/bhCOw4+GR8Gg+X\r\n1r88m+3OCeTAgWR5HLtiKfS6uh3XPudE3pYlBnLMNSE2Y3LqZ9hvhD7xCAVj\r\nPY1vkFEGPKpA/2sZBsyohWPHqnOY73vmGp/BPvrc9wmd+aRyQM9L/EO4W9y0\r\ni15Onn7mPm4EDLonDcanhsH3FZPmuHHkQ9YiGap7iTk1Xxfz9MuwocYdKje1\r\n47dRnTdaX18KwtkEAPVqbRTfjMebM8nE83o/8mbfFjH2uy11KomTK3ZF5d5r\r\nlXBl6C4qPCMTlSkMH2GuGSEJ6P4lhCzq3g0CbzeoCvXLlw2sl/JJNY86cS5D\r\n/mea0kejn0oMv9QhvmZjSC7Zy5KRwYD9Kqs=\r\n=Rz9v\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"e6cd90ad72ae51dc60e6f2b0b6d3e56312469bbb","scripts":{"tsc":"../../config/cli/ts-compile.sh","lint":"../../config/cli/lint.sh","tape":"tape -r ts-node/register","test":"npm run test:node && npm run test:browser","build":"../../config/cli/ts-build.sh","clean":"../../config/cli/clean-package.sh","coverage":"../../config/cli/coverage.sh","lint:fix":"../../config/cli/lint-fix.sh","lint:diff":"../../config/cli/lint-diff.sh","profiling":"tsc --target ES5 benchmarks/random.ts && 0x benchmarks/random.js","test:node":"tape -r ts-node/register 'test/**/*.ts'","benchmarks":"node -r ts-node/register --max-old-space-size=8024 benchmarks","docs:build":"typedoc --options typedoc.js","test:browser":"karma start karma.conf.js"},"_npmUser":{"name":"fvictorio","email":"victorio.franco@gmail.com"},"repository":{"url":"git+https://github.com/ethereumjs/ethereumjs-monorepo.git","type":"git"},"_npmVersion":"8.15.1","description":"This is an implementation of the modified merkle patricia tree as specified in Ethereum's yellow paper.","directories":{},"_nodeVersion":"14.19.3","dependencies":{"level":"^8.0.0","@ignored/rlp":"4.0.0-beta.3","memory-level":"^1.0.0","@ignored/util":"8.0.0-beta.3","abstract-level":"^1.0.3","readable-stream":"^3.6.0","ethereum-cryptography":"^1.1.2","semaphore-async-await":"^1.5.1"},"_hasShrinkwrap":false,"devDependencies":{"0x":"^4.9.1","nyc":"^15.1.0","lmdb":"^2.5.3","tape":"^5.3.1","web3":"^1.7.5","karma":"^6.3.2","eslint":"^8.0.0","ts-node":"^10.2.1","karma-tap":"^4.2.0","typescript":"^4.4.2","@types/node":"^16.11.7","@types/tape":"^4.13.2","micro-bmark":"0.2.0","@types/benchmark":"^1.0.33","karma-typescript":"^5.5.3","karma-chrome-launcher":"^3.1.0","@types/readable-stream":"^2.3.13","karma-firefox-launcher":"^2.1.0"},"_npmOperationalInternal":{"tmp":"tmp/trie_5.0.0-beta.3_1660749126763_0.09843461173336943","host":"s3://npm-registry-packages"}},"5.0.0-beta.4":{"name":"@ignored/trie","version":"5.0.0-beta.4","keywords":["merkle","radix","trie","ethereum"],"author":{"name":"EthereumJS Team"},"license":"MPL-2.0","_id":"@ignored/trie@5.0.0-beta.4","maintainers":[{"name":"fvictorio","email":"victorio.franco@gmail.com"},{"name":"alcuadrado","email":"email@patriciopalladino.com"}],"contributors":[{"url":"https://github.com/kumavis","name":"Aaron Kumavis","email":"http://aaron.kumavis.me/"}],"homepage":"https://github.com/ethereumjs/ethereumjs-monorepo/tree/master/packages/trie#readme","bugs":{"url":"https://github.com/ethereumjs/ethereumjs-monorepo/issues?q=is%3Aissue+label%3A%22package%3A+trie%22"},"dist":{"shasum":"92940f335cde5dcbc93a28e03a2ed0da0b373a95","tarball":"https://registry.npmjs.org/@ignored/trie/-/trie-5.0.0-beta.4.tgz","fileCount":121,"integrity":"sha512-kPoipr9WFKENQqQZaPOccydUdDaOpNekU3duG3S7mTQM+AujMWFfeVM3/Aad78C8Mp9MHEIRTCPabdDhiUrNCw==","signatures":[{"sig":"MEUCIA0C8K9jiq5TZVDxV37lbP9lnJtaF8zpo9M+jsLqqGdTAiEAyOaybZYMc15sO0ZA0T6m+UMUsGyZRWyxYgHvymnrcwc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":265418,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjAR7LACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmraPw//XOZjj04ZHx/VuEyDfHme5GH9cloPkO9oUUMKKkUMp/md5AYX\r\nmJEmdDcWOKU0UjNKqJk2h+lDIJe7L6MA/Dd8KRuSRPRLceiDfQg+pyS2bwsC\r\n436gUH9WpF+3N9hgldT4Y4SRrhKPdH1suW08xx6Zdvp3HcNb/j8EfUvgg7qM\r\nUOC+Sk/vJmpq1Ioiaiey86FYzUoamb72XyNpnksXppeP93CUfzxKz8tCrSj4\r\ngyJtRIvdE0xmoLFKCAEvcBDTzep9IkmOhlkI08xqeOFzvMeOjJKMaqC58p/4\r\n5xTCjsMDf9q3pVLo94bjwtMALYAhiJw2Giqr1AQ9y/zPiM29oKh8TlNHAx+c\r\n7crq+pocKdb0FfKm3ZaTbodppt12e7ys+dYr2HfvxZFkFoDYyZ4XCDQcZst/\r\nVjgef5o+dQW5e4SvpWe4ehi2xsSPX+d0S/QpFNTvCqsz+jmKrnox6Akg/mnn\r\nCL99iaLfTBL3SnxI4QdDM8inodqkIaSpTe4nU8kMjeP2pRvzqWZp5Onw4Rif\r\nA/I87J2IaFfiD28UH/iuWcQTAHiFJkttAqkQSYKFCWi4IfBvvL7sNOw3yIno\r\nRpxXuXKh5zArMfZZ4afC4NsukgRoD0hX256Eye7Dbxm31CBFinTz++a0pilf\r\n6fTKARgBe6PighPR1IEIo9m2iK80shtfkcU=\r\n=S+e7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=14"},"gitHead":"38f7fe0088ea852ecb0a8a5b4b5bcd00e68b5b25","scripts":{"tsc":"../../config/cli/ts-compile.sh","lint":"../../config/cli/lint.sh","tape":"tape -r ts-node/register","test":"npm run test:node && npm run test:browser","build":"../../config/cli/ts-build.sh","clean":"../../config/cli/clean-package.sh","coverage":"../../config/cli/coverage.sh","lint:fix":"../../config/cli/lint-fix.sh","lint:diff":"../../config/cli/lint-diff.sh","profiling":"tsc --target ES5 benchmarks/random.ts && 0x benchmarks/random.js","test:node":"tape -r ts-node/register 'test/**/*.ts'","benchmarks":"node -r ts-node/register --max-old-space-size=8024 benchmarks","docs:build":"typedoc --options typedoc.js","test:browser":"karma start karma.conf.js"},"_npmUser":{"name":"fvictorio","email":"victorio.franco@gmail.com"},"repository":{"url":"git+https://github.com/ethereumjs/ethereumjs-monorepo.git","type":"git"},"_npmVersion":"8.15.1","description":"This is an implementation of the modified merkle patricia tree as specified in Ethereum's yellow paper.","directories":{},"_nodeVersion":"14.19.3","dependencies":{"@ignored/rlp":"4.0.0-beta.4","@ignored/util":"8.0.0-beta.4","readable-stream":"^3.6.0","ethereum-cryptography":"^1.1.2"},"_hasShrinkwrap":false,"devDependencies":{"0x":"^4.9.1","lmdb":"^2.5.3","level":"^8.0.0","levelup":"^5.1.1","level-mem":"^6.0.1","micro-bmark":"0.2.0","level-legacy":"npm:level@^7.0.0","memory-level":"^1.0.0","abstract-level":"^1.0.3","@types/benchmark":"^1.0.33","@types/readable-stream":"^2.3.13"},"_npmOperationalInternal":{"tmp":"tmp/trie_5.0.0-beta.4_1661017803528_0.8883664457971454","host":"s3://npm-registry-packages"}},"5.0.0-beta.5":{"name":"@ignored/trie","version":"5.0.0-beta.5","keywords":["merkle","radix","trie","ethereum"],"author":{"name":"EthereumJS Team"},"license":"MPL-2.0","_id":"@ignored/trie@5.0.0-beta.5","maintainers":[{"name":"fvictorio","email":"victorio.franco@gmail.com"},{"name":"alcuadrado","email":"email@patriciopalladino.com"}],"contributors":[{"url":"https://github.com/kumavis","name":"Aaron Kumavis","email":"http://aaron.kumavis.me/"}],"homepage":"https://github.com/ethereumjs/ethereumjs-monorepo/tree/master/packages/trie#readme","bugs":{"url":"https://github.com/ethereumjs/ethereumjs-monorepo/issues?q=is%3Aissue+label%3A%22package%3A+trie%22"},"dist":{"shasum":"7a7709a0ba163aca9c837c1970bdef9428586729","tarball":"https://registry.npmjs.org/@ignored/trie/-/trie-5.0.0-beta.5.tgz","fileCount":121,"integrity":"sha512-IsNV2VuNDaJArhjuSEgldm8YFgTAYLMpRBM/Uc2lts28zQODIBFsAmAwt+0ahY3ZMMmGVCd1s/4R0l9GZbxrXA==","signatures":[{"sig":"MEYCIQDFG/qGR7mkzY8yDNkwOO4VzcqXfrl4pb2bTm9JbvkaKgIhAMR8hBZ6rVtrz1HdiM7ef6DJmNLc9SbcXDIn9TDr94R/","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":265418,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjASDnACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqNlg//SIY9BokbbE4roMzRq/qLZn55ilqDsgCBbfcwGexTocJ58VbH\r\nBFGNb77G2PtxWPjYtVsguBq3r7m8YT9mahMrcWm57TgBAiEOCkbBwvN/Z4lf\r\ndH/wgHOGffsJOzUheA8iKhWdjPp31+52SnJPChBz/hxj/sMzdCxTOV5LNX90\r\nF5cClYpsWukC/GdxhLol3OquFqWaL8fbDY/cDo1W85QImIJllcPmgGIKUZey\r\n0im2kI1Pcn5C4PIlnNxZaKLUQPS9BX+7/jHnIZiVH6ys0B5B/hC5nqmrzfz4\r\nGMST9KTZG/tjVtskxuEZt3qTmcjnrSR8ua4/vYeNd2O3rpZNu/Lpg8lyfU+9\r\nykhvK9NY5MEyivNW/qStKLgNmNn+JlJrfh3ohKM93nXAR/7Bv6BLwtl+F9/L\r\nWibvuhW68M1Eukyk5HKYSbA/KW/MLkR9VadY25cvORFMli+LR++6zkminPji\r\nO3cHoRagEOKOEMqtgDWonz7ixt0t/rZsxgfL//3WO8YSeWwSzLyN0wo9CP68\r\n91RZbH1lsa6karkM4QFR0J/qBh0xLIqzWK09M92Tgtt03/7y3FHE6roM25Mn\r\nx5dXF5f0314KeK8qaNA6KcsSCKjjO8MyDJF2NEM/Zo9TeT9o4TiD+NGMhKt/\r\n+xUl6WLGpIe+IqHHIJpk4nD3R5i+yfNAmfQ=\r\n=WDbR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=14"},"gitHead":"38f7fe0088ea852ecb0a8a5b4b5bcd00e68b5b25","scripts":{"tsc":"../../config/cli/ts-compile.sh","lint":"../../config/cli/lint.sh","tape":"tape -r ts-node/register","test":"npm run test:node && npm run test:browser","build":"../../config/cli/ts-build.sh","clean":"../../config/cli/clean-package.sh","coverage":"../../config/cli/coverage.sh","lint:fix":"../../config/cli/lint-fix.sh","lint:diff":"../../config/cli/lint-diff.sh","profiling":"tsc --target ES5 benchmarks/random.ts && 0x benchmarks/random.js","test:node":"tape -r ts-node/register 'test/**/*.ts'","benchmarks":"node -r ts-node/register --max-old-space-size=8024 benchmarks","docs:build":"typedoc --options typedoc.js","test:browser":"karma start karma.conf.js"},"_npmUser":{"name":"fvictorio","email":"victorio.franco@gmail.com"},"repository":{"url":"git+https://github.com/ethereumjs/ethereumjs-monorepo.git","type":"git"},"_npmVersion":"8.15.1","description":"This is an implementation of the modified merkle patricia tree as specified in Ethereum's yellow paper.","directories":{},"_nodeVersion":"14.19.3","dependencies":{"@ignored/rlp":"4.0.0-beta.5","@ignored/util":"8.0.0-beta.5","readable-stream":"^3.6.0","ethereum-cryptography":"^1.1.2"},"_hasShrinkwrap":false,"devDependencies":{"0x":"^4.9.1","lmdb":"^2.5.3","level":"^8.0.0","levelup":"^5.1.1","level-mem":"^6.0.1","micro-bmark":"0.2.0","level-legacy":"npm:level@^7.0.0","memory-level":"^1.0.0","abstract-level":"^1.0.3","@types/benchmark":"^1.0.33","@types/readable-stream":"^2.3.13"},"_npmOperationalInternal":{"tmp":"tmp/trie_5.0.0-beta.5_1661018343642_0.22112025592822326","host":"s3://npm-registry-packages"}},"5.0.0-beta.6":{"name":"@ignored/trie","version":"5.0.0-beta.6","keywords":["merkle","radix","trie","ethereum"],"author":{"name":"EthereumJS Team"},"license":"MPL-2.0","_id":"@ignored/trie@5.0.0-beta.6","maintainers":[{"name":"fvictorio","email":"victorio.franco@gmail.com"},{"name":"alcuadrado","email":"email@patriciopalladino.com"}],"contributors":[{"url":"https://github.com/kumavis","name":"Aaron Kumavis","email":"http://aaron.kumavis.me/"}],"homepage":"https://github.com/ethereumjs/ethereumjs-monorepo/tree/master/packages/trie#readme","bugs":{"url":"https://github.com/ethereumjs/ethereumjs-monorepo/issues?q=is%3Aissue+label%3A%22package%3A+trie%22"},"dist":{"shasum":"59bb5a79cca2c95742b7599f17d0e85c47dbe813","tarball":"https://registry.npmjs.org/@ignored/trie/-/trie-5.0.0-beta.6.tgz","fileCount":121,"integrity":"sha512-KnjEmPOvXxWUIT/UOSUAdOYUiEMpWQA/bhS4XjmdhHrI9pDmIC/p2sJFA5ZpEyCbnXZiE57LzEzXo1EKCqHIlg==","signatures":[{"sig":"MEYCIQDKMGdkkNBOQfkv25/9DZ6VauppKwD7zjAYRDpvr54UpAIhAN4gK9jEvDM380wfk29SWzIzWC/vkzTs5qAQtnU3tpPo","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":265340,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjASOmACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpVTg/6AlnEcjHB7pTlPFimtd42uXide3SDo6O9VXXPC6lmrGGkY9/c\r\n49c47mjllqBBdoRPmOYdhKDm2IpxaWorTbem2/O87ZqD5Mwx2dkSEVU8qJEr\r\nnaJqMt2WFkNPnfFdLMKp7PxTz974jh10FSX6Lhm6MUHiF41XTOpVUO0FkiI4\r\n/99bNkqacpz91WvLUgz8C/fsP/KPhD3HYqynuz558Y+gQQcV1N5a7CnKkBLa\r\nOcpoN8z1T3D4F4KNIPkg2ulCWa8VwrYyOyta2xJNd6DGVcyuuFmLBGiaqXlQ\r\npMucCNDFfFP1dHSS4qK5Q6uXiqHdQb6rz6MvaKW6c5c3HJpbHPkOK6l/jADk\r\np7U2NPqOVZ0rs/PSd0m/AGOgF/0IxMYhL92D79KubkBaPyXiU7b0v0MxBlWL\r\n5DIRjEHfigqsYuVOFzi7XmENc0UUX71ILWFnm4Ccvatr48kW00n9NTJg/TPh\r\nIEzG6E79rac7aT2LOI8TRUCNuGMFfmu3HBcata1VCtCr1PswaqUvOf8BR2YB\r\nGI9DSQjw8Pxiyfmbdq7rQ8tl95c0E2fUlpycDRITXcer388Qr9bQ2Ow8hZAa\r\nZTPCIiQ3q3hI9E+mt327h9MhHN/KpyfmHY/De9b2EY9MrodHnbf9ehqcAke6\r\nM/cHQy2LXE6dzVeF/D8JGkGuXK3rbZ84qas=\r\n=40bO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=14"},"gitHead":"38f7fe0088ea852ecb0a8a5b4b5bcd00e68b5b25","scripts":{"tsc":"../../config/cli/ts-compile.sh","lint":"../../config/cli/lint.sh","tape":"tape -r ts-node/register","test":"npm run test:node && npm run test:browser","build":"../../config/cli/ts-build.sh","clean":"../../config/cli/clean-package.sh","coverage":"../../config/cli/coverage.sh","lint:fix":"../../config/cli/lint-fix.sh","lint:diff":"../../config/cli/lint-diff.sh","profiling":"tsc --target ES5 benchmarks/random.ts && 0x benchmarks/random.js","test:node":"tape -r ts-node/register 'test/**/*.ts'","benchmarks":"node -r ts-node/register --max-old-space-size=8024 benchmarks","docs:build":"typedoc --options typedoc.js","test:browser":"karma start karma.conf.js"},"_npmUser":{"name":"fvictorio","email":"victorio.franco@gmail.com"},"repository":{"url":"git+https://github.com/ethereumjs/ethereumjs-monorepo.git","type":"git"},"_npmVersion":"8.15.1","description":"This is an implementation of the modified merkle patricia tree as specified in Ethereum's yellow paper.","directories":{},"_nodeVersion":"14.19.3","dependencies":{"@ignored/rlp":"4.0.0-beta.6","@ignored/util":"8.0.0-beta.6","readable-stream":"^3.6.0","ethereum-cryptography":"^1.1.2"},"_hasShrinkwrap":false,"devDependencies":{"0x":"^4.9.1","lmdb":"^2.5.3","level":"^8.0.0","levelup":"^5.1.1","level-mem":"^6.0.1","micro-bmark":"0.2.0","level-legacy":"npm:level@^7.0.0","memory-level":"^1.0.0","abstract-level":"^1.0.3","@types/benchmark":"^1.0.33","@types/readable-stream":"^2.3.13"},"_npmOperationalInternal":{"tmp":"tmp/trie_5.0.0-beta.6_1661019046138_0.5801544458604002","host":"s3://npm-registry-packages"}}},"time":{"created":"2022-08-17T15:12:06.710Z","modified":"2026-06-12T13:46:20.863Z","5.0.0-beta.3":"2022-08-17T15:12:06.996Z","5.0.0-beta.4":"2022-08-20T17:50:03.737Z","5.0.0-beta.5":"2022-08-20T17:59:03.775Z","5.0.0-beta.6":"2022-08-20T18:10:46.345Z"},"bugs":{"url":"https://github.com/ethereumjs/ethereumjs-monorepo/issues?q=is%3Aissue+label%3A%22package%3A+trie%22"},"author":{"name":"EthereumJS Team"},"license":"MPL-2.0","homepage":"https://github.com/ethereumjs/ethereumjs-monorepo/tree/master/packages/trie#readme","keywords":["merkle","radix","trie","ethereum"],"repository":{"url":"git+https://github.com/ethereumjs/ethereumjs-monorepo.git","type":"git"},"description":"This is an implementation of the modified merkle patricia tree as specified in Ethereum's yellow paper.","contributors":[{"url":"https://github.com/kumavis","name":"Aaron Kumavis","email":"http://aaron.kumavis.me/"}],"maintainers":[{"email":"john@kanej.me","name":"kanej"},{"email":"email@patriciopalladino.com","name":"alcuadrado"}],"readme":"# @ethereumjs/trie\n\n[![NPM Package][trie-npm-badge]][trie-npm-link]\n[![GitHub Issues][trie-issues-badge]][trie-issues-link]\n[![Actions Status][trie-actions-badge]][trie-actions-link]\n[![Code Coverage][trie-coverage-badge]][trie-coverage-link]\n[![Discord][discord-badge]][discord-link]\n\nThis is an implementation of the [Modified Merkle Patricia Trie](https://ethereum.org/en/developers/docs/data-structures-and-encoding/patricia-merkle-trie/) as specified in the [Ethereum Yellow Paper](http://gavwood.com/Paper.pdf):\n\n> The modified Merkle Patricia tree (trie) provides a persistent data structure to map between arbitrary-length binary data (byte arrays). It is defined in terms of a mutable data structure to map between 256-bit binary fragments and arbitrary-length binary data. The core of the trie, and its sole requirement in terms of the protocol specification, is to provide a single 32-byte value that identifies a given set of key-value pairs.\n\n## Installation\n\nTo obtain the latest version, simply require the project using `npm`:\n\n```shell\nnpm install @ethereumjs/trie\n```\n\n## Usage\n\nYou will find three variants of the [Modified Merkle Patricia Trie](https://ethereum.org/en/developers/docs/data-structures-and-encoding/patricia-merkle-trie/) implemented in this library, namely `BaseTrie`, `CheckpointTrie` and `SecureTrie`:\n\n- `CheckpointTrie` adds checkpointing functionality to the `BaseTrie` through the methods `checkpoint`, `commit` and `revert`\n- `SecureTrie` extends `CheckpointTrie` and is the most suitable variant for Ethereum applications. It stores values under the `keccak256` hash of their keys\n\nIt is best to select the variant that is most appropriate for your unique use case.\n\n### Initialization and Basic Usage\n\n```typescript\nimport { Trie, LevelDB } from '@ethereumjs/trie'\nimport { Level } from 'level'\n\nconst trie = new Trie({ db: new LevelDB(new Level('MY_TRIE_DB_LOCATION')) })\n\nasync function test() {\n  await trie.put(Buffer.from('test'), Buffer.from('one'))\n  const value = await trie.get(Buffer.from('test'))\n  console.log(value.toString()) // 'one'\n}\n\ntest()\n```\n\nYou can also review our [examples](https://github.com/ethereumjs/ethereumjs-monorepo/tree/master/packages/trie/examples) for database implementations. The [level.js](https://github.com/ethereumjs/ethereumjs-monorepo/tree/master/packages/trie/examples/level.js) example is the default implementation while [lmdb.js](https://github.com/ethereumjs/ethereumjs-monorepo/tree/master/packages/trie/examples/lmdb.js) is an alternative implementation that uses the popular [LMDB](https://en.wikipedia.org/wiki/Lightning_Memory-Mapped_Database) as its underlying database.\n\n> If no `db` option is provided, an in-memory database powered by [Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) will fulfill this role.\n\n### Database\n\n> By default the only supported database is LevelDB via the `level` module.\n\nThe 5.0.0 release introduced the `DB` interface to allow for the decoupling of the database layer from the previously tightly-coupled `LevelDB` integration. The `DB` interface defines the methods `get`, `put`, `del`, `batch` and `copy` that a concrete implementation of the `DB` interface will need to implement. The default implementation of the `DB` interface is now an in-memory storage based on the native [Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) and functions identically to pre-5.0.0 releases.\n\nThe base trie implementation (`Trie`) as well as all subclass implementations (`CheckpointTrie` and `SecureTrie`) accept any database implementation that adheres to the `DB` interface as the `db` option. It is possible to use alternative implementations like [LevelDB](#leveldb) if you wish to.\n\n#### Node Deletion\n\nBy default, the deletion of trie nodes from the underlying database does not occur in order to avoid corrupting older trie states (as of `v4.2.0`). Should you only wish to work with the latest state of a trie, you can switch to a delete behavior (for example, if you wish to save disk space) by using the `deleteFromDB` constructor option (see related release notes in the changelog for further details).\n\n#### Persistence\n\nYou can enable persistence by setting the `persistRoot` option to `true` when constructing a trie through the `Trie.create` function. As such, this value is preserved when creating copies of the trie and is incapable of being modified once a trie is instantiated.\n\n```typescript\nimport { Trie, LevelDB } from '@ethereumjs/trie'\nimport { Level } from 'level'\n\nconst trie = await Trie.create({\n  db: new LevelDB(new Level('MY_TRIE_DB_LOCATION')),\n  persistRoot: true,\n})\n```\n\nThe `Trie.create` function is asynchronous and will read the root from your database before returning the trie instance. If you don't have the need for automatic restoration of the root then you can use the `new Trie` constructor with the same options and get persistence without the automatic restoration.\n\n#### LevelDB\n\nIf you wish to continue to rely on `LevelDB` for all operations then you should create a file with the [following implementation from our recipes](./recipes//level.ts) in your project. It is then possible to use the `LevelDB` implementation as follows:\n\n```typescript\nimport { Trie } from '@ethereumjs/trie'\nimport { Level } from 'level'\n\nimport { LevelDB } from './your-level-implementation'\n\nconst trie = new Trie({ db: new LevelDB(new Level('MY_TRIE_DB_LOCATION')) })\n```\n\n## Proofs\n\n### Merkle Proofs\n\nThe `createProof` and `verifyProof` functions allow you to verify that a certain value does or does not exist within a Merkle Patricia Tree with a given root.\n\n#### Proof-of-Inclusion\n\nThe following code demonstrates how to construct and subsequently verify a proof that confirms the existence of the key `test` (which corresponds with the value `one`) within the given trie. This is also known as inclusion, hence the name 'Proof-of-Inclusion.'\n\n```typescript\nconst trie = new Trie()\n\nasync function test() {\n  await trie.put(Buffer.from('test'), Buffer.from('one'))\n  const proof = await trie.createProof(Buffer.from('test'))\n  const value = await trie.verifyProof(trie.root, Buffer.from('test'), proof)\n  console.log(value.toString()) // 'one'\n}\n\ntest()\n```\n\n#### Proof-of-Exclusion\n\nThe following code demonstrates how to construct and subsequently verify a proof that confirms that the key `test3` does not exist within the given trie. This is also known as exclusion, hence the name 'Proof-of-Exclusion.'\n\n```typescript\nconst trie = new Trie()\n\nasync function test() {\n  await trie.put(Buffer.from('test'), Buffer.from('one'))\n  await trie.put(Buffer.from('test2'), Buffer.from('two'))\n  const proof = await trie.createProof(Buffer.from('test3'))\n  const value = await trie.verifyProof(trie.root, Buffer.from('test3'), proof)\n  console.log(value.toString()) // null\n}\n\ntest()\n```\n\n#### Invalid Proofs\n\nIf `verifyProof` detects an invalid proof, it will throw an error. While contrived, the below example illustrates the resulting error condition in the event a prover tampers with the data in a merkle proof.\n\n```typescript\nconst trie = new Trie()\n\nasync function test() {\n  await trie.put(Buffer.from('test'), Buffer.from('one'))\n  await trie.put(Buffer.from('test2'), Buffer.from('two'))\n  const proof = await trie.createProof(Buffer.from('test2'))\n  proof[1].reverse()\n  try {\n    const value = await trie.verifyProof(trie.root, Buffer.from('test2'), proof)\n    console.log(value.toString()) // results in error\n  } catch (err) {\n    console.log(err) // Missing node in DB\n  }\n}\n\ntest()\n```\n\n### Range Proofs\n\nYou may use the `Trie.verifyRangeProof()` function to confirm if the given leaf nodes and edge proof possess the capacity to prove that the given trie leaves' range matches the specific root (which is useful for snap sync, for instance).\n\n## Read Stream on Geth DB\n\n```typescript\nimport { Level } from 'level'\nimport { SecureTrie, LevelDB } from '@ethereumjs/trie'\n\n// Set stateRoot to block #222\nconst stateRoot = '0xd7f8974fb5ac78d9ac099b9ad5018bedc2ce0a72dad1827a1709da30580f0544'\n// Convert the state root to a Buffer (strip the 0x prefix)\nconst stateRootBuffer = Buffer.from(stateRoot.slice(2), 'hex')\n// Initialize trie\nconst trie = new SecureTrie({\n  db: new LevelDB(new Level('YOUR_PATH_TO_THE_GETH_CHAIN_DB')),\n  root: stateRootBuffer,\n})\n\ntrie\n  .createReadStream()\n  .on('data', console.log)\n  .on('end', () => console.log('End.'))\n```\n\n## Read Account State Including Storage From Geth DB\n\n```typescript\nimport { Level } from 'level'\nimport { SecureTrie, LevelDB } from '@ethereumjs/trie'\nimport { Account, bufferToHex } from '@ethereumjs/util'\nimport { RLP } from '@ethereumjs/rlp'\n\nconst stateRoot = 'STATE_ROOT_OF_A_BLOCK'\n\nconst trie = new SecureTrie({ db: new LevelDB(new Level('YOUR_PATH_TO_THE_GETH_CHAINDATA_FOLDER', root: stateRoot })\n\nconst address = 'AN_ETHEREUM_ACCOUNT_ADDRESS'\n\nasync function test() {\n  const data = await trie.get(address)\n  const acc = Account.fromAccountData(data)\n\n  console.log('-------State-------')\n  console.log(`nonce: ${acc.nonce}`)\n  console.log(`balance in wei: ${acc.balance}`)\n  console.log(`storageRoot: ${bufferToHex(acc.stateRoot)}`)\n  console.log(`codeHash: ${bufferToHex(acc.codeHash)}`)\n\n  const storageTrie = trie.copy()\n  storageTrie.root = acc.stateRoot\n\n  console.log('------Storage------')\n  const stream = storageTrie.createReadStream()\n  stream\n    .on('data', (data) => {\n      console.log(`key: ${bufferToHex(data.key)}`)\n      console.log(`Value: ${bufferToHex(Buffer.from(RLP.decode(data.value)))}`)\n    })\n    .on('end', () => console.log('Finished reading storage.'))\n}\n\ntest()\n```\n\nYou can find additional examples complete with detailed explanations [here](./examples/README.md).\n\n## API\n\n### Docs\n\nGenerated TypeDoc API [Documentation](./docs/README.md)\n\n### BigInt Support\n\nWith the 5.0.0 release, [BigInt](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) takes the place of [BN.js](https://github.com/indutny/bn.js/).\n\nBigInt is a primitive that is used to represent and manipulate primitive `bigint` values that the number primitive is incapable of representing as a result of their magnitude. `ES2020` saw the introduction of this particular feature. Note that this version update resulted in the altering of number-related API signatures and that the minimal build target is now set to `ES2020`.\n\n## Testing\n\nYou may run tests for browsers and node.js using:\n\n```shell\nnpm run test\n```\n\nYou may run tests for browsers using:\n\n```shell\nnpm run test:browser\n```\n\n> Note that this requires an installation of [Mozilla Firefox](https://www.mozilla.org/en-US/firefox/new/), otherwise the tests will fail.\n\nYou may run tests for node.js using:\n\n```shell\nnpm run test:node\n```\n\n## Benchmarking\n\nYou will find two simple **benchmarks** in the `benchmarks` folder:\n\n- `random.ts` runs random `PUT` operations on the tree, and\n- `checkpointing.ts` runs checkpoints and commits between `PUT` operations\n\nA third benchmark using mainnet data to simulate real load is also being considered.\n\nYou may run benchmarks using:\n\n```shell\nnpm run benchmarks\n```\n\nTo run a **profiler** on the `random.ts` benchmark and generate a flamegraph with [0x](https://github.com/davidmarkclements/0x), you may use:\n\n```shell\nnpm run profiling\n```\n\n0x processes the stacks and generates a profile folder (`<pid>.0x`) containing [`flamegraph.html`](https://github.com/davidmarkclements/0x/blob/master/docs/ui.md).\n\n## References\n\n- Wiki\n  - [Ethereum Trie Specification](https://github.com/ethereum/wiki/wiki/Patricia-Tree)\n- Blog posts\n  - [Ethereum's Merkle Patricia Trees - An Interactive JavaScript Tutorial](https://rockwaterweb.com/ethereum-merkle-patricia-trees-javascript-tutorial/)\n  - [Merkling in Ethereum](https://blog.ethereum.org/2015/11/15/merkling-in-ethereum/)\n  - [Understanding the Ethereum Trie](https://easythereentropy.wordpress.com/2014/06/04/understanding-the-ethereum-trie/) (This is worth reading, but mind the outdated Python libraries)\n- Videos\n  - [Trie and Patricia Trie Overview](https://www.youtube.com/watch?v=jXAHLqQthKw&t=26s)\n\n## EthereumJS\n\nSee our organizational [documentation](https://ethereumjs.readthedocs.io) for an introduction to `EthereumJS` as well as information on current standards and best practices. If you want to join for work or carry out improvements on the libraries, please review our [contribution guidelines](https://ethereumjs.readthedocs.io/en/latest/contributing.html) first.\n\n## License\n\n[MPL-2.0](<https://tldrlegal.com/license/mozilla-public-license-2.0-(mpl-2)>)\n\n[discord-badge]: https://img.shields.io/static/v1?logo=discord&label=discord&message=Join&color=blue\n[discord-link]: https://discord.gg/TNwARpR\n[trie-npm-badge]: https://img.shields.io/npm/v/@ethereumjs/trie.svg\n[trie-npm-link]: https://www.npmjs.com/package/@ethereumjs/trie\n[trie-issues-badge]: https://img.shields.io/github/issues/ethereumjs/ethereumjs-monorepo/package:%20trie?label=issues\n[trie-issues-link]: https://github.com/ethereumjs/ethereumjs-monorepo/issues?q=is%3Aopen+is%3Aissue+label%3A\"package%3A+trie\"\n[trie-actions-badge]: https://github.com/ethereumjs/ethereumjs-monorepo/workflows/Trie/badge.svg\n[trie-actions-link]: https://github.com/ethereumjs/ethereumjs-monorepo/actions?query=workflow%3A%22Trie%22\n[trie-coverage-badge]: https://codecov.io/gh/ethereumjs/ethereumjs-monorepo/branch/master/graph/badge.svg?flag=trie\n[trie-coverage-link]: https://codecov.io/gh/ethereumjs/ethereumjs-monorepo/tree/master/packages/trie\n","readmeFilename":"README.md"}