{"id":13428295,"url":"https://github.com/IntersectMBO/cardano-addresses","last_synced_at":"2025-03-16T01:32:10.351Z","repository":{"id":37394541,"uuid":"242097174","full_name":"IntersectMBO/cardano-addresses","owner":"IntersectMBO","description":"Addresses and mnemonic manipulation \u0026 derivations","archived":false,"fork":false,"pushed_at":"2025-03-03T05:51:31.000Z","size":85091,"stargazers_count":156,"open_issues_count":7,"forks_count":50,"subscribers_count":41,"default_branch":"master","last_synced_at":"2025-03-09T19:11:53.913Z","etag":null,"topics":["address","cardano","hierarchical-deterministic-wallets","mnemonic"],"latest_commit_sha":null,"homepage":"","language":"Haskell","has_issues":true,"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/IntersectMBO.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-02-21T09:04:23.000Z","updated_at":"2025-03-03T05:50:09.000Z","dependencies_parsed_at":"2023-02-10T21:30:29.190Z","dependency_job_id":"c07b0da7-ff35-41be-8f6b-d7947a4a16cb","html_url":"https://github.com/IntersectMBO/cardano-addresses","commit_stats":{"total_commits":917,"total_committers":30,"mean_commits":"30.566666666666666","dds":0.5136314067611778,"last_synced_commit":"231ecb2c7e7dd64ab3ffe5fcc1272a49e6d15a8f"},"previous_names":["intersectmbo/cardano-addresses","input-output-hk/cardano-addresses"],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IntersectMBO%2Fcardano-addresses","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IntersectMBO%2Fcardano-addresses/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IntersectMBO%2Fcardano-addresses/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IntersectMBO%2Fcardano-addresses/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IntersectMBO","download_url":"https://codeload.github.com/IntersectMBO/cardano-addresses/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243814900,"owners_count":20352037,"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":["address","cardano","hierarchical-deterministic-wallets","mnemonic"],"created_at":"2024-07-31T01:00:51.598Z","updated_at":"2025-03-16T01:32:10.344Z","avatar_url":"https://github.com/IntersectMBO.png","language":"Haskell","funding_links":[],"categories":["Uncategorized","Haskell"],"sub_categories":["Uncategorized"],"readme":"\u003cp align=\"center\"\u003e\n  \u003cbig\u003e\u003cstrong\u003eCardano Addresses\u003c/strong\u003e\u003c/big\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/IntersectMBO/cardano-addresses/releases\"\u003e\u003cimg src=\"https://img.shields.io/github/v/release/IntersectMBO/cardano-addresses?color=%239b59b6\u0026label=RELEASE\u0026sort=semver\u0026style=for-the-badge\"/\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/cardano-addresses\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/cardano-addresses?color=%239b59b6\u0026style=for-the-badge\"/\u003e\u003c/a\u003e\n  \u003ca href=\"https://IntersectMBO.github.io/cardano-addresses/coverage/hpc_index.html\"\u003e\u003cimg src=\"https://IntersectMBO.github.io/cardano-addresses/coverage/badge.svg\" /\u003e\u003c/a\u003e\n  \u003cbr\u003e\n\u003c/p\u003e\n\n\n\u003cdiv align=\"center\"\u003e\n\n  \u003ca href=\"\"\u003e[![Coding Standards](https://github.com/IntersectMBO/cardano-addresses/actions/workflows/style.yml/badge.svg?branch=master)](https://github.com/IntersectMBO/cardano-addresses/actions/workflows/style.yml)\u003c/a\u003e\n  \u003ca href=\"\"\u003e[![Haskell CI using Cabal](https://github.com/IntersectMBO/cardano-addresses/actions/workflows/haskell.yml/badge.svg)](https://github.com/IntersectMBO/cardano-addresses/actions/workflows/haskell.yml)\u003c/a\u003e\n\n\u003c/div\u003e\n\n## Overview\n\nThis module provides mnemonic (backup phrase) creation, and conversion of a\nmnemonic to seed for wallet restoration, and address derivation functionalities.\n\n![](.github/example.gif)\n\n## Documentation\n\nAPI documentation is available [here](https://IntersectMBO.github.io/cardano-addresses/haddock).\n\n## Command-Line\n\n`cardano-address` comes with a command-line interface for Linux. See the [release artifacts](https://github.com/IntersectMBO/cardano-addresses/releases) or [continuous integration artifacts](https://github.com/IntersectMBO/cardano-addresses/actions?query=workflow%3A%22Continuous+Integration%22) to get a pre-compiled binary, or [build a Docker image](#docker-image). The command-line is self explanatory by using `--help` on various commands and sub-commands.\n\n\u003e :bulb: Most commands read argument from the standard input. This prevent sensitive information from appearing into your shell history and, makes it easy to pipe commands!\n\n### How to generate a recovery phrase (\u003cstrong\u003ephrase.prv\u003c/strong\u003e)\n\n```console\n$ cardano-address recovery-phrase generate --size 15 \u003e phrase.prv\nexercise club noble adult miracle awkward problem olympic puppy private goddess piano fatal fashion vacuum\n```\n\n\n### How to generate a root private key (\u003cstrong\u003eroot.xsk\u003c/strong\u003e)\n\n```console\n$ cardano-address key from-recovery-phrase Shelley \u003c phrase.prv \u003e root.xsk\nroot_xsk1hqzfzrgskgnpwskxxrv5khs7ess82ecy8za9l5ef7e0afd2849p3zryje8chk39nxtva0sww5me3pzkej4rvd5cae3q3v8eu7556n6pdrp4fdu8nsglynpmcppxxvfdyzdz5gfq3fefjepxhvqspmuyvmvqg8983\n\n-- which is equivalent to empty passphrase\n$ cardano-address key from-recovery-phrase Shelley --passphrase from-hex\nPlease enter a [9, 12, 15, 18, 21, 24] word mnemonic:\nexercise club noble adult miracle awkward problem olympic puppy private goddess piano fatal fashion vacuum\nPlease enter hex-encoded passphrase:\n\nroot_xsk1hqzfzrgskgnpwskxxrv5khs7ess82ecy8za9l5ef7e0afd2849p3zryje8chk39nxtva0sww5me3pzkej4rvd5cae3q3v8eu7556n6pdrp4fdu8nsglynpmcppxxvfdyzdz5gfq3fefjepxhvqspmuyvmvqg8983\n```\n\n\u003e :information_source: Notice the `root_xsk` prefix to identify a root extended signing (private) key.\n\n\n### How to generate a root private key with passphrase (\u003cstrong\u003eroot.xsk\u003c/strong\u003e)\n\n```console\n$ cardano-address recovery-phrase generate --size 9 \u003e sndfactor.prv\nswing payment diagram happy chimney mammal flip become lyrics\n\n$ cardano-address key from-recovery-phrase Shelley --passphrase from-mnemonic\nPlease enter a [9, 12, 15, 18, 21, 24] word mnemonic:\nexercise club noble adult miracle awkward problem olympic puppy private goddess piano fatal fashion vacuum\nPlease enter a 9–12 word second factor:\nswing payment diagram happy chimney mammal flip become lyrics\nroot_xsk1jqx0xpke7de69ceyk20tdl9rq7nsava7cfnyeu42yqum8usnpppwmsxn2qsfj0nn2ur2kuq0kmrll67ryvkdhd6pgpsls6s6qx7hlyv6uqt0907t73eflkpw3xz45lcg5fsh6dunfk56j08jslh6x6rttspfny8c\n\n cardano-address key from-recovery-phrase Shelley --passphrase from-mnemonic --sensitive\nPlease enter a [9, 12, 15, 18, 21, 24] word mnemonic:\n**********************************************************************************************************\nPlease enter a 9–12 word second factor:\n*************************************************************\nroot_xsk1jqx0xpke7de69ceyk20tdl9rq7nsava7cfnyeu42yqum8usnpppwmsxn2qsfj0nn2ur2kuq0kmrll67ryvkdhd6pgpsls6s6qx7hlyv6uqt0907t73eflkpw3xz45lcg5fsh6dunfk56j08jslh6x6rttspfny8c\n\n$ cardano-address key from-recovery-phrase Shelley --passphrase from-mnemonic --silent\nPlease enter a [9, 12, 15, 18, 21, 24] word mnemonic:\n\nPlease enter a 9–12 word second factor:\n\nroot_xsk1jqx0xpke7de69ceyk20tdl9rq7nsava7cfnyeu42yqum8usnpppwmsxn2qsfj0nn2ur2kuq0kmrll67ryvkdhd6pgpsls6s6qx7hlyv6uqt0907t73eflkpw3xz45lcg5fsh6dunfk56j08jslh6x6rttspfny8c\n\n$ cardano-address key from-recovery-phrase Shelley --passphrase from-mnemonic --from-file \"./sndfactor.prv\" \u003c phrase.prv\nroot_xsk1jqx0xpke7de69ceyk20tdl9rq7nsava7cfnyeu42yqum8usnpppwmsxn2qsfj0nn2ur2kuq0kmrll67ryvkdhd6pgpsls6s6qx7hlyv6uqt0907t73eflkpw3xz45lcg5fsh6dunfk56j08jslh6x6rttspfny8c\n\n$ cardano-address key from-recovery-phrase Shelley --passphrase from-hex\nPlease enter a [9, 12, 15, 18, 21, 24] word mnemonic:\nexercise club noble adult miracle awkward problem olympic puppy private goddess piano fatal fashion vacuum\nPlease enter hex-encoded passphrase:\ndc1434f3b472810d56409f85\nroot_xsk1jqx0xpke7de69ceyk20tdl9rq7nsava7cfnyeu42yqum8usnpppwmsxn2qsfj0nn2ur2kuq0kmrll67ryvkdhd6pgpsls6s6qx7hlyv6uqt0907t73eflkpw3xz45lcg5fsh6dunfk56j08jslh6x6rttspfny8c\n\n$ echo \"dc1434f3b472810d56409f85\" \u003e base16.prv\n$ cardano-address key from-recovery-phrase Shelley --passphrase from-hex --from-file \"./base16.prv\" \u003c phrase.prv\nroot_xsk1jqx0xpke7de69ceyk20tdl9rq7nsava7cfnyeu42yqum8usnpppwmsxn2qsfj0nn2ur2kuq0kmrll67ryvkdhd6pgpsls6s6qx7hlyv6uqt0907t73eflkpw3xz45lcg5fsh6dunfk56j08jslh6x6rttspfny8c\n\n$ cardano-address key from-recovery-phrase Shelley --passphrase from-base64\nPlease enter a [9, 12, 15, 18, 21, 24] word mnemonic:\nexercise club noble adult miracle awkward problem olympic puppy private goddess piano fatal fashion vacuum\nPlease enter base64-encoded passphrase:\n3BQ087RygQ1WQJ+F\nroot_xsk1jqx0xpke7de69ceyk20tdl9rq7nsava7cfnyeu42yqum8usnpppwmsxn2qsfj0nn2ur2kuq0kmrll67ryvkdhd6pgpsls6s6qx7hlyv6uqt0907t73eflkpw3xz45lcg5fsh6dunfk56j08jslh6x6rttspfny8c\n\n$ echo \"3BQ087RygQ1WQJ+F\" \u003e base64.prv\n$ cardano-address key from-recovery-phrase Shelley --passphrase from-base64 --from-file \"./base64.prv\" \u003c phrase.prv\nroot_xsk1jqx0xpke7de69ceyk20tdl9rq7nsava7cfnyeu42yqum8usnpppwmsxn2qsfj0nn2ur2kuq0kmrll67ryvkdhd6pgpsls6s6qx7hlyv6uqt0907t73eflkpw3xz45lcg5fsh6dunfk56j08jslh6x6rttspfny8c\n\n$ cardano-address key from-recovery-phrase Shelley --passphrase from-octets\nPlease enter a [9, 12, 15, 18, 21, 24] word mnemonic:\nexercise club noble adult miracle awkward problem olympic puppy private goddess piano fatal fashion vacuum\nPlease enter passphrase in the form of octet array:\n[220,20,52,243,180,114,129,13,86,64,159,133]\nroot_xsk1jqx0xpke7de69ceyk20tdl9rq7nsava7cfnyeu42yqum8usnpppwmsxn2qsfj0nn2ur2kuq0kmrll67ryvkdhd6pgpsls6s6qx7hlyv6uqt0907t73eflkpw3xz45lcg5fsh6dunfk56j08jslh6x6rttspfny8c\n\n$ echo \"[220,20,52,243,180,114,129,13,86,64,159,133]\" \u003e octets.prv\n$ cardano-address key from-recovery-phrase Shelley --passphrase from-octets --from-file \"./octets.prv\" \u003c phrase.prv\nroot_xsk1jqx0xpke7de69ceyk20tdl9rq7nsava7cfnyeu42yqum8usnpppwmsxn2qsfj0nn2ur2kuq0kmrll67ryvkdhd6pgpsls6s6qx7hlyv6uqt0907t73eflkpw3xz45lcg5fsh6dunfk56j08jslh6x6rttspfny8c\n\n$ cardano-address key from-recovery-phrase Shelley --passphrase from-utf8\nPlease enter a [9, 12, 15, 18, 21, 24] word mnemonic:\nexercise club noble adult miracle awkward problem olympic puppy private goddess piano fatal fashion vacuum\nPlease enter utf8-encoded passphrase:\nmy secret passphrase\nroot_xsk1aq5jduvnx7s6a4wl845jggvnhey5agqjv55dsexsx43np59pse0u4yfxpdfecz9h95jwecduqpt7zlk97j9mprmvjcfeyrcu9nyagpjq6k5cxpnwve5pj3cu24m9my94xtrqvzrlmu0893guffzazyk95cvprwzp\n\n$ cardano-address key from-recovery-phrase Shelley --passphrase \"\"\nPlease enter a [9, 12, 15, 18, 21, 24] word mnemonic:\nexercise club noble adult miracle awkward problem olympic puppy private goddess piano fatal fashion vacuum\nPlease enter utf8-encoded passphrase:\nmy secret passphrase\nroot_xsk1aq5jduvnx7s6a4wl845jggvnhey5agqjv55dsexsx43np59pse0u4yfxpdfecz9h95jwecduqpt7zlk97j9mprmvjcfeyrcu9nyagpjq6k5cxpnwve5pj3cu24m9my94xtrqvzrlmu0893guffzazyk95cvprwzp\n\n$ echo \"my secret passphrase\" \u003e utf8.prv\n$ cardano-address key from-recovery-phrase Shelley --passphrase from-utf8 --from-file \"./utf8.prv\" \u003c phrase.prv\nroot_xsk1aq5jduvnx7s6a4wl845jggvnhey5agqjv55dsexsx43np59pse0u4yfxpdfecz9h95jwecduqpt7zlk97j9mprmvjcfeyrcu9nyagpjq6k5cxpnwve5pj3cu24m9my94xtrqvzrlmu0893guffzazyk95cvprwzp\n\n-- NOTE:\n--λ\u003e let (Right m) = mkSomeMnemonic @'[ 9 ] [\"swing\", \"payment\", \"diagram\", \"happy\", \"chimney\", \"mammal\", \"flip\", \"become\", \"lyrics\"]\n--λ\u003e m\n--SomeMnemonic (Mnemonic {mnemonicToEntropy = Entropy {entropyRaw = \"\\220\\DC44\\243\\180r\\129\\rV@\\159\\133\", entropyChecksum = Checksum 3}, mnemonicToSentence = MnemonicSentence {mnemonicSentenceToListN = [WordIndex {unWordIndex = Offset 1760},WordIndex {unWordIndex = Offset 1293},WordIndex {unWordIndex = Offset 487},WordIndex {unWordIndex = Offset 839},WordIndex {unWordIndex = Offset 320},WordIndex {unWordIndex = Offset 1077},WordIndex {unWordIndex = Offset 712},WordIndex {unWordIndex = Offset 159},WordIndex {unWordIndex = Offset 1067}]}})\n--λ\u003e let bytes = BA.convert $ someMnemonicToBytes m :: ByteString\n--λ\u003e bytes\n--\"\\220\\DC44\\243\\180r\\129\\rV@\\159\\133\"\n--λ\u003e encode EBase16 bytes\n--\"dc1434f3b472810d56409f85\"\n--λ\u003e decodeUtf8 $ convertToBase Base64 bytes\n-- \"3BQ087RygQ1WQJ+F\"\n--λ\u003e BS.unpack bytes\n-- [220,20,52,243,180,114,129,13,86,64,159,133]\n```\n\u003e :information_source: Notice the `root_xsk` prefix to identify a root extended signing (private) key.\n\n\n\n### How to generate a wallet id based on extended root or account keys (\u003cstrong\u003ephrase.prv\u003c/strong\u003e)\n\n```console\n$ cat root.xsk\nroot_xsk1hqzfzrgskgnpwskxxrv5khs7ess82ecy8za9l5ef7e0afd2849p3zryje8chk39nxtva0sww5me3pzkej4rvd5cae3q3v8eu7556n6pdrp4fdu8nsglynpmcppxxvfdyzdz5gfq3fefjepxhvqspmuyvmvqg8983\n$ cardano-address key walletid \u003c root.xsk\n163ea20ad0611e4815a61c44bb32c82a81538999\n\n$ cardano-address key public --with-chain-code \u003c root.xsk | cardano-address key walletid\n163ea20ad0611e4815a61c44bb32c82a81538999\n\n$ cardano-address key child 1852H/1815H/0H \u003c root.xsk \u003e acct.xsk\n$ cat acct.xsk\nacct_xsk15ztha8ws7qjze5vmdkwqh0ddzvtlgstkg79swazhc5lxns2849plr3msjx082mcmd9hc24ujczk2cjnjwrcz4tjaucw9jqf8h5yc7d84rac0zdckkuhazpam0kleg4sq52ph3e0wn98a64hr8g5cpmh9zqpwtrhy\n$ cardano-address key walletid \u003c acct.xsk\n15fd6c2130b0758ec7995bf9771d2a6602417c39\n$ cardano-address key public --with-chain-code \u003c acct.xsk | cardano-address key walletid\n15fd6c2130b0758ec7995bf9771d2a6602417c39\n```\n\n\n### How to generate a wallet id based on account keys of shared wallet (\u003cstrong\u003ephrase.prv\u003c/strong\u003e)\n\n```console\n$ cardano-address key from-recovery-phrase Shared \u003c phrase.prv \u003e root.shared_xsk\nroot_shared_xsk1hqzfzrgskgnpwskxxrv5khs7ess82ecy8za9l5ef7e0afd2849p3zryje8chk39nxtva0sww5me3pzkej4rvd5cae3q3v8eu7556n6pdrp4fdu8nsglynpmcppxxvfdyzdz5gfq3fefjepxhvqspmuyvmvzteqlc\n\n$ cardano-address key child 1854H/1815H/0H \u003c root.shared_xsk \u003e acct.shared_xsk\nacct_shared_xsk14zh0kh0geaz9qpxv6q0n5upq8ux4n97u2gyl69mnhan74w6849pa3hj2p40xg0nugw8tzqu5eynzjunay6tffru9wdjank0phsfuc7vngjsmtktel05g6mx555tw8nxr8rpn2gac6km5plu9mwqsz54rfyhwd7pd\n\n$ cardano-address key walletid \u003c acct.shared_xsk\nuser error (shared wallet needs to have at least spending script specified)\n\n$ cardano-address key walletid --spending \"cosigner#0\" \u003c acct.shared_xsk\n185d3582fc4892c4528614210b13e9a775dd7d02\n\n$ cardano-address key public --with-chain-code \u003c acct.shared_xsk | cardano-address key walletid --spending \"cosigner#0\"\n185d3582fc4892c4528614210b13e9a775dd7d02\n\n$ cardano-address key walletid --spending \"all [cosigner#0, active_until 1000]\" \u003c acct.shared_xsk\n42ecb214586dcbcb593688fb081784fa0aebb2c0\n\n$ cardano-address key walletid --spending \"all [cosigner#0, active_until 1000]\" --staking \"cosigner#1\" \u003c acct.shared_xsk\n12dc98557a4c5aa00575c5d1f0dbfa3837261e32\n```\n\n\n\n### How to generate a private policy key (\u003cstrong\u003epolicy.xsk\u003c/strong\u003e), a public policy key (\u003cstrong\u003epolicy.vk\u003c/strong\u003e) and its hash (\u003cstrong\u003epolicy.vkh\u003c/strong\u003e)\n\n```console\n$ cardano-address key child 1855H/1815H/0H \u003c root.xsk \u003e policy.xsk\npolicy_xsk1hr47zvxgzeeutgq50r965ygwxys86cwp8wdjqftlhan8mw6849pus6vc50dznjs5vkyjcz9usl6964u6nha88slrh8hyex74xnlfehcrkp80cp8wgzkqh22dzy7c48ekhhvvf2zz8hqakjwgfzgrjq5lx538et75\n\n$ cardano-address key child 1855H/1815H/0H \u003c root.xsk | cardano-address key public --with-chain-code \u003e policy.xvk\npolicy_xvk1e9ngmlhcwhszwyuxwc7anwk6tvzwndldz7j262rvfpd049tq74mq8vzwlszwus9vpw556yfa320nd0wccj5yy0wpmdyusjys8ypf7dgaauf0m\n\n$ cardano-address key child 1855H/1815H/0H \u003c root.xsk | cardano-address key public --without-chain-code \u003e policy.vk\npolicy_vk1e9ngmlhcwhszwyuxwc7anwk6tvzwndldz7j262rvfpd049tq74mq0ylkrs\n\n$ cardano-address key hash \u003c policy.xvk\npolicy_vkh1qpc9xly4lc7yt98gcf59kdcqcss6dda4u9g72e775yxpxeypamc\n$ cardano-address key hash \u003c policy.vk\npolicy_vkh1qpc9xly4lc7yt98gcf59kdcqcss6dda4u9g72e775yxpxeypamc\n$ cardano-address key hash \u003c policy.vk | bech32\n0070537c95fe3c4594e8c2685b3700c421a6b7b5e151e567dea10c13\n```\n\n\u003e :information_source: The last segment in the path is the key index and can be incremented up to `2^31-1` to derive more keys.\n\n\n\n### How to generate a payment verification key (\u003cstrong\u003eaddr.xvk\u003c/strong\u003e)\n\n```console\n$ cardano-address key child 1852H/1815H/0H/0/0 \u003c root.xsk | cardano-address key public --with-chain-code \u003e addr.xvk\naddr_xvk1grvg8qzmkmw2n0dm4pd0h3j4dv6yglyammyp733eyj629dc3z28v6wk22nfmru6xz0vl2s3y5xndyd57fu70hrt84c6zkvlwx6fdl7ct9j7yc\n```\n\n\u003e :information_source: The last segment in the path is the key index and can be incremented up to `2^31-1` to derive more keys.\n\n\n\n### How to generate an extended stake verification key (\u003cstrong\u003estake.xvk\u003c/strong\u003e)\n\n```console\n$ cardano-address key child 1852H/1815H/0H/2/0 \u003c root.xsk | cardano-address key public --with-chain-code \u003e stake.xvk\nstake_xvk1658atzttunamzn80204khrg0qfdk5nvmrutlmmpg7xlsyaggwa7h9z4smmeqsvs67qhyqmc2lqa0vy36rf2la74ym8a5p93zp4qtpuq6ky3ve\n```\n\n\u003e :information_source: The last segment in the path is the key index and can be incremented up to `2^31-1` to derive more keys.\n\n\n### How to generate a non-extended stake verification key (\u003cstrong\u003estake.vk\u003c/strong\u003e)\n\n```console\n$ cardano-address key child 1852H/1815H/0H/2/0 \u003c root.xsk | cardano-address key public --without-chain-code \u003e stake.vk\nstake_vk1658atzttunamzn80204khrg0qfdk5nvmrutlmmpg7xlsyaggwa7sg87an2\n```\n\n\u003e :information_source: The last segment in the path is the key index and can be incremented up to `2^31-1` to derive more keys.\n\n\n### How to generate a hash for payment verification key (\u003cstrong\u003eaddr.xvk\u003c/strong\u003e)\n\n```console\n$ cardano-address key child 1852H/1815H/0H/0/0 \u003c root.xsk | cardano-address key public --with-chain-code \u003e addr.xvk\naddr_xvk1grvg8qzmkmw2n0dm4pd0h3j4dv6yglyammyp733eyj629dc3z28v6wk22nfmru6xz0vl2s3y5xndyd57fu70hrt84c6zkvlwx6fdl7ct9j7yc\n$ cardano-address key hash \u003c addr.xvk\naddr_vkh12j28hnmtwcp3n08vy58vyf0arnnrhtavu3lrfdztw0j0jng3d6v\n$ cardano-address key hash \u003c addr.xvk | bech32\n54947bcf6b760319bcec250ec225fd1ce63baface47e34b44b73e4f9\n```\n\n\u003e :information_source: The hashing is available for both stake and payment verification keys. Hex encoding can be achieved by redirecting to `bech32` tool.\n\n\n\n### How to generate a payment address from an extended payment key (\u003cstrong\u003epayment.addr\u003c/strong\u003e)\n\n```console\n$ cardano-address address payment --network-tag testnet \u003c addr.xvk \u003e payment.addr\naddr_test1vp2fg770ddmqxxduasjsas39l5wwvwa04nj8ud95fde7f7guscp6v\n```\n\n\n\n### How to generate a payment address from a non-extended payment key (\u003cstrong\u003epayment.addr\u003c/strong\u003e)\n\n```console\n$ cardano-address key child 1852H/1815H/0H/0/0 \u003c root.xsk | cardano-address key public --without-chain-code \u003e addr.vk\naddr_vk1grvg8qzmkmw2n0dm4pd0h3j4dv6yglyammyp733eyj629dc3z28qwq4y73\n$ cardano-address address payment --network-tag testnet \u003c addr.vk \u003e payment.addr\naddr_test1vp2fg770ddmqxxduasjsas39l5wwvwa04nj8ud95fde7f7guscp6v\n```\n\n\n\n### How to generate a payment address from a payment key hash (\u003cstrong\u003epayment.addr\u003c/strong\u003e)\n\n```console\n$ cardano-address key hash \u003c addr.xvk \u003e addr.vkh\naddr_vkh12j28hnmtwcp3n08vy58vyf0arnnrhtavu3lrfdztw0j0jng3d6v\n$ cardano-address address payment --network-tag testnet \u003c addr.vkh \u003e payment.addr\naddr_test1vp2fg770ddmqxxduasjsas39l5wwvwa04nj8ud95fde7f7guscp6v\n```\n\n\n\n### How to generate a delegated payment address, i.e. base address, from an extended stake key (\u003cstrong\u003ebase.addr\u003c/strong\u003e)\n\n```console\n$ cardano-address address delegation $(cat stake.xvk) \u003c payment.addr \u003e base.addr\naddr_test1qp2fg770ddmqxxduasjsas39l5wwvwa04nj8ud95fde7f70k6tew7wrnx0s4465nx05ajz890g44z0kx6a3gsnms4c4qq8ve0n\n```\n\n\n### How to generate a delegated payment address, i.e. base address, from a non-extended stake key (\u003cstrong\u003ebase.addr\u003c/strong\u003e)\n\n```console\n$ cardano-address key child 1852H/1815H/0H/2/0 \u003c root.xsk | cardano-address key public --without-chain-code \u003e stake.vk\nstake_vk1658atzttunamzn80204khrg0qfdk5nvmrutlmmpg7xlsyaggwa7sg87an2\n$ cardano-address address delegation $(cat stake.vk) \u003c payment.addr \u003e base.addr\naddr_test1qp2fg770ddmqxxduasjsas39l5wwvwa04nj8ud95fde7f70k6tew7wrnx0s4465nx05ajz890g44z0kx6a3gsnms4c4qq8ve0n\n```\n\n\n### How to generate a delegated payment address, i.e. base address, from a stake key hash (\u003cstrong\u003ebase.addr\u003c/strong\u003e)\n\n```console\n$ cardano-address key hash \u003c stake.xvk \u003e stake.vkh\nstake_vkh17mf09mecwve7zkh2jve7nkggu4azk5f7cmtk9zz0wzhz5efq2w6\n$ cardano-address address delegation $(cat stake.vkh) \u003c payment.addr \u003e base.addr\naddr_test1qp2fg770ddmqxxduasjsas39l5wwvwa04nj8ud95fde7f70k6tew7wrnx0s4465nx05ajz890g44z0kx6a3gsnms4c4qq8ve0n\n```\n\n\n### How to generate a stake address from an extended stake key (\u003cstrong\u003estake.addr\u003c/strong\u003e)\n\n```console\n$ cardano-address address stake --network-tag testnet \u003c stake.xvk \u003e stake.addr\nstake_test1urmd9uh08pen8c26a2fn86weprjh52638mrdwc5gfac2u2s25zpat\n```\n\n\n### How to generate a stake address from a non-extended stake key (\u003cstrong\u003estake.addr\u003c/strong\u003e)\n\n```console\n$ cardano-address address stake --network-tag testnet \u003c stake.vk \u003e stake.addr\nstake_test1urmd9uh08pen8c26a2fn86weprjh52638mrdwc5gfac2u2s25zpat\n```\n\n\n### How to generate a stake address from a stake key hash (\u003cstrong\u003estake.addr\u003c/strong\u003e)\n\n```console\n$ cardano-address key hash \u003c stake.xvk \u003e stake.vkh\nstake_vkh17mf09mecwve7zkh2jve7nkggu4azk5f7cmtk9zz0wzhz5efq2w6\n$ cardano-address address stake --network-tag testnet \u003c stake.vkh \u003e stake.addr\nstake_test1urmd9uh08pen8c26a2fn86weprjh52638mrdwc5gfac2u2s25zpat\n```\n\n\n### How to inspect address\n\n```console\n$ echo addr_test1vp2fg770ddmqxxduasjsas39l5wwvwa04nj8ud95fde7f7guscp6v | cardano-address address inspect\n{\n    \"stake_reference\": \"none\",\n    \"spending_key_hash_bech32\": \"addr_vkh12j28hnmtwcp3n08vy58vyf0arnnrhtavu3lrfdztw0j0jng3d6v\",\n    \"address_style\": \"Shelley\",\n    \"spending_key_hash\": \"54947bcf6b760319bcec250ec225fd1ce63baface47e34b44b73e4f9\",\n    \"network_tag\": 0,\n    \"address_type\": 6\n}\n\n$ echo addr_test1qp2fg770ddmqxxduasjsas39l5wwvwa04nj8ud95fde7f70k6tew7wrnx0s4465nx05ajz890g44z0kx6a3gsnms4c4qq8ve0n | cardano-address address inspect\n{\n    \"stake_reference\": \"by value\",\n    \"stake_key_hash_bech32\": \"stake_vkh17mf09mecwve7zkh2jve7nkggu4azk5f7cmtk9zz0wzhz5efq2w6\",\n    \"stake_key_hash\": \"f6d2f2ef387333e15aea9333e9d908e57a2b513ec6d762884f70ae2a\",\n    \"spending_key_hash_bech32\": \"addr_vkh12j28hnmtwcp3n08vy58vyf0arnnrhtavu3lrfdztw0j0jng3d6v\",\n    \"address_style\": \"Shelley\",\n    \"spending_key_hash\": \"54947bcf6b760319bcec250ec225fd1ce63baface47e34b44b73e4f9\",\n    \"network_tag\": 0,\n    \"address_type\": 0\n}\n```\n\nDetails about possible address types are following (refer also to [cddl](https://github.com/input-output-hk/cardano-ledger/blob/master/eras/alonzo/test-suite/cddl-files/alonzo.cddl) )\n| address_type | binary prefix  |   Meaning                                                |\n| ------------ |:--------------:|:--------------------------------------------------------:|\n|      0       |  0000          |   base address: keyhash28,keyhash28                      |\n|      1       |  0001          |   base address: scripthash28,keyhash28                   |\n|      2       |  0010          |   base address: keyhash28,scripthash28                   |\n|      3       |  0011          |   base address: scripthash28,scripthash28                |\n|      4       |  0100          |   pointer address: keyhash28, 3 variable length uint     |\n|      5       |  0101          |   pointer address: scripthash28, 3 variable length uint  |\n|      6       |  0110          |   enterprise address: keyhash28                          |\n|      7       |  0111          |   enterprise address: scripthash28                       |\n|      8       |  1000          |   byron/icarus                                           |\n|      14      |  1110          |   reward account: keyhash28                              |\n|      15      |  1111          |   reward account: scripthash28                           |\n\n\n\n### How to generate a payment verification key for shared wallet (\u003cstrong\u003eaddr_shared.vk\u003c/strong\u003e, \u003cstrong\u003estake_shared.vk\u003c/strong\u003e)\n\nLet's generate extended root private key for shared style:\n\n``` console\n$ cardano-address key from-recovery-phrase Shared \u003c phrase.prv \u003e root_shared.xsk\nroot_shared_xsk1hqzfzrgskgnpwskxxrv5khs7ess82ecy8za9l5ef7e0afd2849p3zryje8chk39nxtva0sww5me3pzkej4rvd5cae3q3v8eu7556n6pdrp4fdu8nsglynpmcppxxvfdyzdz5gfq3fefjepxhvqspmuyvmvzteqlc\n```\n\nNow generate payment verification key (`role=0` is used). Please note that purpose `1854H` is used for multisig.\n\n```console\n$ cardano-address key child 1854H/1815H/0H/0/0 \u003c root_shared.xsk | cardano-address key public --without-chain-code \u003e addr_shared.vk\naddr_shared_vk1a9h46rvjnqquxz02zyesh0ct29szh7vv9x7r2h87ttmnkgrfgguqhz0mtc\n```\n\nGenerating delegation verification key is the similar (the only difference is role=2)\n\n```console\n$ cardano-address key child 1854H/1815H/0H/2/0 \u003c root_shared.xsk | cardano-address key public --without-chain-code \u003e stake_shared.vk\nstake_shared_vk18a8z5dcrlwene88n84j6dm9yvj5rt296fjtresqnunmacetdcymquyq43z\n```\n\n\u003e :information_source: The last segment in the path is the key index, which can be incremented to derive more keys. Up `2^31-1` keys are possible.\n\n\n### How to construct a multisig script hash (\u003cstrong\u003escript.hash\u003c/strong\u003e)\n\nWe consider `addr_shared.1.vk` and `addr_shared.2.vk` obtained like `addr_shared.vk` but by replacing the final index by `1` and `2` respectively.\n\n```console\n$ cardano-address key child 1854H/1815H/0H/0/1 \u003c root_shared.xsk | cardano-address key public --without-chain-code \u003e addr_shared.1.vk\naddr_shared_vk1wgj79fxw2vmxkp85g88nhwlflkxevd77t6wy0nsktn2f663wdcmqcd4fp3\n$ cardano-address key child 1854H/1815H/0H/0/2 \u003c root_shared.xsk | cardano-address key public --without-chain-code \u003e addr_shared.2.vk\naddr_shared_vk1jthguyss2vffmszq63xsmxlpc9elxnvdyaqk7susl4sppp2s9xqsuszh44\n$ cardano-address script hash \"all [$(cat addr_shared.1.vk), $(cat addr_shared.2.vk)]\" \u003e script.hash\nscript1gr69m385thgvkrtspk73zmkwk537wxyxuevs2u9cukglvtlkz4k\n```\n\nThis script requires the signature from both signing keys corresponding to `shared_addr.1.vk` and `shared_addr.2.vk` (i.e., shared_addr.1.sk and shared_addr.2.sk) in order to be valid. Similarly, we could require only one of the two signatures:\n\nWe can also use extended verification, eiher payment or delegation, keys. They can be obtained as the non-extended ones by using `--with-chain-code` option rather than `--without-chain-option` as above. They will give rise to the same script hash as for verification keys chain code is stripped upon calculation.\n\n```console\n$ cardano-address key child 1854H/1815H/0H/0/1 \u003c root_shared.xsk | cardano-address key public --with-chain-code \u003e addr_shared.1.xvk\naddr_shared_xvk1wgj79fxw2vmxkp85g88nhwlflkxevd77t6wy0nsktn2f663wdcmqhlfft3dn0qcn6q99dvlfl2ws5duy6w65zks5jgufe60fg839sysavl5pc\n$ cardano-address key child 1854H/1815H/0H/0/2 \u003c root_shared.xsk | cardano-address key public --with-chain-code \u003e addr_shared.2.xvk\naddr_shared_xvk1jthguyss2vffmszq63xsmxlpc9elxnvdyaqk7susl4sppp2s9xq3zegcxtslhpghmadrlvsphssfjqp3mxg9gca27e35wpu43lqjqnsmjvxuw\n$ cardano-address script hash \"all [$(cat addr_shared.1.xvk), $(cat addr_shared.2.xvk)]\"\nscript1gr69m385thgvkrtspk73zmkwk537wxyxuevs2u9cukglvtlkz4k\n```\n\nwhich is equivalent (functionally, but not in terms of hash value) to :\n\n```console\n$ cardano-address script hash \"at_least 1 [$(cat addr_shared.1.xvk), $(cat addr_shared.2.xvk)]\"\nscript13uf3fz3ts5srpjc5zcfe977uvnyvp36wcvxuudryegz0zpjlx6a\n```\n\n\n### How to construct a multisig script hash with timelocks\n\n```console\n$  cardano-address script hash \"all [$(cat addr_shared.1.xvk), $(cat addr_shared.2.xvk), active_from 100, active_until 120]\"\nscript1nugjzwfs2t9htl7s3dv9ajnd5us8pctpa8aj4ank8dnd6d6unul\n```\n\n\n\n### How to validate a script\n\n```console\n$  cardano-address script validate \"at_least 1 [$(cat addr_shared.1.xvk), $(cat addr_shared.2.xvk), $(cat addr_shared.2.xvk)]\"\nValidated.\n\n$  cardano-address script validate --recommended  \"at_least 1 [$(cat addr_shared.1.xvk), $(cat addr_shared.2.xvk), $(cat addr_shared.2.xvk)]\"\nNot validated: The list inside a script has duplicate keys (which is not recommended)..\n```\n\n\n### How to get preimage for a script\n\n```console\n$ cardano-address script preimage \"all [addr_shared_vkh1zxt0uvrza94h3hv4jpv0ttddgnwkvdgeyq8jf9w30mcs6y8w3nq, addr_shared_vkh1y3zl4nqgm96ankt96dsdhc86vd5geny0wr7hu8cpzdfcqskq2cp]\"\n008201828200581c1196fe3062e96b78dd959058f5adad44dd663519200f2495d17ef10d8200581c2445facc08d975d9d965d360dbe0fa63688ccc8f70fd7e1f01135380\n\n$  cardano-address script preimage \"all [addr_shared_vkh1zxt0uvrza94h3hv4jpv0ttddgnwkvdgeyq8jf9w30mcs6y8w3nq, active_from 100, active_until 150]\"\n008201838200581c1196fe3062e96b78dd959058f5adad44dd663519200f2495d17ef10d8204186482051896\n```\n\n\n### How to generate a payment script address from a script hash (\u003cstrong\u003escript.addr\u003c/strong\u003e)\n\n```console\n$ cardano-address address payment --network-tag testnet \u003c script.hash \u003e script.addr\naddr_test1wpq0ghwy73wapjcdwqxm6ytwe66j8eccsmn9jptshrjerashp7y82\n```\n\n\n### How to generate a payment script address from a script (\u003cstrong\u003escript.addr\u003c/strong\u003e)\n\n```console\n$ cardano-address address payment --network-tag testnet \"all [$(cat addr_shared.1.xvk), $(cat addr_shared.2.xvk)]\"  \u003e script.addr\naddr_test1wpq0ghwy73wapjcdwqxm6ytwe66j8eccsmn9jptshrjerashp7y82\n```\n\n\n### How to generate a delegated payment address, i.e. base address, from a script hash (\u003cstrong\u003ebase.addr\u003c/strong\u003e)\n\n```console\n$ cardano-address script hash \"all [$(cat addr_shared.1.xvk), $(cat addr_shared.2.xvk), active_from 100, active_until 120]\" \u003e script.stake.hash\nscript1nugjzwfs2t9htl7s3dv9ajnd5us8pctpa8aj4ank8dnd6d6unul\n$ cardano-address address delegation $(cat script.stake.hash) \u003c script.addr \u003e base.addr\naddr_test1xpq0ghwy73wapjcdwqxm6ytwe66j8eccsmn9jptshrjera5lzysnjvzjed6ll5yttp0v5md8ypcwzc0flv40va3mvmwsl7grs3\n```\n\n\n### How to generate a delegated payment address, i.e. base address, from a script (\u003cstrong\u003ebase.addr\u003c/strong\u003e)\n\n```console\n$ cardano-address address delegation \"all [$(cat addr_shared.1.xvk), $(cat addr_shared.2.xvk), active_from 100, active_until 120]\" \u003c script.addr \u003e base.addr\naddr_test1xpq0ghwy73wapjcdwqxm6ytwe66j8eccsmn9jptshrjera5lzysnjvzjed6ll5yttp0v5md8ypcwzc0flv40va3mvmwsl7grs3\n```\n\n\n### How to generate a stake address from a script hash (\u003cstrong\u003estake.addr\u003c/strong\u003e)\n\n```console\n$ cardano-address address stake --network-tag testnet \u003c script.stake.hash \u003e stake.addr\nstake_test17z03zgfexpfvka0l6z94shk2dknjqu8pv85lk2hkwcakdhgx52yaj\n```\n\n\n### How to generate a stake address from a script (\u003cstrong\u003estake.addr\u003c/strong\u003e)\n\n```console\n$ cardano-address address stake --network-tag testnet \"all [$(cat addr_shared.1.xvk), $(cat addr_shared.2.xvk), active_from 100, active_until 120]\" \u003e stake.addr\nstake_test17z03zgfexpfvka0l6z94shk2dknjqu8pv85lk2hkwcakdhgx52yaj\n```\n\n\n### How to generate drep keys (\u003cstrong\u003edrep\u003c/strong\u003e)\n\n```console\n$ cat root.xsk\nroot_xsk1hqzfzrgskgnpwskxxrv5khs7ess82ecy8za9l5ef7e0afd2849p3zryje8chk39nxtva0sww5me3pzkej4rvd5cae3q3v8eu7556n6pdrp4fdu8nsglynpmcppxxvfdyzdz5gfq3fefjepxhvqspmuyvmvqg8983\n\n$ cardano-address key child 1852H/1815H/0H/3/0 \u003c root.xsk \u003e drep.xsk\ndrep_xsk1vpdsm49smzmdwhd4kjmm2mdyljjysm746rafjr7r8kgfanj849psw8pfm305g59wng0akw3qzppmfh6k5z7gx66h2vppu022m4eqaj26rh6d7en9tf9fu52hmysjzuacaxfmfya65h8jmddrclwf3kxl8snfs3eg\n\n$ cardano-address key public --with-chain-code \u003c drep.xsk \u003e drep.xvk\ndrep_xvk1mg7xae48d7z4nntd35tey0jmclxaavwmk3kw2lkkt07p3s3x3yy45805manx2kj2neg40kfpy9em36vnkjfm4fw09k66837unrvd70qq8ewzf\n\n$ cardano-address key public --without-chain-code \u003c drep.xsk \u003e drep.vk\ndrep_vk1mg7xae48d7z4nntd35tey0jmclxaavwmk3kw2lkkt07p3s3x3yysra6588\n\n$ cardano-address key hash --cip-0105 \u003c drep.xvk \u003e drep.vkh\ndrep_vkh1sp5xhvmj0asztqfsjyta3cwvq7jppc2rwmfcsggp62va5hqgpg4\n\n$ cat drep.vkh | bech32\n80686bb3727f602581309117d8e1cc07a410e14376d3882101d299da\n\n$ cat drep.vkh | bech32 drep \u003e drep.deprecated\ndrep1sp5xhvmj0asztqfsjyta3cwvq7jppc2rwmfcsggp62va538nup0\n\n$ cat drep.deprecated | bech32\n80686bb3727f602581309117d8e1cc07a410e14376d3882101d299da\n\n$ cardano-address key hash \u003c drep.xvk \u003e drep.credential\ndrep1y2qxs6anwflkqfvpxzg30k8pesr6gy8pgdmd8zppq8ffnksapjznm\n\n$ cat drep.credential | bech32\n2280686bb3727f602581309117d8e1cc07a410e14376d3882101d299da\n\n(there is the expected 0x22 prepended byte as it is drep key hash credential in accordance to CIP-0129. The corresponding key hash credential is '80686bb3727f602581309117d8e1cc07a410e14376d3882101d299da' and it is the same as in case of both `drep.vkh` and `drep.deprecated`).\n```\n\n\n### How to create script and its hash from drep keys (\u003cstrong\u003edrep\u003c/strong\u003e)\n\n```console\n\n$ cat drep.vkh\ndrep_vkh1sp5xhvmj0asztqfsjyta3cwvq7jppc2rwmfcsggp62va5hqgpg4\n$ cat drep.deprecated\ndrep1sp5xhvmj0asztqfsjyta3cwvq7jppc2rwmfcsggp62va538nup0\n$ cat drep.credential\ndrep1y2qxs6anwflkqfvpxzg30k8pesr6gy8pgdmd8zppq8ffnksapjznm\n\n$ cardano-address script hash \"all [$(cat drep.xvk), active_from 100, active_until 120]\"\ndrep_script1eeccqnkak63vtp32l3epv5hcn8qpc2nxz4drxzadvj9q78ysk3q\n$ cardano-address script hash \"all [$(cat drep.deprecated), active_from 100, active_until 120]\"\ndrep_script1eeccqnkak63vtp32l3epv5hcn8qpc2nxz4drxzadvj9q78ysk3q\n$ cardano-address script hash \"all [$(cat drep.credential), active_from 100, active_until 120]\"\ndrep_script1eeccqnkak63vtp32l3epv5hcn8qpc2nxz4drxzadvj9q78ysk3q\n\n$ cardano-address script hash \"all [$(cat drep.credential), active_from 100, active_until 120]\" | bech32\nce71804eddb6a2c5862afc721652f899c01c2a66155a330bad648a0f\n\n$ cardano-address script hash --with-byte \"all [$(cat drep.credential), active_from 100, active_until 120]\"\ndrep1y088rqzwmkm293vx9t78y9jjlzvuq8p2vc245vct44jg5rcyp8s2d\n$ cardano-address script hash --with-byte \"all [$(cat drep.credential), active_from 100, active_until 120]\" | bech32\n23ce71804eddb6a2c5862afc721652f899c01c2a66155a330bad648a0f\n\n(there is the expected 0x23 prepended byte as it is drep script hash credential in accordance to CIP-0129. The corresponding script hash credential is 'ce71804eddb6a2c5862afc721652f899c01c2a66155a330bad648a0f' and it is the same irrespective of how the script hash is constructed, i.e.,  from `drep.vkh`, `drep.credential` or `drep.deprecated`).\n```\n\n\n\n### How to generate cold committee keys (\u003cstrong\u003ecc_cold\u003c/strong\u003e)\n\n```console\n$ cat root.xsk\nroot_xsk1hqzfzrgskgnpwskxxrv5khs7ess82ecy8za9l5ef7e0afd2849p3zryje8chk39nxtva0sww5me3pzkej4rvd5cae3q3v8eu7556n6pdrp4fdu8nsglynpmcppxxvfdyzdz5gfq3fefjepxhvqspmuyvmvqg8983\n\n$ cardano-address key child 1852H/1815H/0H/4/0 \u003c root.xsk \u003e cold.xsk\ncc_cold_xsk1fp4megtpn4vu4cug2lmsyhg4xvnnar55q6k8wp5e6f2h8jz849ph8v8jhm0qffw8v6ut7x8wqvr07m9ccaspezrkexcafu284w6gpqexspqujj8glw0d70rwuemk0924zjhscgcfnevy29zr0fc57tvjmg7jvvqh\n\n$ cardano-address key public --with-chain-code \u003c cold.xsk \u003e cold.xvk\ncc_cold_xvk1dg8d5du0v4ukqkfgset50xncudhwlfzz2p6epv096x0ndl8jsgzzdqzpe9yw37u7mu7xaenhv7242990ps3sn8jcg52yx7n3fuke9kst5t2py\n\n$ cardano-address key public --without-chain-code \u003c cold.xsk \u003e cold.vk\ncc_cold_vk1dg8d5du0v4ukqkfgset50xncudhwlfzz2p6epv096x0ndl8jsgzqmwj2x5\n\n$ cardano-address key hash --cip-0105 \u003c cold.xvk \u003e cold.vkh\ncc_cold_vkh1d7yw362prvnae5fc8063xdeapws9ptzdgjkqd4dk3qddctn5rch\n\n$ cat cold.vkh  | bech32\n6f88e8e9411b27dcd1383bf513373d0ba050ac4d44ac06d5b6881adc\n\n$ cat cold.vkh  | bech32 cc_cold \u003e cold.deprecated\ncc_cold1d7yw362prvnae5fc8063xdeapws9ptzdgjkqd4dk3qddccyzfjm\n\n$ cat cold.deprecated | bech32\n6f88e8e9411b27dcd1383bf513373d0ba050ac4d44ac06d5b6881adc\n\n$ cardano-address key hash \u003c cold.xvk \u003e cold.credential\ncc_cold1zfhc368fgydj0hx38qal2yeh8596q59vf4z2cpk4k6yp4hqy3mpsx\n\n$ cat cold.credential | bech32\n126f88e8e9411b27dcd1383bf513373d0ba050ac4d44ac06d5b6881adc\n\n(there is the expected 0x12 prepended byte as it is cc cold key hash credential in accordance to CIP-0129. The corresponding key hash is '6f88e8e9411b27dcd1383bf513373d0ba050ac4d44ac06d5b6881adc' and it is the same as in case of both `cold.vkh` and `cold.deprecated`).\n```\n\n\n### How to create script and its hash from cold committee keys (\u003cstrong\u003edrep\u003c/strong\u003e)\n\n```console\n\n$ cat cold.vkh\ncc_cold_vkh1d7yw362prvnae5fc8063xdeapws9ptzdgjkqd4dk3qddctn5rch\n$ cat cold.deprecated\ncc_cold1d7yw362prvnae5fc8063xdeapws9ptzdgjkqd4dk3qddccyzfjm\n$ cat cold.credential\ncc_cold1zfhc368fgydj0hx38qal2yeh8596q59vf4z2cpk4k6yp4hqy3mpsx\n\n$ cardano-address script hash \"all [$(cat cold.xvk), active_from 100, active_until 120]\"\ncc_cold_script18zy6g0vu7ajzmzamkvysfzc0nnfpf8w3n7404xxhaz2jqexhzw5\n$ cardano-address script hash \"all [$(cat cold.deprecated), active_from 100, active_until 120]\"\ncc_cold_script18zy6g0vu7ajzmzamkvysfzc0nnfpf8w3n7404xxhaz2jqexhzw5\n$ cardano-address script hash \"all [$(cat cold.credential), active_from 100, active_until 120]\"\ncc_cold_script18zy6g0vu7ajzmzamkvysfzc0nnfpf8w3n7404xxhaz2jqexhzw5\n\n$ cardano-address script hash \"all [$(cat cold.credential), active_from 100, active_until 120]\" | bech32\n3889a43d9cf7642d8bbbb309048b0f9cd2149dd19faafa98d7e89520\n\n$ cardano-address script hash --with-byte \"all [$(cat cold.credential), active_from 100, active_until 120]\"\ncc_cold1zvugnfpannmkgtvthwesjpytp7wdy9ya6x06475c6l5f2gqcxtssu\n$ cardano-address script hash --with-byte \"all [$(cat cold.credential), active_from 100, active_until 120]\" | bech32\n133889a43d9cf7642d8bbbb309048b0f9cd2149dd19faafa98d7e89520\n\n(there is the expected 0x13 prepended byte as it is cc cold script hash credential in accordance to CIP-0129. The corresponding script hash credential is '3889a43d9cf7642d8bbbb309048b0f9cd2149dd19faafa98d7e89520' and it is the same irrespective of how the script hash is constructed, i.e.,  from `cold.vkh`, `cold.credential` or `cold.deprecated`).\n```\n\n\n### How to generate hot committee keys (\u003cstrong\u003ecc_hot\u003c/strong\u003e)\n\n```console\n$ cat root.xsk\nroot_xsk1hqzfzrgskgnpwskxxrv5khs7ess82ecy8za9l5ef7e0afd2849p3zryje8chk39nxtva0sww5me3pzkej4rvd5cae3q3v8eu7556n6pdrp4fdu8nsglynpmcppxxvfdyzdz5gfq3fefjepxhvqspmuyvmvqg8983\n\n$ cardano-address key child 1852H/1815H/0H/5/0 \u003c root.xsk \u003e hot.xsk\ncc_hot_xsk14z9ktfggpsm8sqd5ecepv9f4estxkukfualezuxrfry0mjj849puxsq7ch3tw67d7rfr4smvaa2u3tkfu675mxw85zlpafp6llfex7re88wh22s8f83ehn6uejgfrm74x8y98xlwdmgy64ufctwernp64umnr5uk\n\n$ cardano-address key public --with-chain-code \u003c hot.xsk \u003e hot.xvk\ncc_hot_xvk1a5q4r34xzm0r6y728d4gmrl7jvrfuh7r022k7wh5mzwmyg7d7l3hjwwaw54qwj0rn084enysj8ha2vwg2wd7umksf4tcnskaj8xr4tcempwly\n\n$ cardano-address key public --without-chain-code \u003c hot.xsk \u003e hot.vk\ncc_hot_vk1a5q4r34xzm0r6y728d4gmrl7jvrfuh7r022k7wh5mzwmyg7d7l3s3fzqkv\n\n$ cardano-address key hash --cip-0105 \u003c hot.xvk \u003e hot.vkh\ncc_hot_vkh1xk94yxqufrm5sjfv535hlnky8cf9fzg5kvp3r4qz9d5ezk2qmuz\n\n$ cat hot.vkh | bech32\n358b52181c48f748492ca4697fcec43e12548914b30311d4022b6991\n\n$ cat hot.vkh  | bech32 cc_hot \u003e hot.deprecated\ncc_hot1xk94yxqufrm5sjfv535hlnky8cf9fzg5kvp3r4qz9d5ezua5p8v\n\n$ cat hot.deprecated | bech32\n358b52181c48f748492ca4697fcec43e12548914b30311d4022b6991\n\n$ cardano-address key hash \u003c hot.xvk \u003e hot.credential\ncc_hot1qg6ck5scr3y0wjzf9jjxjl7wcslpy4yfzjesxyw5qg4knyg9ckh0d\n\n$ cat hot.credential | bech32\n02358b52181c48f748492ca4697fcec43e12548914b30311d4022b6991\n\n(there is the expected 0x02 prepended byte as it is cc cold key hash credential in accordance to CIP-0129. The corresponding key hash credential is '358b52181c48f748492ca4697fcec43e12548914b30311d4022b6991' and it is the same as in case of both `hot.vkh` and `hot.deprecated`).\n```\n\n\n### How to create script and its hash from hot committee keys (\u003cstrong\u003edrep\u003c/strong\u003e)\n\n```console\n\n$ cat hot.vkh\ncc_hot_vkh1xk94yxqufrm5sjfv535hlnky8cf9fzg5kvp3r4qz9d5ezk2qmuz\n$ cat hot.deprecated\ncc_hot1xk94yxqufrm5sjfv535hlnky8cf9fzg5kvp3r4qz9d5ezua5p8v\n$ cat hot.credential\ncc_hot1qg6ck5scr3y0wjzf9jjxjl7wcslpy4yfzjesxyw5qg4knyg9ckh0d\n\n$ cardano-address script hash \"all [$(cat hot.xvk), active_from 100, active_until 120]\"\ncc_hot_script14xptkz0f6kv85nctxuycj0vm73u7ajuz4rglxn5qgzncsdq80mv\n$ cardano-address script hash \"all [$(cat hot.deprecated), active_from 100, active_until 120]\"\ncc_hot_script14xptkz0f6kv85nctxuycj0vm73u7ajuz4rglxn5qgzncsdq80mv\n$ cardano-address script hash \"all [$(cat hot.credential), active_from 100, active_until 120]\"\ncc_hot_script14xptkz0f6kv85nctxuycj0vm73u7ajuz4rglxn5qgzncsdq80mv\n\n$ cardano-address script hash \"all [$(cat hot.credential), active_from 100, active_until 120]\" | bech32\na982bb09e9d5987a4f0b3709893d9bf479eecb82a8d1f34e8040a788\n\n$ cardano-address script hash --with-byte \"all [$(cat hot.credential), active_from 100, active_until 120]\"\ncc_hot1qw5c9wcfa82es7j0pvmsnzfan068nmkts25dru6wspq20zqsumm4q\n$ cardano-address script hash --with-byte \"all [$(cat hot.credential), active_from 100, active_until 120]\" | bech32\n03a982bb09e9d5987a4f0b3709893d9bf479eecb82a8d1f34e8040a788\n\n(there is the expected 0x03 prepended byte as it is cc hot script hash credential in accordance to CIP-0129. The corresponding script hash credential is 'a982bb09e9d5987a4f0b3709893d9bf479eecb82a8d1f34e8040a788' and it is the same irrespective of how the script hash is constructed, i.e.,  from `hot.vkh`, `hot.credential` or `hot.deprecated`).\n```\n\n\n\n### How to get signing key and chain code from an extended signing key (\u003cstrong\u003edrep.sk\u003c/strong\u003e)\n\n```console\n$ cat drep.xsk\ndrep_xsk1vpdsm49smzmdwhd4kjmm2mdyljjysm746rafjr7r8kgfanj849psw8pfm305g59wng0akw3qzppmfh6k5z7gx66h2vppu022m4eqaj26rh6d7en9tf9fu52hmysjzuacaxfmfya65h8jmddrclwf3kxl8snfs3eg\n\n$ cardano-address key private --signing-key \u003c drep.xsk\ndrep_sk1vpdsm49smzmdwhd4kjmm2mdyljjysm746rafjr7r8kgfanj849psw8pfm305g59wng0akw3qzppmfh6k5z7gx66h2vppu022m4eqajg5xmwma\n\n$ cardano-address key private --signing-key \u003c drep.xsk | bech32\n605b0dd4b0d8b6d75db5b4b7b56da4fca4486fd5d0fa990fc33d909ece47a943071c29dc5f4450ae9a1fdb3a201043b4df56a0bc836b5753021e3d4add720ec9\n\n$ cardano-address key private --chain-code \u003c drep.xsk\n5a1df4df66655a4a9e5157d9212173b8e993b493baa5cf2db5a3c7dc98d8df3c\n\n$ echo drep_xsk1vpdsm49smzmdwhd4kjmm2mdyljjysm746rafjr7r8kgfanj849psw8pfm305g59wng0akw3qzppmfh6k5z7gx66h2vppu022m4eqaj26rh6d7en9tf9fu52hmysjzuacaxfmfya65h8jmddrclwf3kxl8snfs3eg | cardano-address key inspect\n{\n    \"chain_code\": \"5a1df4df66655a4a9e5157d9212173b8e993b493baa5cf2db5a3c7dc98d8df3c\",\n    \"extended_key\": \"605b0dd4b0d8b6d75db5b4b7b56da4fca4486fd5d0fa990fc33d909ece47a943071c29dc5f4450ae9a1fdb3a201043b4df56a0bc836b5753021e3d4add720ec9\",\n    \"key_type\": \"private\"\n}\n```\n\n\n\n\n### How to generate script validation, preimage and script hash from script composed of drep (\u003cstrong\u003edrep_script\u003c/strong\u003e)\n\n```console\n$ cat drep\ndrep1sp5xhvmj0asztqfsjyta3cwvq7jppc2rwmfcsggp62va538nup0\n\n$ cardano-address script validate \"all [$(cat drep),active_from 5001]\"\nValidated.\n\n$ cardano-address script validate \"all [$(cat drep),$(cat hot)]\"\nNot validated: All keys of a script must have the same role: payment, delegation, policy, representative, committee cold or committee hot.\n\n$ cardano-address script preimage \"all [$(cat drep),active_from 5001]\"\n008201828200581c80686bb3727f602581309117d8e1cc07a410e14376d3882101d299da8204191389\n\n$ cardano-address script hash \"all [$(cat drep),active_from 5001]\"\ndrep_script1608hfeauc3hvfpvdcqwfdhyd2cfm6j42rp62ckqrskazy57w2zt\n```\n\n\n\n### Correspondence between keys in cardano-addresses and cardano-cli (\u003cstrong\u003ekey.xsk key.xvk key.vk key.hash\u003c/strong\u003e)\n\n```console\nLet's assume we have mnemonic\n$ cat recovery-phrase.prv\nnothing heart matrix fly sleep slogan tomato pulse what roof rail since plastic false enlist\n\nConstruct root extended private key\n$ cardano-address key from-recovery-phrase Shelley \u003c recovery-phrase.prv \u003e root.xprv\nroot_xsk1apjwjs3ksgm5mnnk0cc5v5emgv0hmafmmy8tffay5s2ffk69830whwznr46672ruucdzwwtv9upv72e4ylrypyz5m6cyh0p00t7n3u3agt20lv32j4kxcqlkzu78nzjx0ysxxlc2ghfz9prxfmrds802xsuhh404~\n\nConstruct extended private key for account ix=0H, role=0 and address ix=0\n$ cardano-address key child 1852H/1815H/0H/0/0 \u003c root.xprv \u003e key.xsk\naddr_xsk1kzl5vgev0u843tfnxqcwg0lmaf7zhdhczddaqhas6dp6m6z98302e3avp8mhu94kxkpj2gss064f74km3rrptafh4fsztekz8k5c469shcvx35wrdmus3xemp984lcwhs0jdtl4pfcsrfspe00h9pej6rg8drvcv\n\nCreate extended signing key using cardano-cli\n$ cardano-cli key convert-cardano-address-key --shelley-payment-key --signing-key-file key.xsk --out-file key.skey\n{\n    \"type\": \"PaymentExtendedSigningKeyShelley_ed25519_bip32\",\n    \"description\": \"\",\n    \"cborHex\": \"5880b0bf46232c7f0f58ad333030e43ffbea7c2bb6f8135bd05fb0d343ade8453c5eacc7ac09f77e16b635832522107eaa9f56db88c615f537aa6025e6c23da98ae8fbbbf6410e24532f35e9279febb085d2cc05b3b2ada1df77ea1951eb694f3834b0be1868d1c36ef9089b3b094f5fe1d783e4d5fea14e2034c0397bee50e65a1a\"\n}\n\nThe cborhex here contains of 4 parts:\n1. prefix 5880 - bytestring of 128 bytes\n2. signing key (64 bytes) - b0bf46232c7f0f58ad333030e43ffbea7c2bb6f8135bd05fb0d343ade8453c5eacc7ac09f77e16b635832522107eaa9f56db88c615f537aa6025e6c23da98ae8\n3. verification key (32 bytes) - fbbbf6410e24532f35e9279febb085d2cc05b3b2ada1df77ea1951eb694f3834\n4. chain code (32 bytes) - b0be1868d1c36ef9089b3b094f5fe1d783e4d5fea14e2034c0397bee50e65a1a\n\nCreate corresponding verification key using cardano-cli\n$ cardano-cli key verification-key --signing-key-file key.skey --verification-key-file key.vkey\n{\n    \"type\": \"PaymentExtendedVerificationKeyShelley_ed25519_bip32\",\n    \"description\": \"\",\n    \"cborHex\": \"5840fbbbf6410e24532f35e9279febb085d2cc05b3b2ada1df77ea1951eb694f3834b0be1868d1c36ef9089b3b094f5fe1d783e4d5fea14e2034c0397bee50e65a1a\"\n}\nThe cborhex here contains of 3 parts:\n1. prefix 5840 - bytestring of 64 bytes\n2. verification key (32 bytes) - fbbbf6410e24532f35e9279febb085d2cc05b3b2ada1df77ea1951eb694f3834\n3. chain code (32 bytes) - b0be1868d1c36ef9089b3b094f5fe1d783e4d5fea14e2034c0397bee50e65a1a\n\nRule for prefixes:\n  - CBOR-encoded bytestring (which is what the 58 identifies)\n  - size (80 means 128 bytes, whereas 40 means 64 bytes, 20 means 32 bytes)\n\nCreate verification key hash using cardano-cli\n$ cardano-cli address key-hash --payment-verification-key-file key.vkey \u003e key.hash\n0185545935760c5e370d01e6f4fedbb89b7fd79e115f2837cfab9ea8\n\nAlternatively, we can create non-extended key\n$ cardano-address key public --without-chain-code \u003c key.xsk \u003e key.vk\naddr_vk1lwalvsgwy3fj7d0fy707hvy96txqtvaj4ksa7al2r9g7k6208q6qmrv9k3\n\nAlso, take notice that signing key can be translated to cborhex:\n$ cat key.xsk | bech32\nb0bf46232c7f0f58ad333030e43ffbea7c2bb6f8135bd05fb0d343ade8453c5eacc7ac09f77e16b635832522107eaa9f56db88c615f537aa6025e6c23da98ae8b0be1868d1c36ef9089b3b094f5fe1d783e4d5fea14e2034c0397bee50e65a1a\n(signing key and chain code appended)\n\nMoreover, basing on key.vk one can get hash\n$ cardano-cli address key-hash --payment-verification-key $(cat key.vk) \u003e key1.hash\n0185545935760c5e370d01e6f4fedbb89b7fd79e115f2837cfab9ea8\n\nWithin cardano-addresses one can get cborhex of verification key (with chain code)\n$ cardano-address key public --with-chain-code \u003c key.xsk | bech32\nfbbbf6410e24532f35e9279febb085d2cc05b3b2ada1df77ea1951eb694f3834b0be1868d1c36ef9089b3b094f5fe1d783e4d5fea14e2034c0397bee50e65a1a\n(verification key and chain code appended)\n\nWithin cardano-addresses one can get cborhex of verification key (without chain code)\n$ cardano-address key public --without-chain-code \u003c key.xsk | bech32\nfbbbf6410e24532f35e9279febb085d2cc05b3b2ada1df77ea1951eb694f3834\n(verification key without chain code)\n\nThen, we can get compute hash (but here we need to use without chain code):\n$ cardano-address key public --without-chain-code \u003c key.xsk | cardano-address key hash | bech32\n0185545935760c5e370d01e6f4fedbb89b7fd79e115f2837cfab9ea8\n\n```\n\n## Building/testing from source using nix\n\n``` console\n$ nix develop\n\n# building\n$ cabal build all\n\n# testing\n$ export LANG=C.UTF-8\n$ cabal test cardano-addresses:unit\n\n# installing executable locally\n$ cabal install cardano-address\n```\n\n## Docker Image\n\nPlease make sure you have [just](https://github.com/casey/just) installed as `justfile` is used for building Docker image\n\n### Build\n\n```console\n$ just clean-build-docker\n```\n\n### Run\n\nUse the auto-remove flag `--rm` when running commands.\n\n```console\n$ docker run --rm cardano-address recovery-phrase generate --size 15\ndismiss grit bacon glare napkin satisfy tribe proud carpet bench fantasy rich history face north\n```\n\nUse the interactive flag `-i` when piping stdin\n\n```console\n$ echo \"addr1gqtnpvdhqrtpd4g424fcaq7k0ufuzyadt7djygf8qdyzevuph3wczvf2dwyx5u\" | docker run --rm -i cardano-addresses address inspect\n{\n    \"address_style\": \"Shelley\",\n    \"stake_reference\": \"by pointer\",\n    \"spending_key_hash\": \"1730b1b700d616d51555538e83d67f13c113ad5f9b22212703482cb3\",\n    \"pointer\": {\n        \"slot_num\": 24157,\n        \"output_index\": 42,\n        \"transaction_index\": 177\n    },\n    \"network_tag\": 0\n}\n```\n\n## Javascript support\n\nJavascript support was dicontinued and dropped. One could look at the following now:\n\n1. [MeshJS](https://github.com/MeshJS/mesh)\n2. [blaze-cardano](https://github.com/butaneprotocol/blaze-cardano)\n\nAlternatively one could lean back on release [4.0.0](https://github.com/IntersectMBO/cardano-addresses/releases/tag/4.0.0)\nwhere Javascript was still present.\n\n## Contributing\n\nPull requests are welcome.\n\nWhen creating a pull request, please make sure that your code adheres to our\n[coding standards](https://input-output-hk.github.io/adrestia/code/Coding-Standards).\n\n\u003chr /\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/IntersectMBO/cardano-addresses/blob/master/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/github/license/IntersectMBO/cardano-addresses.svg?style=for-the-badge\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FIntersectMBO%2Fcardano-addresses","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FIntersectMBO%2Fcardano-addresses","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FIntersectMBO%2Fcardano-addresses/lists"}