[{"data":1,"prerenderedAt":599},["ShallowReactive",2],{"navigation_docs":3,"-blockchains-stellar":84,"-blockchains-stellar-surround":594},[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":72,"body":86,"description":587,"extension":588,"links":589,"meta":590,"navigation":160,"path":73,"seo":592,"stem":74,"__hash__":593},"docs\u002F2.blockchains\u002Fstellar.md",{"type":87,"value":88,"toc":580},"minimark",[89,96,101,197,205,209,220,273,280,284,334,348,352,359,400,411,415,433,566,576],[90,91],"chain-facts",{"coin":92,"curve":93,"driver":94,"formats":95},"148","ed25519","stellar","StrKey",[97,98,100],"h2",{"id":99},"load-it","Load it",[102,103,108],"pre",{"className":104,"code":105,"language":106,"meta":107,"style":107},"language-js shiki shiki-themes github-light github-light poimandres","import { useBlockchain, blockchains } from \"@agntn\u002Fkeys\";\n\nconst stellarChain = useBlockchain(await blockchains.stellar()());\n","js","",[109,110,111,155,162],"code",{"__ignoreMap":107},[112,113,116,120,124,128,131,134,137,141,145,149,152],"span",{"class":114,"line":115},"line",1,[112,117,119],{"class":118},"sP0CR","import",[112,121,123],{"class":122},"sKlNE"," {",[112,125,127],{"class":126},"snHMy"," useBlockchain",[112,129,130],{"class":122},",",[112,132,133],{"class":126}," blockchains",[112,135,136],{"class":122}," }",[112,138,140],{"class":139},"stCPd"," from",[112,142,144],{"class":143},"scVjq"," \"",[112,146,148],{"class":147},"sQ7BG","@agntn\u002Fkeys",[112,150,151],{"class":143},"\"",[112,153,154],{"class":122},";\n",[112,156,158],{"class":114,"line":157},2,[112,159,161],{"emptyLinePlaceholder":160},true,"\n",[112,163,165,169,173,176,179,182,186,189,192,194],{"class":114,"line":164},3,[112,166,168],{"class":167},"s1TYA","const",[112,170,172],{"class":171},"saoiD"," stellarChain",[112,174,175],{"class":167}," =",[112,177,127],{"class":178},"sULi6",[112,180,181],{"class":122},"(",[112,183,185],{"class":184},"sZW6a","await",[112,187,133],{"class":188},"spVlQ",[112,190,191],{"class":122},".",[112,193,94],{"class":178},[112,195,196],{"class":122},"()());\n",[198,199,200,201,204],"p",{},"Pubnet and testnet share the address format, so ",[109,202,203],{},"{ network: \"testnet\" }"," is accepted and changes nothing.",[97,206,208],{"id":207},"the-address","The address",[198,210,211,212,215,216,219],{},"The public key with a version byte in front and a CRC16-XModem checksum behind, base32 without padding. Version ",[109,213,214],{},"0x30"," is what puts the ",[109,217,218],{},"G"," at the start.",[102,221,223],{"className":104,"code":222,"language":106,"meta":107,"style":107},"const publicKey = stellarChain.getKeyPublic(privateKey); \u002F\u002F 32 bytes, 64 hex chars\nstellarChain.getAddress(publicKey); \u002F\u002F GBGLLK7WVV47X5NLXTFPZQTJ3BONEZI62S4ILNMGT4SBV3PQUW5CTECA\n",[109,224,225,253],{"__ignoreMap":107},[112,226,227,229,232,234,236,238,241,243,246,249],{"class":114,"line":115},[112,228,168],{"class":167},[112,230,231],{"class":171}," publicKey",[112,233,175],{"class":167},[112,235,172],{"class":188},[112,237,191],{"class":122},[112,239,240],{"class":178},"getKeyPublic",[112,242,181],{"class":122},[112,244,245],{"class":188},"privateKey",[112,247,248],{"class":122},"); ",[112,250,252],{"class":251},"sjhu3","\u002F\u002F 32 bytes, 64 hex chars\n",[112,254,255,258,260,263,265,268,270],{"class":114,"line":157},[112,256,257],{"class":188},"stellarChain",[112,259,191],{"class":122},[112,261,262],{"class":178},"getAddress",[112,264,181],{"class":122},[112,266,267],{"class":188},"publicKey",[112,269,248],{"class":122},[112,271,272],{"class":251},"\u002F\u002F GBGLLK7WVV47X5NLXTFPZQTJ3BONEZI62S4ILNMGT4SBV3PQUW5CTECA\n",[198,274,275,276,279],{},"The secret seed StrKey that starts with ",[109,277,278],{},"S"," is the same encoding over the private key. This package doesn't produce it, the private key stays hex like on every other chain.",[97,281,283],{"id":282},"validation","Validation",[102,285,287],{"className":104,"code":286,"language":106,"meta":107,"style":107},"stellarChain.validateAddress(\"GDRXE2BQUC3AZNPVFSCEZ76NJ3WWL25FYFK6RGZGIEKWE4SOOHSUJUJ6\"); \u002F\u002F true\nstellarChain.validateAddress(\"SBGWSG6BTNCKCOB3DIFBGCVMUPQFYPA2G4O34RMTB343OYPXU5DJDVMN\"); \u002F\u002F false, secret seed\n",[109,288,289,312],{"__ignoreMap":107},[112,290,291,293,295,298,300,302,305,307,309],{"class":114,"line":115},[112,292,257],{"class":188},[112,294,191],{"class":122},[112,296,297],{"class":178},"validateAddress",[112,299,181],{"class":122},[112,301,151],{"class":143},[112,303,304],{"class":147},"GDRXE2BQUC3AZNPVFSCEZ76NJ3WWL25FYFK6RGZGIEKWE4SOOHSUJUJ6",[112,306,151],{"class":143},[112,308,248],{"class":122},[112,310,311],{"class":251},"\u002F\u002F true\n",[112,313,314,316,318,320,322,324,327,329,331],{"class":114,"line":157},[112,315,257],{"class":188},[112,317,191],{"class":122},[112,319,297],{"class":178},[112,321,181],{"class":122},[112,323,151],{"class":143},[112,325,326],{"class":147},"SBGWSG6BTNCKCOB3DIFBGCVMUPQFYPA2G4O34RMTB343OYPXU5DJDVMN",[112,328,151],{"class":143},[112,330,248],{"class":122},[112,332,333],{"class":251},"\u002F\u002F false, secret seed\n",[198,335,336,337,339,340,343,344,347],{},"Three kinds of StrKey pass: an account (",[109,338,218],{},"), a muxed account (",[109,341,342],{},"M",", the account plus a 64-bit id), and a contract (",[109,345,346],{},"C","). Each one has to be the exact length for its kind, uppercase, with the version byte and the checksum in place. A secret seed is a valid StrKey and not an address, so it fails, on purpose.",[97,349,351],{"id":350},"mnemonics","Mnemonics",[198,353,354,355,358],{},"SEP-0005 puts accounts at ",[109,356,357],{},"m\u002F44'\u002F148'\u002Fx'",", three hardened levels, SLIP-10 underneath:",[102,360,362],{"className":104,"code":361,"language":106,"meta":107,"style":107},"stellarChain.deriveHDWallet(mnemonic, \"m\u002F44'\u002F148'\u002F0'\").address; \u002F\u002F GDRXE2BQ... for the SEP-0005 test phrase\n",[109,363,364],{"__ignoreMap":107},[112,365,366,368,370,373,375,378,381,383,386,388,391,394,397],{"class":114,"line":115},[112,367,257],{"class":188},[112,369,191],{"class":122},[112,371,372],{"class":178},"deriveHDWallet",[112,374,181],{"class":122},[112,376,377],{"class":188},"mnemonic",[112,379,380],{"class":122},", ",[112,382,151],{"class":143},[112,384,385],{"class":147},"m\u002F44'\u002F148'\u002F0'",[112,387,151],{"class":143},[112,389,390],{"class":122},").",[112,392,393],{"class":188},"address",[112,395,396],{"class":122},"; ",[112,398,399],{"class":251},"\u002F\u002F GDRXE2BQ... for the SEP-0005 test phrase\n",[198,401,402,403,406,407,410],{},"That is the path SEP-0005 wallets, Freighter among them, walk for the first account. ",[109,404,405],{},"stellarChain.getDerivationPath(x)"," writes it for account ",[109,408,409],{},"x",", and there's no change or index level to ask for. The SEP's own test vectors are in the test suite.",[97,412,414],{"id":413},"signing","Signing",[198,416,417,420,421,424,425,428,429,432],{},[109,418,419],{},"signMessage"," signs what the Stellar SDK's ",[109,422,423],{},"Keypair.signMessage"," signs under SEP-53: SHA-256 over ",[109,426,427],{},"\"Stellar Signed Message:\\n\""," and the message bytes, then plain ed25519 over that digest. The same key gives the same 64 bytes here and there, and ",[109,430,431],{},"verifyMessage"," on either side accepts them.",[102,434,436],{"className":104,"code":435,"language":106,"meta":107,"style":107},"const signature = stellarChain.signMessage(\"hello\", privateKey);\nstellarChain.verifyMessage(\"hello\", signature, publicKey); \u002F\u002F true\n\nimport { Keypair } from \"@stellar\u002Fstellar-sdk\";\nKeypair.fromPublicKey(address).verifyMessage(\"hello\", hexToBytes(signature)); \u002F\u002F true\n",[109,437,438,469,498,502,525],{"__ignoreMap":107},[112,439,440,442,445,447,449,451,453,455,457,460,462,464,466],{"class":114,"line":115},[112,441,168],{"class":167},[112,443,444],{"class":171}," signature",[112,446,175],{"class":167},[112,448,172],{"class":188},[112,450,191],{"class":122},[112,452,419],{"class":178},[112,454,181],{"class":122},[112,456,151],{"class":143},[112,458,459],{"class":147},"hello",[112,461,151],{"class":143},[112,463,380],{"class":122},[112,465,245],{"class":188},[112,467,468],{"class":122},");\n",[112,470,471,473,475,477,479,481,483,485,487,490,492,494,496],{"class":114,"line":157},[112,472,257],{"class":188},[112,474,191],{"class":122},[112,476,431],{"class":178},[112,478,181],{"class":122},[112,480,151],{"class":143},[112,482,459],{"class":147},[112,484,151],{"class":143},[112,486,380],{"class":122},[112,488,489],{"class":188},"signature",[112,491,380],{"class":122},[112,493,267],{"class":188},[112,495,248],{"class":122},[112,497,311],{"class":251},[112,499,500],{"class":114,"line":164},[112,501,161],{"emptyLinePlaceholder":160},[112,503,505,507,509,512,514,516,518,521,523],{"class":114,"line":504},4,[112,506,119],{"class":118},[112,508,123],{"class":122},[112,510,511],{"class":126}," Keypair",[112,513,136],{"class":122},[112,515,140],{"class":139},[112,517,144],{"class":143},[112,519,520],{"class":147},"@stellar\u002Fstellar-sdk",[112,522,151],{"class":143},[112,524,154],{"class":122},[112,526,528,531,533,536,538,540,542,544,546,548,550,552,554,557,559,561,564],{"class":114,"line":527},5,[112,529,530],{"class":188},"Keypair",[112,532,191],{"class":122},[112,534,535],{"class":178},"fromPublicKey",[112,537,181],{"class":122},[112,539,393],{"class":188},[112,541,390],{"class":122},[112,543,431],{"class":178},[112,545,181],{"class":122},[112,547,151],{"class":143},[112,549,459],{"class":147},[112,551,151],{"class":143},[112,553,380],{"class":122},[112,555,556],{"class":178},"hexToBytes",[112,558,181],{"class":122},[112,560,489],{"class":188},[112,562,563],{"class":122},")); ",[112,565,311],{"class":251},[198,567,568,569,572,573,575],{},"A signature over the raw bytes, without the prefix, is what ",[109,570,571],{},"Keypair.sign"," produces for transaction hashes. It is not a message signature, and ",[109,574,431],{}," rejects it.",[577,578,579],"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":107,"searchDepth":157,"depth":157,"links":581},[582,583,584,585,586],{"id":99,"depth":157,"text":100},{"id":207,"depth":157,"text":208},{"id":282,"depth":157,"text":283},{"id":350,"depth":157,"text":351},{"id":413,"depth":157,"text":414},"ed25519 with the public key wrapped as a G StrKey, and message signing the way SEP-53 says.","md",null,{"icon":591},"i-token-xlm",{"title":72,"description":587},"AdqmdVnrbbU1O6-oYsrPmC51jFSFp4geUc8yG39fzJc",[595,597],{"title":68,"path":69,"stem":70,"description":596,"children":-1},"ed25519. The address is the public key itself in base58 with nothing hashed.",{"title":76,"path":77,"stem":78,"description":598,"children":-1},"ed25519 or secp256k1 on one chain. Blake2b over a flag byte and the public key.",1789827873171]