[{"data":1,"prerenderedAt":706},["ShallowReactive",2],{"navigation_docs":3,"-blockchains-bitcoinsv":108,"-blockchains-bitcoinsv-surround":701},[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":107},"Blockchains","\u002Fblockchains","2.blockchains\u002F0.index",[37,39,43,47,51,55,59,63,67,71,75,79,83,87,91,95,99,103],{"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},"Bitcoin Cash","\u002Fblockchains\u002Fbitcoincash","2.blockchains\u002Fbitcoincash",{"title":56,"path":57,"stem":58},"Bitcoin Gold","\u002Fblockchains\u002Fbitcoingold","2.blockchains\u002Fbitcoingold",{"title":60,"path":61,"stem":62},"Bitcoin SV","\u002Fblockchains\u002Fbitcoinsv","2.blockchains\u002Fbitcoinsv",{"title":64,"path":65,"stem":66},"Cardano","\u002Fblockchains\u002Fcardano","2.blockchains\u002Fcardano",{"title":68,"path":69,"stem":70},"Dash","\u002Fblockchains\u002Fdash","2.blockchains\u002Fdash",{"title":72,"path":73,"stem":74},"Decred","\u002Fblockchains\u002Fdecred","2.blockchains\u002Fdecred",{"title":76,"path":77,"stem":78},"Dogecoin","\u002Fblockchains\u002Fdogecoin","2.blockchains\u002Fdogecoin",{"title":80,"path":81,"stem":82},"Ethereum","\u002Fblockchains\u002Fethereum","2.blockchains\u002Fethereum",{"title":84,"path":85,"stem":86},"Litecoin","\u002Fblockchains\u002Flitecoin","2.blockchains\u002Flitecoin",{"title":88,"path":89,"stem":90},"Solana","\u002Fblockchains\u002Fsolana","2.blockchains\u002Fsolana",{"title":92,"path":93,"stem":94},"Stellar","\u002Fblockchains\u002Fstellar","2.blockchains\u002Fstellar",{"title":96,"path":97,"stem":98},"Sui","\u002Fblockchains\u002Fsui","2.blockchains\u002Fsui",{"title":100,"path":101,"stem":102},"TRON","\u002Fblockchains\u002Ftron","2.blockchains\u002Ftron",{"title":104,"path":105,"stem":106},"Zcash","\u002Fblockchains\u002Fzcash","2.blockchains\u002Fzcash","i-lucide-boxes",{"id":109,"title":60,"body":110,"description":694,"extension":695,"links":696,"meta":697,"navigation":184,"path":61,"seo":699,"stem":62,"__hash__":700},"docs\u002F2.blockchains\u002Fbitcoinsv.md",{"type":111,"value":112,"toc":686},"minimark",[113,120,125,262,266,270,277,333,424,430,455,459,531,534,545,549,556,623,630,641,645,664,668,682],[114,115],"chain-facts",{"coin":116,"curve":117,"driver":118,"formats":119},"236","secp256k1","bitcoinsv","legacy P2PKH",[121,122,124],"h2",{"id":123},"load-it","Load it",[126,127,132],"pre",{"className":128,"code":129,"language":130,"meta":131,"style":131},"language-js shiki shiki-themes github-light github-light poimandres","import { useBlockchain, blockchains } from \"@agntn\u002Fkeys\";\n\nconst bsvChain = useBlockchain(await blockchains.bitcoinsv()());\nconst testnet = useBlockchain(await blockchains.bitcoinsv({ network: \"testnet\" })());\n","js","",[133,134,135,179,186,221],"code",{"__ignoreMap":131},[136,137,140,144,148,152,155,158,161,165,169,173,176],"span",{"class":138,"line":139},"line",1,[136,141,143],{"class":142},"sP0CR","import",[136,145,147],{"class":146},"sKlNE"," {",[136,149,151],{"class":150},"snHMy"," useBlockchain",[136,153,154],{"class":146},",",[136,156,157],{"class":150}," blockchains",[136,159,160],{"class":146}," }",[136,162,164],{"class":163},"stCPd"," from",[136,166,168],{"class":167},"scVjq"," \"",[136,170,172],{"class":171},"sQ7BG","@agntn\u002Fkeys",[136,174,175],{"class":167},"\"",[136,177,178],{"class":146},";\n",[136,180,182],{"class":138,"line":181},2,[136,183,185],{"emptyLinePlaceholder":184},true,"\n",[136,187,189,193,197,200,203,206,210,213,216,218],{"class":138,"line":188},3,[136,190,192],{"class":191},"s1TYA","const",[136,194,196],{"class":195},"saoiD"," bsvChain",[136,198,199],{"class":191}," =",[136,201,151],{"class":202},"sULi6",[136,204,205],{"class":146},"(",[136,207,209],{"class":208},"sZW6a","await",[136,211,157],{"class":212},"spVlQ",[136,214,215],{"class":146},".",[136,217,118],{"class":202},[136,219,220],{"class":146},"()());\n",[136,222,224,226,229,231,233,235,237,239,241,243,246,249,252,254,257,259],{"class":138,"line":223},4,[136,225,192],{"class":191},[136,227,228],{"class":195}," testnet",[136,230,199],{"class":191},[136,232,151],{"class":202},[136,234,205],{"class":146},[136,236,209],{"class":208},[136,238,157],{"class":212},[136,240,215],{"class":146},[136,242,118],{"class":202},[136,244,245],{"class":146},"({",[136,247,248],{"class":150}," network",[136,250,251],{"class":146},":",[136,253,168],{"class":167},[136,255,256],{"class":171},"testnet",[136,258,175],{"class":167},[136,260,261],{"class":146}," })());\n",[263,264,265],"p",{},"Mainnet and testnet only, anything else throws in the constructor. Testnet, STN and regtest share the same version bytes in the node, so one testnet driver covers them.",[121,267,269],{"id":268},"the-address","The address",[263,271,272,273,276],{},"Nothing new here, and that's the point. Bitcoin SV kept Bitcoin's P2PKH recipe as is: ",[133,274,275],{},"RIPEMD160(SHA256(pubkey))",", a version byte in front, base58check.",[278,279,280,296],"table",{},[281,282,283],"thead",{},[284,285,286,290,293],"tr",{},[287,288,289],"th",{},"Network",[287,291,292],{},"Version",[287,294,295],{},"Starts with",[297,298,299,315],"tbody",{},[284,300,301,305,310],{},[302,303,304],"td",{},"mainnet",[302,306,307],{},[133,308,309],{},"0x00",[302,311,312],{},[133,313,314],{},"1",[284,316,317,319,324],{},[302,318,256],{},[302,320,321],{},[133,322,323],{},"0x6f",[302,325,326,329,330],{},[133,327,328],{},"m"," or ",[133,331,332],{},"n",[126,334,336],{"className":128,"code":335,"language":130,"meta":131,"style":131},"const privateKey = \"0000000000000000000000000000000000000000000000000000000000000001\";\nconst publicKey = bsvChain.getKeyPublic(privateKey);\n\nbsvChain.getAddress(publicKey); \u002F\u002F 1BgGZ9tcN4rm9KBzDn7KprQz87SZ26SAMH\ntestnet.getAddress(publicKey); \u002F\u002F mrCDrCybB6J1vRfbwM5hemdJz73FwDBC8r\n",[133,337,338,356,380,384,406],{"__ignoreMap":131},[136,339,340,342,345,347,349,352,354],{"class":138,"line":139},[136,341,192],{"class":191},[136,343,344],{"class":195}," privateKey",[136,346,199],{"class":191},[136,348,168],{"class":167},[136,350,351],{"class":171},"0000000000000000000000000000000000000000000000000000000000000001",[136,353,175],{"class":167},[136,355,178],{"class":146},[136,357,358,360,363,365,367,369,372,374,377],{"class":138,"line":181},[136,359,192],{"class":191},[136,361,362],{"class":195}," publicKey",[136,364,199],{"class":191},[136,366,196],{"class":212},[136,368,215],{"class":146},[136,370,371],{"class":202},"getKeyPublic",[136,373,205],{"class":146},[136,375,376],{"class":212},"privateKey",[136,378,379],{"class":146},");\n",[136,381,382],{"class":138,"line":188},[136,383,185],{"emptyLinePlaceholder":184},[136,385,386,389,391,394,396,399,402],{"class":138,"line":223},[136,387,388],{"class":212},"bsvChain",[136,390,215],{"class":146},[136,392,393],{"class":202},"getAddress",[136,395,205],{"class":146},[136,397,398],{"class":212},"publicKey",[136,400,401],{"class":146},"); ",[136,403,405],{"class":404},"sjhu3","\u002F\u002F 1BgGZ9tcN4rm9KBzDn7KprQz87SZ26SAMH\n",[136,407,409,411,413,415,417,419,421],{"class":138,"line":408},5,[136,410,256],{"class":212},[136,412,215],{"class":146},[136,414,393],{"class":202},[136,416,205],{"class":146},[136,418,398],{"class":212},[136,420,401],{"class":146},[136,422,423],{"class":404},"\u002F\u002F mrCDrCybB6J1vRfbwM5hemdJz73FwDBC8r\n",[263,425,426,427,429],{},"Same key, same string as Bitcoin's legacy address. So a ",[133,428,314],{}," address alone doesn't tell you which chain it lives on. Only a balance lookup does.",[263,431,432,435,436,439,440,443,444,446,447,450,451,454],{},[133,433,434],{},"legacy"," is the only type. Ask for ",[133,437,438],{},"\"p2sh\"",", ",[133,441,442],{},"\"segwit\""," or anything else and ",[133,445,393],{}," throws a ",[133,448,449],{},"RangeError",". There's no segwit on this chain, and Bitcoin's ",[133,452,453],{},"p2sh"," type wraps a segwit program anyway.",[121,456,458],{"id":457},"validation","Validation",[126,460,462],{"className":128,"code":461,"language":130,"meta":131,"style":131},"bsvChain.validateAddress(\"1BgGZ9tcN4rm9KBzDn7KprQz87SZ26SAMH\"); \u002F\u002F true\nbsvChain.validateAddress(\"3J98t1WpEZ73CNmQviecrnyiWrnqRhWNLy\"); \u002F\u002F false, P2SH\nbsvChain.validateAddress(\"bitcoincash:qp63uahgrxged4z5jswyt5dn5v3lzsem6cy4spdc2h\"); \u002F\u002F false\n",[133,463,464,487,509],{"__ignoreMap":131},[136,465,466,468,470,473,475,477,480,482,484],{"class":138,"line":139},[136,467,388],{"class":212},[136,469,215],{"class":146},[136,471,472],{"class":202},"validateAddress",[136,474,205],{"class":146},[136,476,175],{"class":167},[136,478,479],{"class":171},"1BgGZ9tcN4rm9KBzDn7KprQz87SZ26SAMH",[136,481,175],{"class":167},[136,483,401],{"class":146},[136,485,486],{"class":404},"\u002F\u002F true\n",[136,488,489,491,493,495,497,499,502,504,506],{"class":138,"line":181},[136,490,388],{"class":212},[136,492,215],{"class":146},[136,494,472],{"class":202},[136,496,205],{"class":146},[136,498,175],{"class":167},[136,500,501],{"class":171},"3J98t1WpEZ73CNmQviecrnyiWrnqRhWNLy",[136,503,175],{"class":167},[136,505,401],{"class":146},[136,507,508],{"class":404},"\u002F\u002F false, P2SH\n",[136,510,511,513,515,517,519,521,524,526,528],{"class":138,"line":188},[136,512,388],{"class":212},[136,514,215],{"class":146},[136,516,472],{"class":202},[136,518,205],{"class":146},[136,520,175],{"class":167},[136,522,523],{"class":171},"bitcoincash:qp63uahgrxged4z5jswyt5dn5v3lzsem6cy4spdc2h",[136,525,175],{"class":167},[136,527,401],{"class":146},[136,529,530],{"class":404},"\u002F\u002F false\n",[263,532,533],{},"Base58check under the driver's own version byte, and nothing else. A testnet address fails on mainnet and the other way round.",[263,535,536,537,540,541,544],{},"The ",[133,538,539],{},"3"," refusal is deliberate. The node still decodes a P2SH address, but since Genesis it rejects any transaction paying to one with ",[133,542,543],{},"bad-txns-vout-p2sh",". An address you can't send to isn't one worth calling valid. Bech32 and CashAddr fail too, the chain never had them.",[121,546,548],{"id":547},"mnemonics","Mnemonics",[263,550,551,552,555],{},"BIP32 on ",[133,553,554],{},"m\u002F44'\u002F236'\u002Faccount'\u002Fchange\u002Findex",", coin type 236 from SLIP-0044. That's what Yours Wallet and the BSV Blockchain py-sdk derive.",[126,557,559],{"className":128,"code":558,"language":130,"meta":131,"style":131},"const mnemonic =\n  \"chief december immune nominee forest scheme slight tornado cupboard post summer program\";\n\nbsvChain.deriveHDWallet(mnemonic, \"m\u002F44'\u002F236'\u002F0'\u002F0\u002F0\").address;\n\u002F\u002F 127kSo2jNBnSoZeQniZ86WpUQjPvMhSVdA, the key py-sdk's own tests expect\n",[133,560,561,571,583,587,618],{"__ignoreMap":131},[136,562,563,565,568],{"class":138,"line":139},[136,564,192],{"class":191},[136,566,567],{"class":195}," mnemonic",[136,569,570],{"class":191}," =\n",[136,572,573,576,579,581],{"class":138,"line":181},[136,574,575],{"class":167},"  \"",[136,577,578],{"class":171},"chief december immune nominee forest scheme slight tornado cupboard post summer program",[136,580,175],{"class":167},[136,582,178],{"class":146},[136,584,585],{"class":138,"line":188},[136,586,185],{"emptyLinePlaceholder":184},[136,588,589,591,593,596,598,601,603,605,608,610,613,616],{"class":138,"line":223},[136,590,388],{"class":212},[136,592,215],{"class":146},[136,594,595],{"class":202},"deriveHDWallet",[136,597,205],{"class":146},[136,599,600],{"class":212},"mnemonic",[136,602,439],{"class":146},[136,604,175],{"class":167},[136,606,607],{"class":171},"m\u002F44'\u002F236'\u002F0'\u002F0\u002F0",[136,609,175],{"class":167},[136,611,612],{"class":146},").",[136,614,615],{"class":212},"address",[136,617,178],{"class":146},[136,619,620],{"class":138,"line":408},[136,621,622],{"class":404},"\u002F\u002F 127kSo2jNBnSoZeQniZ86WpUQjPvMhSVdA, the key py-sdk's own tests expect\n",[263,624,625,626,629],{},"ElectrumSV is the odd one out. It kept Bitcoin's coin type 0, so a seed from it wants ",[133,627,628],{},"m\u002F44'\u002F0'\u002F0'\u002F0\u002F0",". Pass that path yourself and you get the same address Bitcoin gives. The purpose level doesn't pick a format either way, there's only one.",[263,631,632,633,636,637,640],{},"WIF is Bitcoin's too, prefix ",[133,634,635],{},"0x80",". ",[133,638,639],{},"encodeWIF(privateKey, { chain: \"bitcoin\" })"," gives the string a Bitcoin SV wallet imports.",[121,642,644],{"id":643},"signing","Signing",[263,646,647,648,651,652,655,656,659,660,663],{},"The node kept ",[133,649,650],{},"\"\\x18Bitcoin Signed Message:\\n\"",", so the digest is Bitcoin's: compact size lengths, double SHA-256, secp256k1. A Bitcoin SV signature is the same 64 bytes of ",[133,653,654],{},"r||s"," hex that Bitcoin gives for that key and message. The ",[133,657,658],{},"BSM"," vectors in the BSV Blockchain ts-sdk match byte for byte once you drop their header byte. Like Bitcoin, ",[133,661,662],{},"{ recovered: true }"," throws, because the recoverable form is base64 with that header byte in front.",[121,665,667],{"id":666},"where-it-lives","Where it lives",[263,669,670,673,674,677,678,681],{},[133,671,672],{},"src\u002Fblockchains\u002Fbitcoinsv.ts"," has the version bytes and the address rules. It extends ",[133,675,676],{},"AbstractBitcoinMessageBlockchain"," in ",[133,679,680],{},"src\u002Futils\u002Fbitcoin.ts",", the part of the Bitcoin base with keys and signed messages and none of the address formats.",[683,684,685],"style",{},"html pre.shiki code .sP0CR, html code.shiki .sP0CR{--shiki-light:#D73A49;--shiki-default:#D73A49;--shiki-dark:#5DE4C7}html pre.shiki code .sKlNE, html code.shiki .sKlNE{--shiki-light:#24292E;--shiki-default:#24292E;--shiki-dark:#A6ACCD}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 .s1TYA, html code.shiki .s1TYA{--shiki-light:#D73A49;--shiki-default:#D73A49;--shiki-dark:#91B4D5}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 .sZW6a, html code.shiki .sZW6a{--shiki-light:#D73A49;--shiki-default:#D73A49;--shiki-dark:#5DE4C7C0}html pre.shiki code .spVlQ, html code.shiki .spVlQ{--shiki-light:#24292E;--shiki-default:#24292E;--shiki-dark:#E4F0FB}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 .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}",{"title":131,"searchDepth":181,"depth":181,"links":687},[688,689,690,691,692,693],{"id":123,"depth":181,"text":124},{"id":268,"depth":181,"text":269},{"id":457,"depth":181,"text":458},{"id":547,"depth":181,"text":548},{"id":643,"depth":181,"text":644},{"id":666,"depth":181,"text":667},"Bitcoin's key, Bitcoin's hash, Bitcoin's base58. One address type, Bitcoin's message preamble, and no P2SH since Genesis.","md",null,{"icon":698},"i-token-bsv",{"title":60,"description":694},"MDhANmRuoFpzDLQM5-nQWlHNeybTSaE2mW2Tg8j5h9U",[702,704],{"title":56,"path":57,"stem":58,"description":703,"children":-1},"Bitcoin's driver with Bitcoin Gold's prefixes and preamble. Four address formats on mainnet and testnet and no taproot at all.",{"title":64,"path":65,"stem":66,"description":705,"children":-1},"ed25519 with base and enterprise and stake addresses in bech32. Mnemonic derivation is refused on purpose.",1790282411352]