(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[63930],{71729:function(e,i,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/en/build/sdks/dotnet-sdk/accounts/ed25519",function(){return s(70311)}])},70311:function(e,i,s){"use strict";s.r(i),s.d(i,{useTOC:function(){return l}});var n=s(31549),t=s(82910),a=s(1117),r=s(46977),d=s(13844),h=s(9029),c=s(83185);function l(e){return[{value:"Creating Ed25519Accounts",id:"creating-ed25519accounts",depth:2},{value:"Using a Private Key",id:"using-a-private-key",depth:3},{value:"Using a Mneomonic Phrase",id:"using-a-mneomonic-phrase",depth:3},{value:"Generating a Random Account",id:"generating-a-random-account",depth:3},{value:"Additional Resources",id:"additional-resources",depth:2}]}function o(e,i){throw Error("Expected "+(i?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}i.default=(0,t.c)(function(e){let{toc:i=l(e)}=e,s={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",p:"p",pre:"pre",span:"span",...(0,r.a)(),...e.components};return h.Zb||o("Card",!1),h.Zb.Description||o("Card.Description",!0),h.Zb.Image||o("Card.Image",!0),h.Zb.Title||o("Card.Title",!0),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(d.U,{type:"warning",emoji:"❗",children:(0,n.jsxs)(s.p,{children:["This SDK is currently in beta. Please report any issues you encounter by\ncreating an issue in the\n",(0,n.jsx)(s.a,{href:"https://github.com/aptos-labs/aptos-dotnet-sdk",children:"aptos-labs/aptos-dotnet-sdk"}),"\nrepository."]})}),"\n",(0,n.jsx)(s.h1,{children:"Ed25519 Accounts"}),"\n",(0,n.jsx)(s.p,{children:"The Aptos .NET SDK provides a simple way to create and manage Ed25519 accounts. In this guide we\nwill provide snippets of creating or importing existing accounts."}),"\n",(0,n.jsx)(s.h2,{id:i[0].id,children:i[0].value}),"\n",(0,n.jsx)(s.p,{children:"Ed25519Accounts are created to sign transactions and interact with the blockchain."}),"\n",(0,n.jsx)(s.h3,{id:i[1].id,children:i[1].value}),"\n",(0,n.jsxs)(s.p,{children:["To generate an account from a private key, you will need to create the ",(0,n.jsx)(s.code,{children:"Ed25519PrivateKey"})," object and pass into into the\n",(0,n.jsx)(s.code,{children:"Ed25519Account"})," constructor. The private key can be given a ",(0,n.jsx)(s.code,{children:"string"})," or ",(0,n.jsx)(s.code,{children:"byte[]"})," representation."]}),"\n",(0,n.jsx)(s.pre,{icon:c.DF,tabIndex:"0","data-language":"csharp","data-word-wrap":"","data-copy":"",children:(0,n.jsxs)(s.code,{children:[(0,n.jsxs)(s.span,{children:[(0,n.jsx)(s.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"var"}),(0,n.jsx)(s.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:" privateKey"}),(0,n.jsx)(s.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" ="}),(0,n.jsx)(s.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" new"}),(0,n.jsx)(s.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:" Ed25519PrivateKey"}),(0,n.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"("}),(0,n.jsx)(s.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:'"0x1234...abcdef"'}),(0,n.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:");"})]}),"\n",(0,n.jsxs)(s.span,{children:[(0,n.jsx)(s.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"var"}),(0,n.jsx)(s.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:" account"}),(0,n.jsx)(s.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" ="}),(0,n.jsx)(s.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" new"}),(0,n.jsx)(s.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:" Ed25519Account"}),(0,n.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"(privateKey);"})]})]})}),"\n",(0,n.jsx)(s.h3,{id:i[2].id,children:i[2].value}),"\n",(0,n.jsxs)(s.p,{children:["To generate an account from a phrase, you can use ",(0,n.jsx)(s.code,{children:"Ed25519Account.FromDerivationPath"})," and pass in the phrase and the derivation path.\nThe derivation path that is typically used throughout the Aptos ecosystem is ",(0,n.jsx)(s.code,{children:"m/44'/637'/0'/0'/0'"}),"."]}),"\n",(0,n.jsx)(s.pre,{icon:c.DF,tabIndex:"0","data-language":"csharp","data-word-wrap":"","data-copy":"",children:(0,n.jsxs)(s.code,{children:[(0,n.jsxs)(s.span,{children:[(0,n.jsx)(s.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"var"}),(0,n.jsx)(s.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:" account"}),(0,n.jsx)(s.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" ="}),(0,n.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" Ed25519Account."}),(0,n.jsx)(s.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"FromDerivationPath"}),(0,n.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"("})]}),"\n",(0,n.jsxs)(s.span,{children:[(0,n.jsx)(s.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"    \"m/44'/637'/0'/0'/0'\""}),(0,n.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:","})]}),"\n",(0,n.jsx)(s.span,{children:(0,n.jsx)(s.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:'    "apple banana cat dog elephant fox ..."'})}),"\n",(0,n.jsx)(s.span,{children:(0,n.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:");"})})]})}),"\n",(0,n.jsx)(s.h3,{id:i[3].id,children:i[3].value}),"\n",(0,n.jsxs)(s.p,{children:["To create a random account, you can use the ",(0,n.jsx)(s.code,{children:"Account.Generate()"})," method."]}),"\n",(0,n.jsx)(s.pre,{icon:c.DF,tabIndex:"0","data-language":"csharp","data-word-wrap":"","data-copy":"",children:(0,n.jsx)(s.code,{children:(0,n.jsxs)(s.span,{children:[(0,n.jsx)(s.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"var"}),(0,n.jsx)(s.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:" account"}),(0,n.jsx)(s.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" ="}),(0,n.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" Account."}),(0,n.jsx)(s.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"Generate"}),(0,n.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"();"})]})})}),"\n",(0,n.jsx)(s.h2,{id:i[4].id,children:i[4].value}),"\n",(0,n.jsx)(h.oy,{className:"xl:grid-cols-2",children:(0,n.jsxs)(h.Zb,{href:"https://aptos-labs.github.io/aptos-dotnet-sdk/docs/Aptos.Ed25519Account.html",className:"col-span-2 flex flex-row gap-4",children:[(0,n.jsx)(h.Zb.Image,{src:"https://cdn-icons-png.flaticon.com/512/25/25231.png"}),(0,n.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,n.jsx)(h.Zb.Title,{children:"Ed25519Account Reference"}),(0,n.jsx)(h.Zb.Description,{children:(0,n.jsx)(s.p,{children:"The full API reference for the Ed25519Account class."})})]})]})})]})},"/en/build/sdks/dotnet-sdk/accounts/ed25519",{filePath:"pages/en/build/sdks/dotnet-sdk/accounts/ed25519.mdx",timestamp:1728425436e3,pageMap:a.v,frontMatter:{title:"Ed25519 Accounts"},title:"Ed25519 Accounts"},"undefined"==typeof RemoteContent?l:RemoteContent.useTOC)},82910:function(e,i,s){"use strict";s.d(i,{c:function(){return h}});var n=s(31549),t=s(74271),a=s(14553),r=s(55754),d=s(46977);function h(e,i,s,n){let a=globalThis[t.ud];return a.route=i,a.pageMap=s.pageMap,a.context[i]={Content:e,pageOpts:s,useTOC:n},c}function c({__nextra_pageMap:e=[],__nextra_dynamic_opts:i,...s}){let d=globalThis[t.ud],{Layout:h,themeConfig:c}=d,{route:o,locale:p}=(0,a.t)(),u=d.context[o];if(!u)throw Error(`No content found for the "${o}" route. Please report it as a bug.`);let{pageOpts:k,useTOC:x,Content:g}=u;if(o.startsWith("/["))k.pageMap=e;else for(let{route:i,children:s}of e){let e=i.split("/").slice(p?2:1);(function e(i,[s,...n]){for(let t of i)if("children"in t&&s===t.name)return n.length?e(t.children,n):t})(k.pageMap,e).children=s}if(i){let{title:e,frontMatter:s}=i;k={...k,title:e,frontMatter:s}}return(0,n.jsx)(h,{themeConfig:c,pageOpts:k,pageProps:s,children:(0,n.jsx)(r.F,{value:s,children:(0,n.jsx)(l,{useTOC:x,children:(0,n.jsx)(g,{...s})})})})}function l({children:e,useTOC:i}){let{wrapper:s}=(0,d.a)();return(0,n.jsx)(o,{useTOC:i,wrapper:s,children:e})}function o({children:e,useTOC:i,wrapper:s,...t}){let a=i(t);return s?(0,n.jsx)(s,{toc:a,children:e}):e}}},function(e){e.O(0,[49774,94249,27159,65411,57822,68889,43941,49296,1117,9029,92888,40179],function(){return e(e.s=71729)}),_N_E=e.O()}]);