{"id":25666090,"url":"https://github.com/functionally/marlowe-ici","last_synced_at":"2026-05-16T04:32:07.633Z","repository":{"id":81105194,"uuid":"487433545","full_name":"functionally/marlowe-ici","owner":"functionally","description":"This application is a decentralized, distributed chain index for Marlowe transactions on the Cardano blockchain.","archived":false,"fork":false,"pushed_at":"2024-01-28T03:14:22.000Z","size":6859,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-08-20T15:05:35.367Z","etag":null,"topics":["cardano","ipfs","ipld","marlowe","webrtc-star"],"latest_commit_sha":null,"homepage":"https://marlowe-ici.functionally.io/","language":"Haskell","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/functionally.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2022-05-01T03:11:46.000Z","updated_at":"2024-01-27T16:31:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"2c322059-8348-46e5-8c96-c85974cb77a8","html_url":"https://github.com/functionally/marlowe-ici","commit_stats":null,"previous_names":["functionally/marlowe-ici"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/functionally%2Fmarlowe-ici","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/functionally%2Fmarlowe-ici/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/functionally%2Fmarlowe-ici/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/functionally%2Fmarlowe-ici/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/functionally","download_url":"https://codeload.github.com/functionally/marlowe-ici/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240441955,"owners_count":19801793,"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":["cardano","ipfs","ipld","marlowe","webrtc-star"],"created_at":"2025-02-24T08:18:13.367Z","updated_at":"2026-05-16T04:32:07.601Z","avatar_url":"https://github.com/functionally.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\ntitle: Marlowe ILPD indexes\n---\n\n\n# IPLD indexes for Marlowe contracts and transactions\n\nThe following decentralized, distributed indexes of all Marlowe contracts and transactions on the public Cardano networks are updated each time a Marlowe transaction appears in a block.\n\n| Cardano Network | IPNS Path                                                                                                                                                     |\n|-----------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| mainnet         | [ipns://k51qzi5uqu5dhj6f1p3fvqsa5w8g9h0n743z09qgej8ospj168o8tnpjx0dvuc](https://ipfs.io/ipns/k51qzi5uqu5dhj6f1p3fvqsa5w8g9h0n743z09qgej8ospj168o8tnpjx0dvuc/) |\n| preprod         | [ipns://k51qzi5uqu5dj0n55cl386ll3cbkn455wq2ugweybi4c9qnc1439u2mtxzrpor](https://ipfs.io/ipns/k51qzi5uqu5dj0n55cl386ll3cbkn455wq2ugweybi4c9qnc1439u2mtxzrpor/) |\n| preview         | [ipns://k51qzi5uqu5djo1l6k36ij1fichepfdbrib9fdnt82qblf4mkf9t03u3q7na34](https://ipfs.io/ipns/k51qzi5uqu5djo1l6k36ij1fichepfdbrib9fdnt82qblf4mkf9t03u3q7na34/) |\n\nIf your IPFS node has difficulty resolving these IPNS links, use `ipfs swarm connect /ip4/thelio.functionally.dev/tcp/4001/p2p/12D3KooWDAbMfusVGjZKFBQT5ngJ5v7tGmo2XDRTAQs37Dgpb5W6` to assist their discovery.\n\n\n## Format\n\nCurrently, the root of the index contains five entries in IPLD's [DAG-CBOR](http://ipld.io.ipns.localhost:8080/docs/codecs/known/dag-cbor/) codec:\n\n- `tip`: information on the block with the most recent Marlowe transaction.\n- `contracts`: an index from contract ID to the list of transaction information for the contract.\n- `slots`: an index from slot number to list of the IDs of the contracts created in that slot.\n- `rolePolicies`: an index from the Marlowe role currency's policy ID to the list of the IDs of contracts using that policy.\n- `paymentKeys`: an index from the 28-byte payment credential hash to the list of IDs of contracts mentioning the corresponding address.\n\nThe indices are stored as a [radix trie](https://en.wikipedia.org/wiki/Radix_tree), so finding the key for a leaf involves concatenating the prefixes along the path to reach the leaf.\n\n\n## Limitations\n\n[The indexing software](https://github.com/bwbush/marlowe-ici) currently has the following limitations:\n\n- The payment credentials in merkleized continuations of contracts are not indexed.\n- Rollbacks of transactions are not handled gracefully.\n- The transaction index number in contract IDs is padded with leading zeros.\n\n\n## Building\n\nUse `nix build github:bwbush/marlowe-ici#marlowe-ici` to build using Nix.\n\nThe `marlowe-ici` tool can also be build with GHC 9.2.8, with or without a Nix environment:\n\n```bash\nnix develop\ncabal build\n```\n\n\n## Running\n\nThis tool requires a connection to the `marlowe-proxy` service of [Marlowe Runtime](https://input-output-hk/marlowe-cardano).\n\nUse `nix run github:bwbush/marlowe-ici#marlowe-ici` to run using Nix.\n\n```bash\nmarlowe-ici --help\n```\n\n```console\nmarlowe-ici : build IPLD indexes for Marlowe\n\nUsage: marlowe-ici [--version] [--host HOST] [--port PORT] --ipns-key KEY_NAME \n                   [--chunk-size INTEGER] [--batch-size INTEGER] \n                   [--batch-slot SLOT_NO]\n\n  This command-line tool builds and publishes IPLD indexes of Marlowe contracts\n  and transactions.\n\nAvailable options:\n  -h,--help                Show this help text\n  --version                Show version\n  --host HOST              Host for Marlowe proxy service.\n                           (default: \"localhost\")\n  --port PORT              Port for Marlowe proxy service. (default: 3700)\n  --ipns-key KEY_NAME      The name of the IPNS key for publishing.\n  --chunk-size INTEGER     The chunk size for IPFS CAR files. (default: 1000)\n  --batch-size INTEGER     The batch size for the initial IPLD puts.\n                           (default: 1000)\n  --batch-slot SLOT_NO     The last slot for batching IPLD puts.\n                           (default: 35000000)\n```\n\n\n## Examples\n\nThe IPFS explorer provides a convenient graphical interface for navigating the indexes.\n\n![View of the root index in the IPFS explorer](ipfs-explorer.png)\n\n\n### View the root of the indices\n\n```bash\nipfs dag get /ipns/k51qzi5uqu5dj0n55cl386ll3cbkn455wq2ugweybi4c9qnc1439u2mtxzrpor | json2yaml\n```\n\n```yaml\ncontracts:\n  /: bafyreici5vayozdmedwjjqmhbjj3pci5xlg3oo4gqaatqpw7ke3ueyir54\npaymentKeys:\n  /: bafyreiddymhv64su3opkm2jahzhzvwrzlezvyyqme4h33t2b7rc7hnldym\nrolePolicies:\n  /: bafyreibyvtru3z6tppqskagzksw33dfk6sly4d6z5mdjicuvwd3oxpugcu\nslots:\n  /: bafyreifkmehnkjh77qsoxebvtpzahh6ewh2krz6wdmrnhi57q3oh4fzmwu\ntip:\n  /: bafyreihm4isuj5tjug25rloyag4vucficforrhq5mwdbzmle46fepm4ilq\n```\n\n\n### View the block information for the most recent Marlowe transaction\n\n```bash\nipfs dag get /ipns/k51qzi5uqu5dj0n55cl386ll3cbkn455wq2ugweybi4c9qnc1439u2mtxzrpor/tip | json2yaml\n```\n\n```yaml\nblockNo: 1819531\nheaderHash: 7682edf2ccff5142680fec4a9dc358aeaab47a401b95f69d6380930a2a3fe991\nslotNo: 49649342\n```\n\n\n### View the transaction information for a particular contract\n\nLet us find information for the Marlowe contract [f1b8e8a7e99b2cc890bde4ad190f29a30a8cb83b3d50d986af88433128fb756e#]().\n\n```bash\nipfs dag get /ipns/k51qzi5uqu5dj0n55cl386ll3cbkn455wq2ugweybi4c9qnc1439u2mtxzrpor/contracts/f1/b8/e8a7e99b2cc890bde4ad190f29a30a8cb83b3d50d986af88433128fb756e#001 | json2yaml\n```\n\n```yaml\nitems:\n- /: bafyreievgbcav6crglhxkxbb4od2lnufsut6onbb4ixxdw23hdtvm27o6q\n- /: bafyreibd7aflotva5zxxwjzb3fhi4ll6tm6fh244b32zsyiubbyr65vzai\n- /: bafyreicwutsbmehfcqyunezgfmy42bajj7muam2xruekom7palkmwyjb6e\n```\n\nThe creation transaction is first in the list.\n\n```bash\nipfs dag get /ipfs/bafyreievgbcav6crglhxkxbb4od2lnufsut6onbb4ixxdw23hdtvm27o6q | json2yaml\n```\n\n```yaml\ncreateStep:\n  createOutput:\n    address: 706a9391d6aa51af28dd876ebb5565b69d1e83e5ac7861506bd29b56b0\n    assets:\n      ada: 1500000\n      tokens: []\n    datum:\n      marloweContract:\n        timeout: 1672428743000\n        timeout_continuation: close\n        when:\n        - case:\n            choose_between:\n            - from: 0\n              to: 1000000000000000000\n            for_choice:\n              choice_name: ADAGBP\n              choice_owner:\n                address: addr_test1qqzg379vgpjnm3n5kffdqq86sr6veng453rfnu07c8y9umdn3kr657fpa3q8mzwmjqvl9lqdn9g2pm3ejhlgwpprwy2swc7lhj\n          then:\n            timeout: 1672428743000\n            timeout_continuation: close\n            when:\n            - case:\n                choose_between:\n                - from: 0\n                  to: 1000000000000000000\n                for_choice:\n                  choice_name: ADAJPY\n                  choice_owner:\n                    address: addr_test1qqzg379vgpjnm3n5kffdqq86sr6veng453rfnu07c8y9umdn3kr657fpa3q8mzwmjqvl9lqdn9g2pm3ejhlgwpprwy2swc7lhj\n              then: close\n      marloweParams:\n        rolesCurrency: ''\n      marloweState:\n        accounts:\n        - - - address: addr_test1qp5e9feu4hkp4qwvgqasq02na05z3eg33zzjquf2d86e6qzznwng4gtlladnxm7d486psa003jy6dv230t82rvv3pflq62lz84\n            - currency_symbol: ''\n              token_name: ''\n          - 1500000\n        boundValues: []\n        choices: []\n        minTime: 0\n    utxo:\n      txId: f1b8e8a7e99b2cc890bde4ad190f29a30a8cb83b3d50d986af88433128fb756e\n      txIx: 1\n  metadata:\n    marloweMetadata: null\n    transactionMetadata: {}\n  payoutValidatorHash: 49076eab20243dc9462511fb98a9cfb719f86e9692288139b7c91df3\nversion: v1\n```\n\nThat is followed by an application of inputs.\n\n```bash\nipfs dag get /ipfs/bafyreibd7aflotva5zxxwjzb3fhi4ll6tm6fh244b32zsyiubbyr65vzai | json2yaml\n```\n\n```yaml\nmarloweInput:\n  marloweAddress: 706a9391d6aa51af28dd876ebb5565b69d1e83e5ac7861506bd29b56b0\n  marloweVersion: v1\n  payoutValidatorHash: 49076eab20243dc9462511fb98a9cfb719f86e9692288139b7c91df3\n  txOutRef:\n    txId: f1b8e8a7e99b2cc890bde4ad190f29a30a8cb83b3d50d986af88433128fb756e\n    txIx: 1\nmarloweTransaction:\n  blockHeader:\n    blockNo: 461521\n    headerHash: 1b1bb2ac4dc26e065f5352884e35adfebbdba1ab02c79185fd3aae388c7bcf41\n    slotNo: 16729920\n  contractId: f1b8e8a7e99b2cc890bde4ad190f29a30a8cb83b3d50d986af88433128fb756e#1\n  inputs:\n  - for_choice_id:\n      choice_name: ADAGBP\n      choice_owner:\n        address: addr_test1qqzg379vgpjnm3n5kffdqq86sr6veng453rfnu07c8y9umdn3kr657fpa3q8mzwmjqvl9lqdn9g2pm3ejhlgwpprwy2swc7lhj\n    input_that_chooses_num: 20012200\n  metadata:\n    marloweMetadata: null\n    transactionMetadata: {}\n  output:\n    payouts: []\n    scriptOutput:\n      address: 706a9391d6aa51af28dd876ebb5565b69d1e83e5ac7861506bd29b56b0\n      assets:\n        ada: 1500000\n        tokens: []\n      datum:\n        marloweContract:\n          timeout: 1672428743000\n          timeout_continuation: close\n          when:\n          - case:\n              choose_between:\n              - from: 0\n                to: 1000000000000000000\n              for_choice:\n                choice_name: ADAJPY\n                choice_owner:\n                  address: addr_test1qqzg379vgpjnm3n5kffdqq86sr6veng453rfnu07c8y9umdn3kr657fpa3q8mzwmjqvl9lqdn9g2pm3ejhlgwpprwy2swc7lhj\n            then: close\n        marloweParams:\n          rolesCurrency: ''\n        marloweState:\n          accounts:\n          - - - address: addr_test1qp5e9feu4hkp4qwvgqasq02na05z3eg33zzjquf2d86e6qzznwng4gtlladnxm7d486psa003jy6dv230t82rvv3pflq62lz84\n              - currency_symbol: ''\n                token_name: ''\n            - 1500000\n          boundValues: []\n          choices:\n          - - choice_name: ADAGBP\n              choice_owner:\n                address: addr_test1qqzg379vgpjnm3n5kffdqq86sr6veng453rfnu07c8y9umdn3kr657fpa3q8mzwmjqvl9lqdn9g2pm3ejhlgwpprwy2swc7lhj\n            - 20012200\n          minTime: 1672413064000\n      utxo:\n        txId: 580fdc2eea09123cd137c06e61fab8263a79a507454797a59ba57a4166b87581\n        txIx: 1\n  transactionId: 580fdc2eea09123cd137c06e61fab8263a79a507454797a59ba57a4166b87581\n  validityLowerBound: '2022-12-30T15:11:04Z'\n  validityUpperBound: '2022-12-30T19:32:23Z'\nmarloweVersion: v1\n```\n\nThe final transaction closes the contract.\n\n```bash\nipfs dag get /ipfs/bafyreicwutsbmehfcqyunezgfmy42bajj7muam2xruekom7palkmwyjb6e | json2yaml\n```\n\n```yaml\nmarloweInput:\n  marloweAddress: 706a9391d6aa51af28dd876ebb5565b69d1e83e5ac7861506bd29b56b0\n  marloweVersion: v1\n  payoutValidatorHash: 49076eab20243dc9462511fb98a9cfb719f86e9692288139b7c91df3\n  txOutRef:\n    txId: 580fdc2eea09123cd137c06e61fab8263a79a507454797a59ba57a4166b87581\n    txIx: 1\nmarloweTransaction:\n  blockHeader:\n    blockNo: 461524\n    headerHash: 1ff4153202ee464c37bfc9cf0c162e2c20bae2006f81c16fb596431b6ff85d5a\n    slotNo: 16729957\n  contractId: f1b8e8a7e99b2cc890bde4ad190f29a30a8cb83b3d50d986af88433128fb756e#1\n  inputs:\n  - for_choice_id:\n      choice_name: ADAJPY\n      choice_owner:\n        address: addr_test1qqzg379vgpjnm3n5kffdqq86sr6veng453rfnu07c8y9umdn3kr657fpa3q8mzwmjqvl9lqdn9g2pm3ejhlgwpprwy2swc7lhj\n    input_that_chooses_num: 3184000000\n  metadata:\n    marloweMetadata: null\n    transactionMetadata: {}\n  output:\n    payouts: []\n    scriptOutput: null\n  transactionId: 407c29a8a36e285933491cef8cb839f39b4bf8a50cc113a00335dd01418a4441\n  validityLowerBound: '2022-12-30T15:12:30Z'\n  validityUpperBound: '2022-12-30T19:32:23Z'\nmarloweVersion: v1\n```\n\n### Find the contracts for an address\n\nFirst determine the 28 bytes of the payment credential.\n\n```bash\nmarlowe-cli util decode-bech32 addr_test1qqzg379vgpjnm3n5kffdqq86sr6veng453rfnu07c8y9umdn3kr657fpa3q8mzwmjqvl9lqdn9g2pm3ejhlgwpprwy2swc7lhj\n```\n\n```console\nHuman-readable part: addr_test\n000488f8ac40653dc674b252d000fa80f4cccd15a44699f1fec1c85e6db38d87aa7921ec407d89db9019f2fc0d9950a0ee3995fe8704237115\n```\n\nThus, the payment credential is `0488f8ac40653dc674b252d000fa80f4cccd15a44699f1fec1c85e6d`.\n\nNow fetch the list of contract IDs associated with this credential.\n\n```bash\nipfs dag get /ipns/k51qzi5uqu5dj0n55cl386ll3cbkn455wq2ugweybi4c9qnc1439u2mtxzrpor/paymentKeys/04/88/f8ac40653dc674b252d000fa80f4cccd15a44699f1fec1c85e6d | json2yaml | wc -l\n```\n\n```console\n77\n```\n\n\n### Find the contracts for a give roles currency policy ID\n\nLet us find the first contract ID that uses the roles currency `a30c223ccc19df287ece74e257b9ebb802e6b863c756d2e6ac4c0054`.\n\n```bash\nipfs dag get /ipns/k51qzi5uqu5dj0n55cl386ll3cbkn455wq2ugweybi4c9qnc1439u2mtxzrpor/rolePolicies/a3/0c/223ccc19df287ece74e257b9ebb802e6b863c756d2e6ac4c0054/items/0            \n```\n\n```console\n\"ede51604c76c6aca4227a2b39f287934e62543b4845cd48ffd955f6d71c6a643#1\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffunctionally%2Fmarlowe-ici","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffunctionally%2Fmarlowe-ici","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffunctionally%2Fmarlowe-ici/lists"}