[{"data":1,"prerenderedAt":1836},["ShallowReactive",2],{"navigation_docs":3,"-guide-validation":196,"-guide-validation-surround":1831},[4,44],{"title":5,"path":6,"stem":7,"children":8,"icon":43},"Guide","\u002Fguide","1.guide\u002F01.index",[9,11,15,19,23,27,31,35,39],{"title":10,"path":6,"stem":7},"Getting Started",{"title":12,"path":13,"stem":14},"Registry and aliases","\u002Fguide\u002Fregistry","1.guide\u002F02.registry",{"title":16,"path":17,"stem":18},"Address validation","\u002Fguide\u002Fvalidation","1.guide\u002F03.validation",{"title":20,"path":21,"stem":22},"Identify","\u002Fguide\u002Fidentify","1.guide\u002F04.identify",{"title":24,"path":25,"stem":26},"Metadata","\u002Fguide\u002Fmetadata","1.guide\u002F05.metadata",{"title":28,"path":29,"stem":30},"CLI","\u002Fguide\u002Fcli","1.guide\u002F06.cli",{"title":32,"path":33,"stem":34},"Agents","\u002Fguide\u002Fagents","1.guide\u002F07.agents",{"title":36,"path":37,"stem":38},"Custom chains","\u002Fguide\u002Fcustom","1.guide\u002F08.custom",{"title":40,"path":41,"stem":42},"Playground","\u002Fguide\u002Fplayground","1.guide\u002F09.playground","i-lucide-book-open",{"title":45,"path":46,"stem":47,"children":48,"icon":195},"Chains","\u002Fchains","2.chains\u002F00.index",[49,51,55,59,63,67,71,75,79,83,87,91,95,99,103,107,111,115,119,123,127,131,135,139,143,147,151,155,159,163,167,171,175,179,183,187,191],{"title":50,"path":46,"stem":47},"Overview",{"title":52,"path":53,"stem":54},"Ethereum","\u002Fchains\u002Fethereum","2.chains\u002F01.ethereum",{"title":56,"path":57,"stem":58},"Base","\u002Fchains\u002Fbase","2.chains\u002F02.base",{"title":60,"path":61,"stem":62},"Arbitrum One","\u002Fchains\u002Farbitrum","2.chains\u002F03.arbitrum",{"title":64,"path":65,"stem":66},"Optimism","\u002Fchains\u002Foptimism","2.chains\u002F04.optimism",{"title":68,"path":69,"stem":70},"Polygon PoS","\u002Fchains\u002Fpolygon","2.chains\u002F05.polygon",{"title":72,"path":73,"stem":74},"BNB Chain","\u002Fchains\u002Fbsc","2.chains\u002F06.bsc",{"title":76,"path":77,"stem":78},"Avalanche C-Chain","\u002Fchains\u002Favalanche","2.chains\u002F07.avalanche",{"title":80,"path":81,"stem":82},"Fantom Opera","\u002Fchains\u002Ffantom","2.chains\u002F08.fantom",{"title":84,"path":85,"stem":86},"Gnosis Chain","\u002Fchains\u002Fgnosis","2.chains\u002F09.gnosis",{"title":88,"path":89,"stem":90},"Linea","\u002Fchains\u002Flinea","2.chains\u002F10.linea",{"title":92,"path":93,"stem":94},"zkSync Era","\u002Fchains\u002Fzksync","2.chains\u002F11.zksync",{"title":96,"path":97,"stem":98},"Scroll","\u002Fchains\u002Fscroll","2.chains\u002F12.scroll",{"title":100,"path":101,"stem":102},"Berachain","\u002Fchains\u002Fberachain","2.chains\u002F13.berachain",{"title":104,"path":105,"stem":106},"Bitcoin","\u002Fchains\u002Fbitcoin","2.chains\u002F14.bitcoin",{"title":108,"path":109,"stem":110},"Litecoin","\u002Fchains\u002Flitecoin","2.chains\u002F15.litecoin",{"title":112,"path":113,"stem":114},"Pepecoin","\u002Fchains\u002Fpepecoin","2.chains\u002F16.pepecoin",{"title":116,"path":117,"stem":118},"eCash","\u002Fchains\u002Fecash","2.chains\u002F17.ecash",{"title":120,"path":121,"stem":122},"Cardano","\u002Fchains\u002Fcardano","2.chains\u002F18.cardano",{"title":124,"path":125,"stem":126},"Solana","\u002Fchains\u002Fsolana","2.chains\u002F19.solana",{"title":128,"path":129,"stem":130},"Stellar","\u002Fchains\u002Fstellar","2.chains\u002F20.stellar",{"title":132,"path":133,"stem":134},"XRP Ledger","\u002Fchains\u002Fxrpl","2.chains\u002F21.xrpl",{"title":136,"path":137,"stem":138},"Aptos","\u002Fchains\u002Faptos","2.chains\u002F22.aptos",{"title":140,"path":141,"stem":142},"Sui","\u002Fchains\u002Fsui","2.chains\u002F23.sui",{"title":144,"path":145,"stem":146},"TON (The Open Network)","\u002Fchains\u002Fton","2.chains\u002F24.ton",{"title":148,"path":149,"stem":150},"TRON","\u002Fchains\u002Ftron","2.chains\u002F25.tron",{"title":152,"path":153,"stem":154},"Octra","\u002Fchains\u002Foctra","2.chains\u002F26.octra",{"title":156,"path":157,"stem":158},"Arweave","\u002Fchains\u002Farweave","2.chains\u002F27.arweave",{"title":160,"path":161,"stem":162},"Monero","\u002Fchains\u002Fmonero","2.chains\u002F28.monero",{"title":164,"path":165,"stem":166},"Decred","\u002Fchains\u002Fdecred","2.chains\u002F29.decred",{"title":168,"path":169,"stem":170},"Arc","\u002Fchains\u002Farc","2.chains\u002F30.arc",{"title":172,"path":173,"stem":174},"Dogecoin","\u002Fchains\u002Fdogecoin","2.chains\u002F31.dogecoin",{"title":176,"path":177,"stem":178},"Bitcoin Cash","\u002Fchains\u002Fbitcoincash","2.chains\u002F32.bitcoincash",{"title":180,"path":181,"stem":182},"Bitcoin SV","\u002Fchains\u002Fbitcoinsv","2.chains\u002F33.bitcoinsv",{"title":184,"path":185,"stem":186},"Bitcoin Gold","\u002Fchains\u002Fbitcoingold","2.chains\u002F34.bitcoingold",{"title":188,"path":189,"stem":190},"Dash","\u002Fchains\u002Fdash","2.chains\u002F35.dash",{"title":192,"path":193,"stem":194},"Zcash","\u002Fchains\u002Fzcash","2.chains\u002F36.zcash","i-lucide-link",{"id":197,"title":16,"body":198,"description":1824,"extension":1825,"links":1826,"meta":1827,"navigation":244,"path":17,"seo":1829,"stem":18,"__hash__":1830},"docs\u002F1.guide\u002F03.validation.md",{"type":199,"value":200,"toc":1815},"minimark",[201,206,403,422,452,463,467,470,474,1097,1100,1104,1111,1233,1236,1256,1454,1472,1476,1487,1491,1573,1602,1767,1791,1795,1811],[202,203,205],"h2",{"id":204},"the-call","The call",[207,208,213],"pre",{"className":209,"code":210,"language":211,"meta":212,"style":212},"language-ts shiki shiki-themes chains chains chains","import { getChain, InvalidAddressError } from \"@agntn\u002Fchains\";\n\nconst bitcoin = getChain(\"btc\");\n\nbitcoin.validatesAddress; \u002F\u002F true\nbitcoin.assertAddress(\"bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4\"); \u002F\u002F returns the address\n\ntry {\n  bitcoin.assertAddress(\"bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t5\");\n} catch (error) {\n  error instanceof InvalidAddressError; \u002F\u002F true, the checksum caught the last digit\n  (error as InvalidAddressError).chain; \u002F\u002F \"bitcoin\"\n  (error as InvalidAddressError).reason; \u002F\u002F \"the Bech32 checksum does not hold, so a character is wrong\"\n}\n","ts","",[214,215,216,239,246,271,276,286,306,311,320,335,347,365,382,397],"code",{"__ignoreMap":212},[217,218,221,225,229,232,236],"span",{"class":219,"line":220},"line",1,[217,222,224],{"class":223},"skH_V","import",[217,226,228],{"class":227},"s38Sx"," { getChain, InvalidAddressError } ",[217,230,231],{"class":223},"from",[217,233,235],{"class":234},"shU9J"," \"@agntn\u002Fchains\"",[217,237,238],{"class":227},";\n",[217,240,242],{"class":219,"line":241},2,[217,243,245],{"emptyLinePlaceholder":244},true,"\n",[217,247,249,252,255,258,262,265,268],{"class":219,"line":248},3,[217,250,251],{"class":223},"const",[217,253,254],{"class":227}," bitcoin ",[217,256,257],{"class":223},"=",[217,259,261],{"class":260},"sK71F"," getChain",[217,263,264],{"class":227},"(",[217,266,267],{"class":234},"\"btc\"",[217,269,270],{"class":227},");\n",[217,272,274],{"class":219,"line":273},4,[217,275,245],{"emptyLinePlaceholder":244},[217,277,279,282],{"class":219,"line":278},5,[217,280,281],{"class":227},"bitcoin.validatesAddress; ",[217,283,285],{"class":284},"scIB-","\u002F\u002F true\n",[217,287,289,292,295,297,300,303],{"class":219,"line":288},6,[217,290,291],{"class":227},"bitcoin.",[217,293,294],{"class":260},"assertAddress",[217,296,264],{"class":227},[217,298,299],{"class":234},"\"bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4\"",[217,301,302],{"class":227},"); ",[217,304,305],{"class":284},"\u002F\u002F returns the address\n",[217,307,309],{"class":219,"line":308},7,[217,310,245],{"emptyLinePlaceholder":244},[217,312,314,317],{"class":219,"line":313},8,[217,315,316],{"class":223},"try",[217,318,319],{"class":227}," {\n",[217,321,323,326,328,330,333],{"class":219,"line":322},9,[217,324,325],{"class":227},"  bitcoin.",[217,327,294],{"class":260},[217,329,264],{"class":227},[217,331,332],{"class":234},"\"bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t5\"",[217,334,270],{"class":227},[217,336,338,341,344],{"class":219,"line":337},10,[217,339,340],{"class":227},"} ",[217,342,343],{"class":223},"catch",[217,345,346],{"class":227}," (error) {\n",[217,348,350,353,356,359,362],{"class":219,"line":349},11,[217,351,352],{"class":227},"  error ",[217,354,355],{"class":223},"instanceof",[217,357,358],{"class":260}," InvalidAddressError",[217,360,361],{"class":227},"; ",[217,363,364],{"class":284},"\u002F\u002F true, the checksum caught the last digit\n",[217,366,368,371,374,376,379],{"class":219,"line":367},12,[217,369,370],{"class":227},"  (error ",[217,372,373],{"class":223},"as",[217,375,358],{"class":260},[217,377,378],{"class":227},").chain; ",[217,380,381],{"class":284},"\u002F\u002F \"bitcoin\"\n",[217,383,385,387,389,391,394],{"class":219,"line":384},13,[217,386,370],{"class":227},[217,388,373],{"class":223},[217,390,358],{"class":260},[217,392,393],{"class":227},").reason; ",[217,395,396],{"class":284},"\u002F\u002F \"the Bech32 checksum does not hold, so a character is wrong\"\n",[217,398,400],{"class":219,"line":399},14,[217,401,402],{"class":227},"}\n",[404,405,406,409,410,413,414,417,418,421],"p",{},[214,407,408],{},"chain.assertAddress(address)"," returns the address when it fits the chain's format and throws ",[214,411,412],{},"InvalidAddressError"," when it doesn't. Chains without a validator throw ",[214,415,416],{},"AddressValidationUnsupportedError"," instead of quietly saying yes, and ",[214,419,420],{},"chain.validatesAddress"," tells you which ones those are before you ask. Right now every built-in chain validates. A false green light costs more than a false alarm when the caller is about to send funds.",[404,423,424,425,428,429,432,433,436,437,440,441,444,445,448,449,451],{},"An EVM rejection also says why, in ",[214,426,427],{},".reason"," and at the end of the message. ",[214,430,431],{},"39 hex digits after 0x, not 40"," is a digit lost in the copy. ",[214,434,435],{},"the mixed case does not match the EIP-55 checksum"," means the digits are there but one of them, or one letter's case, is wrong. The CLI and the agent tools print the reason too, so a model knows what to fix instead of sending the string again. Bitcoin and the chains on its encodings say why as well. ",[214,438,439],{},"the Base58Check checksum does not hold, so a character is wrong"," is a typo. ",[214,442,443],{},"version byte 0x00, where this chain writes 0x1e or 0x16"," is a Bitcoin address pasted where Dogecoin was asked for. ",[214,446,447],{},"a Bech32 checksum under witness version 1, where BIP-350 wants Bech32m"," is an encoder still on the old checksum. Every rule the address breaks goes into one answer, so a string cut short on the wrong chain hears about its length, its version byte and its checksum at once. That covers Litecoin, Bitcoin Gold, Dogecoin, Pepecoin, Dash, Bitcoin SV, TRON and Decred. The other families still decode to a plain yes or no, so their errors carry no ",[214,450,427],{}," yet.",[404,453,454,455,458,459,462],{},"The library doesn't trim. ",[214,456,457],{},"assertAddress(\" bc1q…\")"," fails on the space. The CLI's ",[214,460,461],{},"validate"," passes the argument through as typed too. The agent tools do trim, because an address lifted out of a log line keeps its trailing newline and one invisible byte should not turn a good address into a bad one.",[202,464,466],{"id":465},"why-decode","Why decode",[404,468,469],{},"Character counts aren't enough. A 34-character window takes a Bitcoin legacy address and a TRON address, both 25 bytes of Base58Check under different version bytes. Solana's System Program is 32 characters and 32 bytes, a Bitcoin address is 34 characters and 25 bytes. So the base58 validators decode and look at the bytes, and the Base58Check ones hash the last four against the rest. The Bech32 validators run the polymod. And Octra is the one base58 chain where decoding would be wrong: a contract address there is cut out of a base58 string rather than encoded from a payload, so the width is the whole format.",[202,471,473],{"id":472},"what-each-family-checks","What each family checks",[475,476,477,496],"table",{},[478,479,480],"thead",{},[481,482,483,487,490,493],"tr",{},[484,485,486],"th",{},"Chain",[484,488,489],{},"Accepted forms",[484,491,492],{},"Verified",[484,494,495],{},"Left alone",[497,498,499,521,559,602,631,661,695,731,763,807,829,852,880,909,924,946,969,985,1018,1036,1054,1073],"tbody",{},[481,500,501,509,515,518],{},[502,503,504,508],"td",{},[505,506,507],"a",{"href":53},"EVM",", fourteen chains",[502,510,511,514],{},[214,512,513],{},"0x"," and 40 hex digits, mixed case under EIP-55",[502,516,517],{},"the EIP-55 checksum wherever the case carries one",[502,519,520],{},"an address in one case throughout, which has no checksum to fail",[481,522,523,527,545,556],{},[502,524,525],{},[505,526,104],{"href":105},[502,528,529,530,533,534,537,538,541,542],{},"legacy ",[214,531,532],{},"1…"," ",[214,535,536],{},"3…",", Bech32 ",[214,539,540],{},"bc1q…",", Bech32m ",[214,543,544],{},"bc1p…",[502,546,547,548,551,552,555],{},"25 Base58Check bytes under ",[214,549,550],{},"0x00"," or ",[214,553,554],{},"0x05"," with the checksum; the full BIP-173\u002F350 encoding, witness version, program length, padding, checksum",[502,557,558],{},"nothing; one character off fails on either branch",[481,560,561,565,581,596],{},[502,562,563],{},[505,564,108],{"href":109},[502,566,529,567,533,570,573,574,577,578],{},[214,568,569],{},"L…",[214,571,572],{},"M…",", ",[214,575,576],{},"ltc1…",", MWEB ",[214,579,580],{},"ltcmweb1…",[502,582,583,584,587,588,591,592,595],{},"same as Bitcoin under versions ",[214,585,586],{},"0x30"," and ",[214,589,590],{},"0x32"," and the ",[214,593,594],{},"ltc"," prefix; MWEB's Bech32 checksum past 90 characters, version digit 0, two 33-byte keys",[502,597,598,599,601],{},"the deprecated ",[214,600,536],{}," script version is out; curve points",[481,603,604,608,619,628],{},[502,605,606],{},[505,607,112],{"href":113},[502,609,610,573,613,573,616],{},[214,611,612],{},"P…",[214,614,615],{},"9…",[214,617,618],{},"A…",[502,620,547,621,551,624,627],{},[214,622,623],{},"0x38",[214,625,626],{},"0x16"," with the checksum",[502,629,630],{},"no Bech32 at all",[481,632,633,637,646,653],{},[502,634,635],{},[505,636,172],{"href":173},[502,638,639,573,642,573,644],{},[214,640,641],{},"D…",[214,643,615],{},[214,645,618],{},[502,647,547,648,551,651,627],{},[214,649,650],{},"0x1e",[214,652,626],{},[502,654,655,656,587,658,660],{},"no Bech32 at all; ",[214,657,615],{},[214,659,618],{}," pass as Pepecoin too",[481,662,663,667,685,688],{},[502,664,665],{},[505,666,176],{"href":177},[502,668,669,670,573,673,533,676,533,679,533,682],{},"CashAddr with or without ",[214,671,672],{},"bitcoincash:",[214,674,675],{},"q…",[214,677,678],{},"p…",[214,680,681],{},"z…",[214,683,684],{},"r…",[502,686,687],{},"the CashAddr checksum, types 0 to 3 with the CashTokens pair, a 20-byte hash or a 32-byte script hash, zero padding",[502,689,529,690,533,692,694],{},[214,691,532],{},[214,693,536],{},", the bytes are Bitcoin's; a bare eCash address fails on the checksum",[481,696,697,701,711,723],{},[502,698,699],{},[505,700,184],{"href":185},[502,702,529,703,533,706,573,708],{},[214,704,705],{},"G…",[214,707,618],{},[214,709,710],{},"btg1…",[502,712,583,713,587,716,591,719,722],{},[214,714,715],{},"0x26",[214,717,718],{},"0x17",[214,720,721],{},"btg"," prefix",[502,724,725,726,587,728,730],{},"Bitcoin's ",[214,727,532],{},[214,729,536],{},", the fork moved both version bytes",[481,732,733,737,745,753],{},[502,734,735],{},[505,736,188],{"href":189},[502,738,739,573,742],{},[214,740,741],{},"X…",[214,743,744],{},"7…",[502,746,547,747,551,750,627],{},[214,748,749],{},"0x4c",[214,751,752],{},"0x10",[502,754,755,756,587,759,762],{},"testnet ",[214,757,758],{},"y…",[214,760,761],{},"8…","; no Bech32 at all",[481,764,765,769,790,800],{},[502,766,767],{},[505,768,192],{"href":193},[502,770,771,772,533,775,778,779,782,783,786,787],{},"transparent ",[214,773,774],{},"t1…",[214,776,777],{},"t3…",", Sapling ",[214,780,781],{},"zs1…",", TEX ",[214,784,785],{},"tex1…",", Unified ",[214,788,789],{},"u1…",[502,791,792,793,551,796,799],{},"26 Base58Check bytes under ",[214,794,795],{},"0x1cb8",[214,797,798],{},"0x1cbd","; Bech32 over 43 bytes; Bech32m over 20 bytes; ZIP-316 Revision 0: Bech32m past 90 characters, F4Jumble undone, padding, item order, receiver lengths, at least one shielded item",[502,801,802,803,806],{},"Sprout ",[214,804,805],{},"zc…",", which nothing can pay since Canopy; testnet; the curve points in shielded receivers",[481,808,809,813,817,821],{},[502,810,811],{},[505,812,180],{"href":181},[502,814,815],{},[214,816,532],{},[502,818,547,819,627],{},[214,820,550],{},[502,822,823,825,826,828],{},[214,824,536],{},", which no transaction may pay since Genesis; no Bech32, no CashAddr; ",[214,827,532],{}," passes as Bitcoin too",[481,830,831,835,840,849],{},[502,832,833],{},[505,834,116],{"href":117},[502,836,669,837],{},[214,838,839],{},"ecash:",[502,841,842,843,551,845,848],{},"the CashAddr checksum, version ",[214,844,550],{},[214,846,847],{},"0x08",", 20-byte hash, zero padding",[502,850,851],{},"nothing; a bare Bitcoin Cash address fails on the checksum",[481,853,854,858,874,877],{},[502,855,856],{},[505,857,120],{"href":121},[502,859,860,861,573,864,867,868,533,871],{},"Shelley ",[214,862,863],{},"addr1…",[214,865,866],{},"stake1…",", Byron ",[214,869,870],{},"Ae2…",[214,872,873],{},"DdzFF…",[502,875,876],{},"Bech32 checksum past BIP-173's 90 characters, CIP-19 header, mainnet tag, payload length, pointer coordinates; Byron's CRC-32, root, attributes and type as the ledger decodes them",[502,878,879],{},"nothing; a Byron address with a network magic is a testnet address",[481,881,882,886,903,906],{},[502,883,884],{},[505,885,164],{"href":165},[502,887,888,533,891,533,894,533,897,573,900],{},[214,889,890],{},"Ds",[214,892,893],{},"De",[214,895,896],{},"DS",[214,898,899],{},"Dc",[214,901,902],{},"Dk",[502,904,905],{},"26-byte hash forms, 39-byte public key form with its selector, the BLAKE-256 checksum",[502,907,908],{},"curve points",[481,910,911,915,918,921],{},[502,912,913],{},[505,914,124],{"href":125},[502,916,917],{},"base58",[502,919,920],{},"exactly 32 decoded bytes",[502,922,923],{},"nothing else exists to check",[481,925,926,930,940,943],{},[502,927,928],{},[505,929,128],{"href":129},[502,931,932,933,533,935,533,937],{},"SEP-23 Strkey ",[214,934,705],{},[214,936,572],{},[214,938,939],{},"C…",[502,941,942],{},"canonical base32, version byte, CRC16-XModem",[502,944,945],{},"account existence",[481,947,948,952,960,966],{},[502,949,950],{},[505,951,132],{"href":133},[502,953,954,955,957,958],{},"classic ",[214,956,684],{},", X-address ",[214,959,741],{},[502,961,962,963,965],{},"the ledger's own base58 alphabet, the Base58Check checksum, version ",[214,964,550],{},", X-address prefix, flag and reserved bytes",[502,967,968],{},"nothing else",[481,970,971,977,980,983],{},[502,972,973,573,975],{},[505,974,136],{"href":137},[505,976,140],{"href":141},[502,978,979],{},"64 hex digits or the single digit AIP-40 short form",[502,981,982],{},"shape",[502,984,968],{},[481,986,987,992,995,1011],{},[502,988,989],{},[505,990,991],{"href":145},"TON",[502,993,994],{},"TEP-2 friendly, either base64 alphabet",[502,996,997,998,551,1001,1004,1005,551,1007,1010],{},"36 bytes, tag ",[214,999,1000],{},"0x11",[214,1002,1003],{},"0x51",", workchain ",[214,1006,550],{},[214,1008,1009],{},"0xff",", the CRC16-XModem",[502,1012,1013,1014,1017],{},"the raw ",[214,1015,1016],{},"workchain:hex"," form isn't accepted",[481,1019,1020,1024,1029,1034],{},[502,1021,1022],{},[505,1023,148],{"href":149},[502,1025,1026],{},[214,1027,1028],{},"T…",[502,1030,547,1031,627],{},[214,1032,1033],{},"0x41",[502,1035,968],{},[481,1037,1038,1042,1048,1051],{},[502,1039,1040],{},[505,1041,152],{"href":153},[502,1043,1044,1047],{},[214,1045,1046],{},"oct"," and 44 base58 characters",[502,1049,1050],{},"the width and the alphabet",[502,1052,1053],{},"everything else, on purpose",[481,1055,1056,1060,1063,1066],{},[502,1057,1058],{},[505,1059,156],{"href":157},[502,1061,1062],{},"43 base64url characters",[502,1064,1065],{},"zero unused bits in the last digit",[502,1067,1068,1069,1072],{},"the optional ",[214,1070,1071],{},":checksum"," suffix is rejected",[481,1074,1075,1079,1091,1094],{},[502,1076,1077],{},[505,1078,160],{"href":161},[502,1080,1081,1082,1085,1086,1088,1089],{},"standard ",[214,1083,1084],{},"4…",", subaddress ",[214,1087,761],{},", integrated ",[214,1090,1084],{},[502,1092,1093],{},"base58 block bounds, mainnet type byte, 95 or 106 characters, the Keccak-256 checksum",[502,1095,1096],{},"curve points; testnet and stagenet are rejected",[404,1098,1099],{},"Mixed case fails on every Bech32 and CashAddr chain, all upper or all lower passes, as the specs say. On an EVM chain mixed case is the checksum, so it has to match, and one case throughout is the unchecksummed form every wallet accepts. Testnet forms are rejected everywhere the format can tell: Bitcoin's version bytes, TON's testnet flag, Monero's network byte, XRP's testnet X-address prefix, the network magic a Byron address carries only on a test network.",[202,1101,1103],{"id":1102},"what-it-pays-to","What it pays to",[404,1105,1106,1107,1110],{},"The validator takes the address apart to check it. Then it says yes and throws the parts away. Bit of a waste, right? ",[214,1108,1109],{},"decodeAddress"," runs the same check and keeps them:",[207,1112,1114],{"className":209,"code":1113,"language":211,"meta":212,"style":212},"import { getChain } from \"@agntn\u002Fchains\";\n\ngetChain(\"btc\").decodeAddress(\"1Fo65aKq8s8iquMt6weF1rku1moWVEd5Ua\");\n\u002F\u002F { kind: \"p2pkh\", payload: \"a24922852051a9002ebf4c864a55acb75bb4cf75\", hash: \"hash160\" }\ngetChain(\"bch\").decodeAddress(\"bitcoincash:qz3yjg59ypg6jqpwhaxgvjj44jm4hdx0w5wsxw2qez\");\n\u002F\u002F { kind: \"p2pkh\", payload: \"a24922852051a9002ebf4c864a55acb75bb4cf75\", hash: \"hash160\" }\ngetChain(\"dcr\").decodeAddress(\"DeeUhrRoTp4DftsqddVW96yMGMW4sgQFYUE\");\n\u002F\u002F { kind: \"p2pkh\", payload: \"456d8ee57a4b9121987b4ecab8c3bcb5797e8a53\", hash: \"ripemd160-blake256\", signature: \"ed25519\" }\ngetChain(\"eth\").decodeAddress(\"0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984\");\n\u002F\u002F { kind: \"account\" }\n",[214,1115,1116,1129,1133,1154,1159,1179,1183,1203,1208,1228],{"__ignoreMap":212},[217,1117,1118,1120,1123,1125,1127],{"class":219,"line":220},[217,1119,224],{"class":223},[217,1121,1122],{"class":227}," { getChain } ",[217,1124,231],{"class":223},[217,1126,235],{"class":234},[217,1128,238],{"class":227},[217,1130,1131],{"class":219,"line":241},[217,1132,245],{"emptyLinePlaceholder":244},[217,1134,1135,1138,1140,1142,1145,1147,1149,1152],{"class":219,"line":248},[217,1136,1137],{"class":260},"getChain",[217,1139,264],{"class":227},[217,1141,267],{"class":234},[217,1143,1144],{"class":227},").",[217,1146,1109],{"class":260},[217,1148,264],{"class":227},[217,1150,1151],{"class":234},"\"1Fo65aKq8s8iquMt6weF1rku1moWVEd5Ua\"",[217,1153,270],{"class":227},[217,1155,1156],{"class":219,"line":273},[217,1157,1158],{"class":284},"\u002F\u002F { kind: \"p2pkh\", payload: \"a24922852051a9002ebf4c864a55acb75bb4cf75\", hash: \"hash160\" }\n",[217,1160,1161,1163,1165,1168,1170,1172,1174,1177],{"class":219,"line":278},[217,1162,1137],{"class":260},[217,1164,264],{"class":227},[217,1166,1167],{"class":234},"\"bch\"",[217,1169,1144],{"class":227},[217,1171,1109],{"class":260},[217,1173,264],{"class":227},[217,1175,1176],{"class":234},"\"bitcoincash:qz3yjg59ypg6jqpwhaxgvjj44jm4hdx0w5wsxw2qez\"",[217,1178,270],{"class":227},[217,1180,1181],{"class":219,"line":288},[217,1182,1158],{"class":284},[217,1184,1185,1187,1189,1192,1194,1196,1198,1201],{"class":219,"line":308},[217,1186,1137],{"class":260},[217,1188,264],{"class":227},[217,1190,1191],{"class":234},"\"dcr\"",[217,1193,1144],{"class":227},[217,1195,1109],{"class":260},[217,1197,264],{"class":227},[217,1199,1200],{"class":234},"\"DeeUhrRoTp4DftsqddVW96yMGMW4sgQFYUE\"",[217,1202,270],{"class":227},[217,1204,1205],{"class":219,"line":313},[217,1206,1207],{"class":284},"\u002F\u002F { kind: \"p2pkh\", payload: \"456d8ee57a4b9121987b4ecab8c3bcb5797e8a53\", hash: \"ripemd160-blake256\", signature: \"ed25519\" }\n",[217,1209,1210,1212,1214,1217,1219,1221,1223,1226],{"class":219,"line":322},[217,1211,1137],{"class":260},[217,1213,264],{"class":227},[217,1215,1216],{"class":234},"\"eth\"",[217,1218,1144],{"class":227},[217,1220,1109],{"class":260},[217,1222,264],{"class":227},[217,1224,1225],{"class":234},"\"0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984\"",[217,1227,270],{"class":227},[217,1229,1230],{"class":219,"line":337},[217,1231,1232],{"class":284},"\u002F\u002F { kind: \"account\" }\n",[404,1234,1235],{},"Same hash twice. That's one key, paid on two chains, and no block explorer was needed to see it.",[404,1237,1238,1239,1241,1242,1244,1245,1247,1248,1251,1252,1255],{},"A bad address throws the same ",[214,1240,412],{}," as ",[214,1243,294],{},", same ",[214,1246,427],{}," too. Nothing new to catch. ",[214,1249,1250],{},"payload"," is lowercase hex of whatever the address pays to. ",[214,1253,1254],{},"hash"," names the digest behind it. That matters on Decred, where the hash is RIPEMD-160 of BLAKE-256 and only looks like a HASH160.",[475,1257,1258,1267],{},[478,1259,1260],{},[481,1261,1262,1264],{},[484,1263,486],{},[484,1265,1266],{},"Kinds",[497,1268,1269,1312,1328,1338,1360,1384,1411,1444],{},[481,1270,1271,1279],{},[502,1272,1273,573,1275,573,1277],{},[505,1274,104],{"href":105},[505,1276,108],{"href":109},[505,1278,184],{"href":185},[502,1280,1281,573,1284,573,1287,573,1290,573,1293,573,1296,1299,1300,1303,1304,1307,1308,1311],{},[214,1282,1283],{},"p2pkh",[214,1285,1286],{},"p2sh",[214,1288,1289],{},"p2wpkh",[214,1291,1292],{},"p2wsh",[214,1294,1295],{},"p2tr",[214,1297,1298],{},"p2a"," for the anchor output, and ",[214,1301,1302],{},"witness"," with a ",[214,1305,1306],{},"version"," for a program no BIP names yet. Litecoin adds ",[214,1309,1310],{},"mweb"," with both stealth keys as the payload",[481,1313,1314,1322],{},[502,1315,1316,573,1318,573,1320],{},[505,1317,172],{"href":173},[505,1319,112],{"href":113},[505,1321,188],{"href":189},[502,1323,1324,573,1326],{},[214,1325,1283],{},[214,1327,1286],{},[481,1329,1330,1334],{},[502,1331,1332],{},[505,1333,180],{"href":181},[502,1335,1336],{},[214,1337,1283],{},[481,1339,1340,1346],{},[502,1341,1342,573,1344],{},[505,1343,176],{"href":177},[505,1345,116],{"href":117},[502,1347,1348,573,1350,1352,1353,1356,1357],{},[214,1349,1283],{},[214,1351,1286],{},", with ",[214,1354,1355],{},"tokens: true"," on the CashTokens types and a 32-byte script hash as ",[214,1358,1359],{},"hash256",[481,1361,1362,1366],{},[502,1363,1364],{},[505,1365,164],{"href":165},[502,1367,1368,587,1370,1372,1373,573,1376,1379,1380,1383],{},[214,1369,1283],{},[214,1371,1286],{}," under ",[214,1374,1375],{},"ripemd160-blake256",[214,1377,1378],{},"p2pk"," with the compressed key, and ",[214,1381,1382],{},"signature"," saying ECDSA, Ed25519 or Schnorr",[481,1385,1386,1390],{},[502,1387,1388],{},[505,1389,192],{"href":193},[502,1391,1392,587,1394,1396,1397,587,1399,573,1401,573,1404,1407,1408],{},[214,1393,1283],{},[214,1395,1286],{}," for ",[214,1398,774],{},[214,1400,777],{},[214,1402,1403],{},"tex",[214,1405,1406],{},"sapling"," with the 43-byte receiver, ",[214,1409,1410],{},"unified",[481,1412,1413,1417],{},[502,1414,1415],{},[505,1416,120],{"href":121},[502,1418,1419,573,1422,573,1425,1428,1429,1432,1433,1436,1437,1440,1441],{},[214,1420,1421],{},"base",[214,1423,1424],{},"pointer",[214,1426,1427],{},"enterprise"," with the payment credential, ",[214,1430,1431],{},"reward"," with the stake one, all ",[214,1434,1435],{},"blake2b-224",", and ",[214,1438,1439],{},"credential"," saying key or script. ",[214,1442,1443],{},"byron",[481,1445,1446,1449],{},[502,1447,1448],{},"every other chain",[502,1450,1451],{},[214,1452,1453],{},"account",[404,1455,1456,1457,1460,1461,1463,1464,1467,1468,1471],{},"A Unified Address and a Byron address get no payload. A Unified Address bundles several receivers, and picking one would be a guess. A Byron root hashes the spending data together with its attributes, so it isn't a key or script hash at all. A base address carries a stake credential too, but the coins sit behind the payment one, so that's the one you get. A custom chain on ",[214,1458,1459],{},"UTXO"," won't guess either. Until you override ",[214,1462,1109],{},", it throws ",[214,1465,1466],{},"AddressDecodingUnsupportedError",". The agent tools and ",[214,1469,1470],{},"chains validate"," print the kind and payload after a valid address.",[202,1473,1475],{"id":1474},"move-addresses-and-evm-addresses","Move addresses and EVM addresses",[404,1477,1478,1479,1482,1483,1486],{},"Aptos and Sui want all 32 bytes of hex written out, or the single digit short form AIP-40 defines for the special addresses, which is how the framework address ",[214,1480,1481],{},"0x1"," is actually written. Anything in between stays rejected. Accepting dropped leading zeros would make every EVM address a valid Move address too, and ",[505,1484,1485],{"href":21},"identify"," would report a family nobody asked about.",[202,1488,1490],{"id":1489},"transaction-ids","Transaction ids",[207,1492,1494],{"className":209,"code":1493,"language":211,"meta":212,"style":212},"import { getChain } from \"@agntn\u002Fchains\";\n\ngetChain(\"btc\").assertTxid(\"4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b\"); \u002F\u002F the genesis coinbase, returned\ngetChain(\"sol\").assertTxid(\"4AwYqQ8RbD6yhTbE9h38YiYufC7UHJfxzhP3BZsEoJRp4cY6TzphNFEsUWMjkrKNjE5dFMbBoxVwvr9m8vJukavE\"); \u002F\u002F a signature, 64 bytes of base58\ngetChain(\"xlm\").validatesTxid; \u002F\u002F true, on every chain that ships\n",[214,1495,1496,1508,1512,1535,1558],{"__ignoreMap":212},[217,1497,1498,1500,1502,1504,1506],{"class":219,"line":220},[217,1499,224],{"class":223},[217,1501,1122],{"class":227},[217,1503,231],{"class":223},[217,1505,235],{"class":234},[217,1507,238],{"class":227},[217,1509,1510],{"class":219,"line":241},[217,1511,245],{"emptyLinePlaceholder":244},[217,1513,1514,1516,1518,1520,1522,1525,1527,1530,1532],{"class":219,"line":248},[217,1515,1137],{"class":260},[217,1517,264],{"class":227},[217,1519,267],{"class":234},[217,1521,1144],{"class":227},[217,1523,1524],{"class":260},"assertTxid",[217,1526,264],{"class":227},[217,1528,1529],{"class":234},"\"4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b\"",[217,1531,302],{"class":227},[217,1533,1534],{"class":284},"\u002F\u002F the genesis coinbase, returned\n",[217,1536,1537,1539,1541,1544,1546,1548,1550,1553,1555],{"class":219,"line":273},[217,1538,1137],{"class":260},[217,1540,264],{"class":227},[217,1542,1543],{"class":234},"\"sol\"",[217,1545,1144],{"class":227},[217,1547,1524],{"class":260},[217,1549,264],{"class":227},[217,1551,1552],{"class":234},"\"4AwYqQ8RbD6yhTbE9h38YiYufC7UHJfxzhP3BZsEoJRp4cY6TzphNFEsUWMjkrKNjE5dFMbBoxVwvr9m8vJukavE\"",[217,1554,302],{"class":227},[217,1556,1557],{"class":284},"\u002F\u002F a signature, 64 bytes of base58\n",[217,1559,1560,1562,1564,1567,1570],{"class":219,"line":278},[217,1561,1137],{"class":260},[217,1563,264],{"class":227},[217,1565,1566],{"class":234},"\"xlm\"",[217,1568,1569],{"class":227},").validatesTxid; ",[217,1571,1572],{"class":284},"\u002F\u002F true, on every chain that ships\n",[404,1574,1575,1577,1578,1581,1582,573,1585,587,1588,1590,1591,1593,1594,1597,1598,1601],{},[214,1576,1524],{}," is the same contract for a transaction id: the string back when it fits, ",[214,1579,1580],{},"InvalidTxidError"," with ",[214,1583,1584],{},".chain",[214,1586,1587],{},".txid",[214,1589,427],{}," when it doesn't. Every built-in chain fills in the reason. A Bitcoin txid pasted with ",[214,1592,513],{}," comes back with ",[214,1595,1596],{},"0x in front, which this chain's txids never carry",", an uppercase Stellar hash with ",[214,1599,1600],{},"uppercase hex digits, and this chain reads lowercase only",". It's a shape check and nothing else, there's no transaction to hash. Each rule is what the chain's own node writes and reads, so the case rules differ where the readers do.",[475,1603,1604,1613],{},[478,1605,1606],{},[481,1607,1608,1610],{},[484,1609,486],{},[484,1611,1612],{},"A txid is",[497,1614,1615,1630,1641,1650,1659,1672,1685,1696,1712,1728,1741,1754],{},[481,1616,1617,1621],{},[502,1618,1619,508],{},[505,1620,507],{"href":53},[502,1622,1623,1625,1626,1629],{},[214,1624,513],{}," and 64 hex digits, either case. ",[214,1627,1628],{},"0X"," is out, same as for an address",[481,1631,1632,1638],{},[502,1633,1634,1635,1637],{},"UTXO: ",[505,1636,104],{"href":105},", Litecoin, Pepecoin, Dogecoin, Bitcoin Cash, Bitcoin SV, Bitcoin Gold, Dash, Zcash, eCash, Cardano, Decred",[502,1639,1640],{},"64 hex digits, either case, no prefix. Double SHA-256 on the Bitcoin forks, BLAKE on Cardano and Decred, BLAKE2b on Zcash since v5 transactions, same width either way",[481,1642,1643,1647],{},[502,1644,1645],{},[505,1646,160],{"href":161},[502,1648,1649],{},"64 hex digits, a Keccak-256",[481,1651,1652,1656],{},[502,1653,1654],{},[505,1655,156],{"href":157},[502,1657,1658],{},"43 base64url characters with the last digit's two spare bits zero, the address rule. A transaction id there is the SHA-256 of the signature",[481,1660,1661,1665],{},[502,1662,1663],{},[505,1664,124],{"href":125},[502,1666,1667,1668,1671],{},"The first signature of the transaction, 64 Ed25519 bytes in base58, so up to 88 characters that decode to exactly 64 bytes, the way ",[214,1669,1670],{},"Signature::from_str"," reads them",[481,1673,1674,1678],{},[502,1675,1676],{},[505,1677,140],{"href":141},[502,1679,1680,1681,1684],{},"A 32-byte digest in base58, decoded and counted the way ",[214,1682,1683],{},"TransactionDigest::from_str"," does. Base58, not hex, so the two Move chains don't share a rule",[481,1686,1687,1691],{},[502,1688,1689],{},[505,1690,136],{"href":137},[502,1692,1693,1695],{},[214,1694,513],{}," and 64 hex digits, either case, as the node writes them. The node also reads bare hex, but nothing writes it, so it stays out like it does for an address",[481,1697,1698,1702],{},[502,1699,1700],{},[505,1701,991],{"href":145},[502,1703,1704,1705,1708,1709,1711],{},"The 32-byte hash in either of the two spellings TON's own tools write: 64 hex digits, either case, as ",[214,1706,1707],{},"hash().toString(\"hex\")"," and tonapi print it, or 44 characters of base64 with the ",[214,1710,257],{},", in toncenter's alphabet or the URL-safe one tonscan links with, never a mix of the two. Unpadded base64 is read by toncenter and written by nobody, so it's out",[481,1713,1714,1718],{},[502,1715,1716],{},[505,1717,148],{"href":149},[502,1719,1720,1721,1724,1725,1727],{},"64 hex digits, either case, the SHA-256 of ",[214,1722,1723],{},"raw_data",". No ",[214,1726,513],{},": the node strips one on the way in, but nothing on TRON writes one",[481,1729,1730,1734],{},[502,1731,1732],{},[505,1733,128],{"href":129},[502,1735,1736,1737,1740],{},"64 hex digits, lowercase only. Horizon's ",[214,1738,1739],{},"isTransactionHash"," refuses uppercase, so a hash that passes here passes there",[481,1742,1743,1747],{},[502,1744,1745],{},[505,1746,132],{"href":133},[502,1748,1749,1750,1753],{},"64 hex digits, uppercase as rippled writes them, either case as its ",[214,1751,1752],{},"parseHex"," reads them. A CTID (XLS-37) is a different parameter, not a hash",[481,1755,1756,1760],{},[502,1757,1758],{},[505,1759,152],{"href":153},[502,1761,1762,1763,1766],{},"64 hex digits, lowercase only, which is the node's whole ",[214,1764,1765],{},"sanitize_hash"," check",[404,1768,1769,1770,1772,1773,1436,1776,1779,1780,1783,1784,587,1787,1790],{},"A custom chain that never overrides ",[214,1771,1524],{}," throws ",[214,1774,1775],{},"TxidValidationUnsupportedError",[214,1777,1778],{},"validatesTxid"," says ",[214,1781,1782],{},"false"," there before you ask. ",[214,1785,1786],{},"chains_validate_txid",[214,1788,1789],{},"chains validate --txid"," are the same check for a model and for the terminal.",[202,1792,1794],{"id":1793},"where-this-stops","Where this stops",[404,1796,1797,1798,1806,1807,1810],{},"None of this touches a network. Not existence, not balances, not whether a contract sits at the address. That belongs in ",[505,1799,1803],{"href":1800,"rel":1801},"https:\u002F\u002Fgithub.com\u002Fagntn\u002Fnodes",[1802],"nofollow",[214,1804,1805],{},"@agntn\u002Fnodes",", and the ",[505,1808,40],{"href":1809},"\u002Fplayground"," says the same thing under every green result.",[1812,1813,1814],"style",{},"html pre.shiki code .skH_V, html code.shiki .skH_V{--shiki-light:var(--shiki-token-keyword);--shiki-default:var(--shiki-token-keyword);--shiki-dark:var(--shiki-token-keyword)}html pre.shiki code .s38Sx, html code.shiki .s38Sx{--shiki-light:var(--ui-text-highlighted);--shiki-default:var(--ui-text-highlighted);--shiki-dark:var(--ui-text-highlighted)}html pre.shiki code .shU9J, html code.shiki .shU9J{--shiki-light:var(--shiki-token-string);--shiki-default:var(--shiki-token-string);--shiki-dark:var(--shiki-token-string)}html pre.shiki code .sK71F, html code.shiki .sK71F{--shiki-light:var(--shiki-token-function);--shiki-default:var(--shiki-token-function);--shiki-dark:var(--shiki-token-function)}html pre.shiki code .scIB-, html code.shiki .scIB-{--shiki-light:var(--shiki-token-comment);--shiki-default:var(--shiki-token-comment);--shiki-dark:var(--shiki-token-comment)}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);}",{"title":212,"searchDepth":241,"depth":241,"links":1816},[1817,1818,1819,1820,1821,1822,1823],{"id":204,"depth":241,"text":205},{"id":465,"depth":241,"text":466},{"id":472,"depth":241,"text":473},{"id":1102,"depth":241,"text":1103},{"id":1474,"depth":241,"text":1475},{"id":1489,"depth":241,"text":1490},{"id":1793,"depth":241,"text":1794},"assertAddress on every chain, and decodeAddress for what an address pays to. What each family decodes and which checksums are verified and which are left alone. A format check and nothing more.","md",null,{"icon":1828},"i-lucide-badge-check",{"title":16,"description":1824},"n-XsTyaJzek83ECM-T2w7s0fXV2OYCnj4FFMFokgAR0",[1832,1834],{"title":12,"path":13,"stem":14,"description":1833,"children":-1},"Keys and display names plus the aliases people actually type. All land on the same class. How the registry is seeded and why nothing registers itself.",{"title":20,"path":21,"stem":22,"description":1835,"children":-1},"One address of unknown origin through every registered validator. Which chains accept the format and which couldn't be asked. What a match doesn't mean.",1791206746024]