[{"data":1,"prerenderedAt":1134},["ShallowReactive",2],{"navigation_docs":3,"-guide-wallets":84,"-guide-wallets-surround":1129},[4,32],{"title":5,"path":6,"stem":7,"children":8,"icon":31},"Guide","\u002Fguide","1.guide\u002F1.index",[9,11,15,19,23,27],{"title":10,"path":6,"stem":7},"Getting Started",{"title":12,"path":13,"stem":14},"Working with Keys","\u002Fguide\u002Fkeys","1.guide\u002F2.keys",{"title":16,"path":17,"stem":18},"Working with Addresses","\u002Fguide\u002Faddresses","1.guide\u002F3.addresses",{"title":20,"path":21,"stem":22},"Generating Wallets","\u002Fguide\u002Fwallets","1.guide\u002F4.wallets",{"title":24,"path":25,"stem":26},"Working with EVM Chains","\u002Fguide\u002Fevm","1.guide\u002F5.evm",{"title":28,"path":29,"stem":30},"Creating Custom Blockchains","\u002Fguide\u002Fcustom","1.guide\u002F6.custom","i-lucide-book-open",{"title":33,"path":34,"stem":35,"children":36,"icon":83},"Blockchains","\u002Fblockchains","2.blockchains\u002F0.index",[37,39,43,47,51,55,59,63,67,71,75,79],{"title":38,"path":34,"stem":35},"Overview",{"title":40,"path":41,"stem":42},"Aptos","\u002Fblockchains\u002Faptos","2.blockchains\u002Faptos",{"title":44,"path":45,"stem":46},"Base","\u002Fblockchains\u002Fbase","2.blockchains\u002Fbase",{"title":48,"path":49,"stem":50},"Bitcoin","\u002Fblockchains\u002Fbitcoin","2.blockchains\u002Fbitcoin",{"title":52,"path":53,"stem":54},"Cardano","\u002Fblockchains\u002Fcardano","2.blockchains\u002Fcardano",{"title":56,"path":57,"stem":58},"Decred","\u002Fblockchains\u002Fdecred","2.blockchains\u002Fdecred",{"title":60,"path":61,"stem":62},"Ethereum","\u002Fblockchains\u002Fethereum","2.blockchains\u002Fethereum",{"title":64,"path":65,"stem":66},"Litecoin","\u002Fblockchains\u002Flitecoin","2.blockchains\u002Flitecoin",{"title":68,"path":69,"stem":70},"Solana","\u002Fblockchains\u002Fsolana","2.blockchains\u002Fsolana",{"title":72,"path":73,"stem":74},"Stellar","\u002Fblockchains\u002Fstellar","2.blockchains\u002Fstellar",{"title":76,"path":77,"stem":78},"Sui","\u002Fblockchains\u002Fsui","2.blockchains\u002Fsui",{"title":80,"path":81,"stem":82},"TRON","\u002Fblockchains\u002Ftron","2.blockchains\u002Ftron","i-lucide-boxes",{"id":85,"title":20,"body":86,"description":1122,"extension":1123,"links":1124,"meta":1125,"navigation":244,"path":21,"seo":1127,"stem":22,"__hash__":1128},"docs\u002F1.guide\u002F4.wallets.md",{"type":87,"value":88,"toc":1113},"minimark",[89,94,98,173,179,183,345,355,434,437,441,518,534,538,544,656,659,705,708,712,718,820,823,826,928,950,961,965,968,972,978,1102,1109],[90,91,93],"h2",{"id":92},"what-a-wallet-is-here","What a wallet is here",[95,96,97],"p",{},"Keys plus the address they map to. Nothing else, no storage, no balance, no transactions.",[99,100,105],"pre",{"className":101,"code":102,"language":103,"meta":104,"style":104},"language-typescript shiki shiki-themes github-light github-light poimandres","interface Wallet extends Keys {\n  address: string;\n  warnings?: readonly string[];\n}\n","typescript","",[106,107,108,133,150,167],"code",{"__ignoreMap":104},[109,110,113,117,121,125,129],"span",{"class":111,"line":112},"line",1,[109,114,116],{"class":115},"s1TYA","interface",[109,118,120],{"class":119},"sCrqT"," Wallet",[109,122,124],{"class":123},"sP0CR"," extends",[109,126,128],{"class":127},"scZRh"," Keys",[109,130,132],{"class":131},"sKlNE"," {\n",[109,134,136,140,143,147],{"class":111,"line":135},2,[109,137,139],{"class":138},"s0VbO","  address",[109,141,142],{"class":115},":",[109,144,146],{"class":145},"s8yaW"," string",[109,148,149],{"class":131},";\n",[109,151,153,156,159,162,164],{"class":111,"line":152},3,[109,154,155],{"class":138},"  warnings",[109,157,158],{"class":115},"?:",[109,160,161],{"class":123}," readonly",[109,163,146],{"class":145},[109,165,166],{"class":131},"[];\n",[109,168,170],{"class":111,"line":169},4,[109,171,172],{"class":131},"}\n",[95,174,175,178],{},[106,176,177],{},"warnings"," only shows up when you asked for a derivation a stricter library would refuse. More on that below.",[90,180,182],{"id":181},"new-wallet","New wallet",[99,184,188],{"className":185,"code":186,"language":187,"meta":104,"style":104},"language-js shiki shiki-themes github-light github-light poimandres","import { useBlockchain } from \"@agntn\u002Fkeys\";\nimport Bitcoin from \"@agntn\u002Fkeys\u002Fblockchains\u002Fbitcoin\";\n\nconst chain = useBlockchain(new Bitcoin());\nconst wallet = chain.generateWallet();\n\nwallet.keys.private;\nwallet.keys.public;\nwallet.address;\n","js",[106,189,190,222,240,246,272,294,299,317,333],{"__ignoreMap":104},[109,191,192,195,198,202,205,209,213,217,220],{"class":111,"line":112},[109,193,194],{"class":123},"import",[109,196,197],{"class":131}," {",[109,199,201],{"class":200},"snHMy"," useBlockchain",[109,203,204],{"class":131}," }",[109,206,208],{"class":207},"stCPd"," from",[109,210,212],{"class":211},"scVjq"," \"",[109,214,216],{"class":215},"sQ7BG","@agntn\u002Fkeys",[109,218,219],{"class":211},"\"",[109,221,149],{"class":131},[109,223,224,226,229,231,233,236,238],{"class":111,"line":135},[109,225,194],{"class":123},[109,227,228],{"class":200}," Bitcoin",[109,230,208],{"class":207},[109,232,212],{"class":211},[109,234,235],{"class":215},"@agntn\u002Fkeys\u002Fblockchains\u002Fbitcoin",[109,237,219],{"class":211},[109,239,149],{"class":131},[109,241,242],{"class":111,"line":152},[109,243,245],{"emptyLinePlaceholder":244},true,"\n",[109,247,248,251,255,258,261,264,267,269],{"class":111,"line":169},[109,249,250],{"class":115},"const",[109,252,254],{"class":253},"saoiD"," chain",[109,256,257],{"class":115}," =",[109,259,201],{"class":260},"sULi6",[109,262,263],{"class":131},"(",[109,265,266],{"class":123},"new",[109,268,228],{"class":260},[109,270,271],{"class":131},"());\n",[109,273,275,277,280,282,285,288,291],{"class":111,"line":274},5,[109,276,250],{"class":115},[109,278,279],{"class":253}," wallet",[109,281,257],{"class":115},[109,283,254],{"class":284},"spVlQ",[109,286,287],{"class":131},".",[109,289,290],{"class":260},"generateWallet",[109,292,293],{"class":131},"();\n",[109,295,297],{"class":111,"line":296},6,[109,298,245],{"emptyLinePlaceholder":244},[109,300,302,305,307,310,312,315],{"class":111,"line":301},7,[109,303,304],{"class":284},"wallet",[109,306,287],{"class":131},[109,308,309],{"class":284},"keys",[109,311,287],{"class":131},[109,313,314],{"class":284},"private",[109,316,149],{"class":131},[109,318,320,322,324,326,328,331],{"class":111,"line":319},8,[109,321,304],{"class":284},[109,323,287],{"class":131},[109,325,309],{"class":284},[109,327,287],{"class":131},[109,329,330],{"class":284},"public",[109,332,149],{"class":131},[109,334,336,338,340,343],{"class":111,"line":335},9,[109,337,304],{"class":284},[109,339,287],{"class":131},[109,341,342],{"class":284},"address",[109,344,149],{"class":131},[95,346,347,348,351,352,287],{},"Two optional arguments: key options first, address type second. The key options go to ",[106,349,350],{},"generateKeys",", the address type to ",[106,353,354],{},"getAddress",[99,356,358],{"className":185,"code":357,"language":187,"meta":104,"style":104},"chain.generateWallet({ compressed: false }); \u002F\u002F uncompressed public key, legacy address\nchain.generateWallet({}, \"p2sh\"); \u002F\u002F starts with 3\nchain.generateWallet({}, \"taproot\"); \u002F\u002F starts with bc1p\n",[106,359,360,388,412],{"__ignoreMap":104},[109,361,362,365,367,369,372,375,377,381,384],{"class":111,"line":112},[109,363,364],{"class":284},"chain",[109,366,287],{"class":131},[109,368,290],{"class":260},[109,370,371],{"class":131},"({",[109,373,374],{"class":200}," compressed",[109,376,142],{"class":131},[109,378,380],{"class":379},"sNe8j"," false",[109,382,383],{"class":131}," }); ",[109,385,387],{"class":386},"sjhu3","\u002F\u002F uncompressed public key, legacy address\n",[109,389,390,392,394,396,399,401,404,406,409],{"class":111,"line":135},[109,391,364],{"class":284},[109,393,287],{"class":131},[109,395,290],{"class":260},[109,397,398],{"class":131},"({}, ",[109,400,219],{"class":211},[109,402,403],{"class":215},"p2sh",[109,405,219],{"class":211},[109,407,408],{"class":131},"); ",[109,410,411],{"class":386},"\u002F\u002F starts with 3\n",[109,413,414,416,418,420,422,424,427,429,431],{"class":111,"line":152},[109,415,364],{"class":284},[109,417,287],{"class":131},[109,419,290],{"class":260},[109,421,398],{"class":131},[109,423,219],{"class":211},[109,425,426],{"class":215},"taproot",[109,428,219],{"class":211},[109,430,408],{"class":131},[109,432,433],{"class":386},"\u002F\u002F starts with bc1p\n",[95,435,436],{},"That empty object in the middle is annoying but honest: the address type is the second parameter and there's no overload that lets you skip the first.",[90,438,440],{"id":439},"a-key-you-already-have","A key you already have",[99,442,444],{"className":185,"code":443,"language":187,"meta":104,"style":104},"const privateKey = \"7f9e5b9e3bbed34a4c28c8c1665525fc2cd7afb4fdc7edca3eb93ddf8a31ef56\";\nconst wallet = chain.deriveWallet(privateKey);\nconst segwitWallet = chain.deriveWallet(privateKey, {}, \"segwit\");\n",[106,445,446,464,487],{"__ignoreMap":104},[109,447,448,450,453,455,457,460,462],{"class":111,"line":112},[109,449,250],{"class":115},[109,451,452],{"class":253}," privateKey",[109,454,257],{"class":115},[109,456,212],{"class":211},[109,458,459],{"class":215},"7f9e5b9e3bbed34a4c28c8c1665525fc2cd7afb4fdc7edca3eb93ddf8a31ef56",[109,461,219],{"class":211},[109,463,149],{"class":131},[109,465,466,468,470,472,474,476,479,481,484],{"class":111,"line":135},[109,467,250],{"class":115},[109,469,279],{"class":253},[109,471,257],{"class":115},[109,473,254],{"class":284},[109,475,287],{"class":131},[109,477,478],{"class":260},"deriveWallet",[109,480,263],{"class":131},[109,482,483],{"class":284},"privateKey",[109,485,486],{"class":131},");\n",[109,488,489,491,494,496,498,500,502,504,506,509,511,514,516],{"class":111,"line":152},[109,490,250],{"class":115},[109,492,493],{"class":253}," segwitWallet",[109,495,257],{"class":115},[109,497,254],{"class":284},[109,499,287],{"class":131},[109,501,478],{"class":260},[109,503,263],{"class":131},[109,505,483],{"class":284},[109,507,508],{"class":131},", {}, ",[109,510,219],{"class":211},[109,512,513],{"class":215},"segwit",[109,515,219],{"class":211},[109,517,486],{"class":131},[95,519,520,521,523,524,527,528,533],{},"Same arguments as ",[106,522,290],{},", minus the randomness. Got a WIF instead of hex? ",[106,525,526],{},"decodeWIF"," on the ",[529,530,532],"a",{"href":531},"\u002Fguide\u002Fkeys#wif","keys page"," turns it into the hex this call wants, compression flag included.",[90,535,537],{"id":536},"from-a-mnemonic","From a mnemonic",[95,539,540,543],{},[106,541,542],{},"deriveHDWallet"," walks a BIP39 mnemonic down a derivation path and returns the wallet at the end:",[99,545,547],{"className":185,"code":546,"language":187,"meta":104,"style":104},"const mnemonic =\n  \"abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about\";\n\nchain.deriveHDWallet(mnemonic, \"m\u002F84'\u002F0'\u002F0'\u002F0\u002F0\").address; \u002F\u002F bc1q...\nchain.deriveHDWallet(mnemonic, \"m\u002F44'\u002F0'\u002F0'\u002F0\u002F0\", { passphrase: \"TREZOR\" }, \"p2sh\");\n",[106,548,549,559,571,575,609],{"__ignoreMap":104},[109,550,551,553,556],{"class":111,"line":112},[109,552,250],{"class":115},[109,554,555],{"class":253}," mnemonic",[109,557,558],{"class":115}," =\n",[109,560,561,564,567,569],{"class":111,"line":135},[109,562,563],{"class":211},"  \"",[109,565,566],{"class":215},"abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about",[109,568,219],{"class":211},[109,570,149],{"class":131},[109,572,573],{"class":111,"line":152},[109,574,245],{"emptyLinePlaceholder":244},[109,576,577,579,581,583,585,588,591,593,596,598,601,603,606],{"class":111,"line":169},[109,578,364],{"class":284},[109,580,287],{"class":131},[109,582,542],{"class":260},[109,584,263],{"class":131},[109,586,587],{"class":284},"mnemonic",[109,589,590],{"class":131},", ",[109,592,219],{"class":211},[109,594,595],{"class":215},"m\u002F84'\u002F0'\u002F0'\u002F0\u002F0",[109,597,219],{"class":211},[109,599,600],{"class":131},").",[109,602,342],{"class":284},[109,604,605],{"class":131},"; ",[109,607,608],{"class":386},"\u002F\u002F bc1q...\n",[109,610,611,613,615,617,619,621,623,625,628,630,633,636,638,640,643,645,648,650,652,654],{"class":111,"line":274},[109,612,364],{"class":284},[109,614,287],{"class":131},[109,616,542],{"class":260},[109,618,263],{"class":131},[109,620,587],{"class":284},[109,622,590],{"class":131},[109,624,219],{"class":211},[109,626,627],{"class":215},"m\u002F44'\u002F0'\u002F0'\u002F0\u002F0",[109,629,219],{"class":211},[109,631,632],{"class":131},", {",[109,634,635],{"class":200}," passphrase",[109,637,142],{"class":131},[109,639,212],{"class":211},[109,641,642],{"class":215},"TREZOR",[109,644,219],{"class":211},[109,646,647],{"class":131}," }, ",[109,649,219],{"class":211},[109,651,403],{"class":215},[109,653,219],{"class":211},[109,655,486],{"class":131},[95,657,658],{},"Things that will bite you:",[660,661,662,666,677,696,699],"ul",{},[663,664,665],"li",{},"The mnemonic has to be English BIP39 words, 12, 15, 18, 21 or 24 of them, and the checksum has to hold. A typo in word eleven fails before any derivation happens. The checksum part is negotiable, see the next section.",[663,667,668,669,672,673,676],{},"secp256k1 chains derive with BIP32, ed25519 chains with SLIP-10. SLIP-10 only has hardened children, so Solana, Stellar, Aptos, and Sui on ed25519 need every segment hardened: ",[106,670,671],{},"m\u002F44'\u002F501'\u002F0'\u002F0'",". ",[106,674,675],{},"chain.getDerivationPath(account)"," writes the path that chain's wallets use, hardened where it has to be and no deeper than the chain goes, so you don't have to remember which one stops where.",[663,678,679,680,683,684,687,688,691,692,695],{},"Bitcoin and Litecoin read the purpose when you don't pass an address type. ",[106,681,682],{},"m\u002F44'"," gives legacy, ",[106,685,686],{},"m\u002F49'"," p2sh, ",[106,689,690],{},"m\u002F84'"," segwit, ",[106,693,694],{},"m\u002F86'"," taproot. An explicit type wins.",[663,697,698],{},"Cardano throws. CIP-1852 starts from the entropy, not from the BIP39 seed, and pretending otherwise would hand you addresses that no Cardano wallet recognises.",[663,700,701,702,704],{},"Decred throws too. Its HD derivation strips leading zero bytes where BIP32 keeps them, so a plain BIP32 walk lands on the wrong key for some paths and looks fine doing it. ",[106,703,478],{}," with a private key works on both.",[95,706,707],{},"The mnemonic above is the public BIP39 test vector. It's fine for docs and tests and for nothing else.",[90,709,711],{"id":710},"puzzle-mnemonics","Puzzle mnemonics",[95,713,714,715,717],{},"A puzzle phrase with a broken checksum isn't a wrong answer, it's Tuesday. Without a flag ",[106,716,542],{}," throws on it. With the flag you get the wallet and a warning, the words exactly as given, nothing repaired:",[99,719,721],{"className":185,"code":720,"language":187,"meta":104,"style":104},"const puzzle =\n  \"path mad alien apology escape spare miss goddess leopard crime visit clock start first blade guard close barrel term screen matrix toy ghost shine\";\n\nconst wallet = chain.deriveHDWallet(puzzle, \"m\u002F84'\u002F0'\u002F0'\u002F0\u002F0\", { allowInvalidChecksum: true });\n\nwallet.address; \u002F\u002F bc1q94ecsn0qk8lap2gefrycnms3ruepy889z969a6\nwallet.warnings;\n\u002F\u002F [ 'BIP39 checksum is invalid. Derived from the supplied words without repairing the checksum.' ]\n",[106,722,723,732,743,747,788,792,805,815],{"__ignoreMap":104},[109,724,725,727,730],{"class":111,"line":112},[109,726,250],{"class":115},[109,728,729],{"class":253}," puzzle",[109,731,558],{"class":115},[109,733,734,736,739,741],{"class":111,"line":135},[109,735,563],{"class":211},[109,737,738],{"class":215},"path mad alien apology escape spare miss goddess leopard crime visit clock start first blade guard close barrel term screen matrix toy ghost shine",[109,740,219],{"class":211},[109,742,149],{"class":131},[109,744,745],{"class":111,"line":152},[109,746,245],{"emptyLinePlaceholder":244},[109,748,749,751,753,755,757,759,761,763,766,768,770,772,774,776,779,781,785],{"class":111,"line":169},[109,750,250],{"class":115},[109,752,279],{"class":253},[109,754,257],{"class":115},[109,756,254],{"class":284},[109,758,287],{"class":131},[109,760,542],{"class":260},[109,762,263],{"class":131},[109,764,765],{"class":284},"puzzle",[109,767,590],{"class":131},[109,769,219],{"class":211},[109,771,595],{"class":215},[109,773,219],{"class":211},[109,775,632],{"class":131},[109,777,778],{"class":200}," allowInvalidChecksum",[109,780,142],{"class":131},[109,782,784],{"class":783},"siHFe"," true",[109,786,787],{"class":131}," });\n",[109,789,790],{"class":111,"line":274},[109,791,245],{"emptyLinePlaceholder":244},[109,793,794,796,798,800,802],{"class":111,"line":296},[109,795,304],{"class":284},[109,797,287],{"class":131},[109,799,342],{"class":284},[109,801,605],{"class":131},[109,803,804],{"class":386},"\u002F\u002F bc1q94ecsn0qk8lap2gefrycnms3ruepy889z969a6\n",[109,806,807,809,811,813],{"class":111,"line":301},[109,808,304],{"class":284},[109,810,287],{"class":131},[109,812,177],{"class":284},[109,814,149],{"class":131},[109,816,817],{"class":111,"line":319},[109,818,819],{"class":386},"\u002F\u002F [ 'BIP39 checksum is invalid. Derived from the supplied words without repairing the checksum.' ]\n",[95,821,822],{},"The flag only relaxes the checksum. Word count and dictionary are still enforced, whitespace still collapses and NFKD still applies, so it isn't a back door for arbitrary text. Valid phrases give the same result with or without it.",[95,824,825],{},"To see which check failed, ask before deriving:",[99,827,829],{"className":185,"code":828,"language":187,"meta":104,"style":104},"import { inspectBIP39Mnemonic, getMnemonicWordCandidates } from \"@agntn\u002Fkeys\u002Fbip39\";\n\ninspectBIP39Mnemonic(puzzle);\n\u002F\u002F { valid: false, words: 24, wordCountValid: true, wordlistValid: true, checksumValid: false }\n\ngetMnemonicWordCandidates(puzzle.replace(\u002Fshine$\u002F, \"?\"));\n\u002F\u002F [ 'aware', 'divide', 'embark', 'globe', 'pact', 'roof', 'solve', 'today' ]\n",[106,830,831,859,863,874,879,883,923],{"__ignoreMap":104},[109,832,833,835,837,840,843,846,848,850,852,855,857],{"class":111,"line":112},[109,834,194],{"class":123},[109,836,197],{"class":131},[109,838,839],{"class":200}," inspectBIP39Mnemonic",[109,841,842],{"class":131},",",[109,844,845],{"class":200}," getMnemonicWordCandidates",[109,847,204],{"class":131},[109,849,208],{"class":207},[109,851,212],{"class":211},[109,853,854],{"class":215},"@agntn\u002Fkeys\u002Fbip39",[109,856,219],{"class":211},[109,858,149],{"class":131},[109,860,861],{"class":111,"line":135},[109,862,245],{"emptyLinePlaceholder":244},[109,864,865,868,870,872],{"class":111,"line":152},[109,866,867],{"class":260},"inspectBIP39Mnemonic",[109,869,263],{"class":131},[109,871,765],{"class":284},[109,873,486],{"class":131},[109,875,876],{"class":111,"line":169},[109,877,878],{"class":386},"\u002F\u002F { valid: false, words: 24, wordCountValid: true, wordlistValid: true, checksumValid: false }\n",[109,880,881],{"class":111,"line":274},[109,882,245],{"emptyLinePlaceholder":244},[109,884,885,888,890,892,894,897,899,902,906,909,911,913,915,918,920],{"class":111,"line":296},[109,886,887],{"class":260},"getMnemonicWordCandidates",[109,889,263],{"class":131},[109,891,765],{"class":284},[109,893,287],{"class":131},[109,895,896],{"class":260},"replace",[109,898,263],{"class":131},[109,900,901],{"class":211},"\u002F",[109,903,905],{"class":904},"sLrG9","shine",[109,907,908],{"class":207},"$",[109,910,901],{"class":211},[109,912,590],{"class":131},[109,914,219],{"class":211},[109,916,917],{"class":215},"?",[109,919,219],{"class":211},[109,921,922],{"class":131},"));\n",[109,924,925],{"class":111,"line":301},[109,926,927],{"class":386},"\u002F\u002F [ 'aware', 'divide', 'embark', 'globe', 'pact', 'roof', 'solve', 'today' ]\n",[95,929,930,932,933,936,937,940,941,943,944,946,947,949],{},[106,931,867],{}," splits the verdict three ways and never echoes the phrase. ",[106,934,935],{},"checksumValid"," is ",[106,938,939],{},"null"," when the count or the dictionary already failed, because there's nothing to check yet. ",[106,942,887],{}," takes a phrase with exactly one ",[106,945,917],{}," and returns every English word that makes the checksum pass, in list order. ",[106,948,905],{}," isn't one of the eight, and each of the eight opens a different wallet, so the library won't pick one for you. That's how a \"fixed\" mnemonic loses a puzzle.",[95,951,952,953,956,957,960],{},"Both helpers and the flag are English only. The other nine word lists are there for lookups and generation, ",[106,954,955],{},"lookupBIP39Words"," and ",[106,958,959],{},"loadBIP39Wordlist"," on the same import. The MCP and Pi tools expose the same flag and the same diagnostics.",[90,962,964],{"id":963},"security-again","Security, again",[95,966,967],{},"The library doesn't store keys, encrypt keys, or forget keys. Whatever calls it holds the private key in memory as a plain string, and so does every log line that prints a wallet object. Generate throwaway keys for tests, keep real ones on hardware, and be twice as careful in a browser tab where an extension can read the page.",[90,969,971],{"id":970},"the-whole-method","The whole method",[95,973,974,975,977],{},"This is all ",[106,976,290],{}," is:",[99,979,983],{"className":980,"code":981,"language":982,"meta":104,"style":104},"language-ts shiki shiki-themes github-light github-light poimandres","generateWallet(options?: KeyOptions, addressType?: AddressType): Wallet {\n  const keys = this.generateKeys(options);\n  const address = this.getAddress(keys.keys.public, addressType);\n\n  return { ...keys, address };\n}\n","ts",[106,984,985,1017,1041,1074,1078,1098],{"__ignoreMap":104},[109,986,987,989,991,994,996,999,1001,1004,1006,1009,1012,1015],{"class":111,"line":112},[109,988,290],{"class":260},[109,990,263],{"class":131},[109,992,993],{"class":284},"options",[109,995,158],{"class":115},[109,997,998],{"class":284}," KeyOptions",[109,1000,590],{"class":131},[109,1002,1003],{"class":284},"addressType",[109,1005,158],{"class":115},[109,1007,1008],{"class":284}," AddressType",[109,1010,1011],{"class":131},"): ",[109,1013,1014],{"class":284},"Wallet",[109,1016,132],{"class":131},[109,1018,1019,1022,1025,1027,1031,1033,1035,1037,1039],{"class":111,"line":135},[109,1020,1021],{"class":115},"  const",[109,1023,1024],{"class":253}," keys",[109,1026,257],{"class":115},[109,1028,1030],{"class":1029},"s-lox"," this",[109,1032,287],{"class":131},[109,1034,350],{"class":260},[109,1036,263],{"class":131},[109,1038,993],{"class":284},[109,1040,486],{"class":131},[109,1042,1043,1045,1048,1050,1052,1054,1056,1058,1060,1062,1064,1066,1068,1070,1072],{"class":111,"line":152},[109,1044,1021],{"class":115},[109,1046,1047],{"class":253}," address",[109,1049,257],{"class":115},[109,1051,1030],{"class":1029},[109,1053,287],{"class":131},[109,1055,354],{"class":260},[109,1057,263],{"class":131},[109,1059,309],{"class":284},[109,1061,287],{"class":131},[109,1063,309],{"class":284},[109,1065,287],{"class":131},[109,1067,330],{"class":284},[109,1069,590],{"class":131},[109,1071,1003],{"class":284},[109,1073,486],{"class":131},[109,1075,1076],{"class":111,"line":169},[109,1077,245],{"emptyLinePlaceholder":244},[109,1079,1080,1084,1086,1089,1091,1093,1095],{"class":111,"line":274},[109,1081,1083],{"class":1082},"sZW6a","  return",[109,1085,197],{"class":131},[109,1087,1088],{"class":115}," ...",[109,1090,309],{"class":284},[109,1092,842],{"class":131},[109,1094,1047],{"class":284},[109,1096,1097],{"class":131}," };\n",[109,1099,1100],{"class":111,"line":296},[109,1101,172],{"class":131},[95,1103,1104,1105,1108],{},"It lives on ",[106,1106,1107],{},"AbstractBlockchain",", so every chain, including one you write yourself, gets it for free.",[1110,1111,1112],"style",{},"html pre.shiki code .s1TYA, html code.shiki .s1TYA{--shiki-light:#D73A49;--shiki-default:#D73A49;--shiki-dark:#91B4D5}html pre.shiki code .sCrqT, html code.shiki .sCrqT{--shiki-light:#6F42C1;--shiki-default:#6F42C1;--shiki-dark:#A6ACCDC0}html pre.shiki code .sP0CR, html code.shiki .sP0CR{--shiki-light:#D73A49;--shiki-default:#D73A49;--shiki-dark:#5DE4C7}html pre.shiki code .scZRh, html code.shiki .scZRh{--shiki-light:#6F42C1;--shiki-default:#6F42C1;--shiki-dark:#ADD7FF}html pre.shiki code .sKlNE, html code.shiki .sKlNE{--shiki-light:#24292E;--shiki-default:#24292E;--shiki-dark:#A6ACCD}html pre.shiki code .s0VbO, html code.shiki .s0VbO{--shiki-light:#E36209;--shiki-default:#E36209;--shiki-dark:#A6ACCD}html pre.shiki code .s8yaW, html code.shiki .s8yaW{--shiki-light:#005CC5;--shiki-default:#005CC5;--shiki-dark:#A6ACCDC0}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .snHMy, html code.shiki .snHMy{--shiki-light:#24292E;--shiki-default:#24292E;--shiki-dark:#ADD7FF}html pre.shiki code .stCPd, html code.shiki .stCPd{--shiki-light:#D73A49;--shiki-default:#D73A49;--shiki-dark:#A6ACCD}html pre.shiki code .scVjq, html code.shiki .scVjq{--shiki-light:#032F62;--shiki-default:#032F62;--shiki-dark:#A6ACCD}html pre.shiki code .sQ7BG, html code.shiki .sQ7BG{--shiki-light:#032F62;--shiki-default:#032F62;--shiki-dark:#5DE4C7}html pre.shiki code .saoiD, html code.shiki .saoiD{--shiki-light:#005CC5;--shiki-default:#005CC5;--shiki-dark:#E4F0FB}html pre.shiki code .sULi6, html code.shiki .sULi6{--shiki-light:#6F42C1;--shiki-default:#6F42C1;--shiki-dark:#E4F0FBD0}html pre.shiki code .spVlQ, html code.shiki .spVlQ{--shiki-light:#24292E;--shiki-default:#24292E;--shiki-dark:#E4F0FB}html pre.shiki code .sNe8j, html code.shiki .sNe8j{--shiki-light:#005CC5;--shiki-default:#005CC5;--shiki-dark:#D0679D}html pre.shiki code .sjhu3, html code.shiki .sjhu3{--shiki-light:#6A737D;--shiki-light-font-style:inherit;--shiki-default:#6A737D;--shiki-default-font-style:inherit;--shiki-dark:#767C9DB0;--shiki-dark-font-style:italic}html pre.shiki code .siHFe, html code.shiki .siHFe{--shiki-light:#005CC5;--shiki-default:#005CC5;--shiki-dark:#5DE4C7}html pre.shiki code .sLrG9, html code.shiki .sLrG9{--shiki-light:#032F62;--shiki-default:#032F62;--shiki-dark:#5FB3A1}html pre.shiki code .s-lox, html code.shiki .s-lox{--shiki-light:#005CC5;--shiki-light-font-style:inherit;--shiki-default:#005CC5;--shiki-default-font-style:inherit;--shiki-dark:#5DE4C7;--shiki-dark-font-style:italic}html pre.shiki code .sZW6a, html code.shiki .sZW6a{--shiki-light:#D73A49;--shiki-default:#D73A49;--shiki-dark:#5DE4C7C0}",{"title":104,"searchDepth":135,"depth":135,"links":1114},[1115,1116,1117,1118,1119,1120,1121],{"id":92,"depth":135,"text":93},{"id":181,"depth":135,"text":182},{"id":439,"depth":135,"text":440},{"id":536,"depth":135,"text":537},{"id":710,"depth":135,"text":711},{"id":963,"depth":135,"text":964},{"id":970,"depth":135,"text":971},"One call for keys plus address. Import a key you already have. Walk a mnemonic down a path with a broken checksum if you must.","md",null,{"icon":1126},"i-lucide-wallet",{"title":20,"description":1122},"SFuidfwtenJxFPvnPgnP3n6xp8pOSu9ir1LD3Zvry4w",[1130,1132],{"title":16,"path":17,"stem":18,"description":1131,"children":-1},"Turn a public key into an address. Pick a format. Check one you were given.",{"title":24,"path":25,"stem":26,"description":1133,"children":-1},"Ethereum and Base share one implementation. One address and one signing scheme.",1789827526012]