create_wallet
Generate BIP-39 mnemonics and derive VeChain wallet keys using standard derivation paths for blockchain account creation and management.
Instructions
Generate a BIP-39 mnemonic (12/15/18/21/24 words) and derive the account-level secp256k1 key at path m/44'/818'/0'/0 (VET coin type = 818). By default, the private key is REDACTED in the response. Set includeSecret=true to include it (handle with care).
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| wordlistSize | No | Length of the BIP-39 mnemonic wordlist. Default: 12 |
Implementation Reference
- src/tools.ts:474-516 (handler)The handler function (callback) that generates a BIP-39 mnemonic based on wordlistSize, derives the secp256k1 private key, computes its hex representation and public key address, and returns them as JSON. Handles errors gracefully.callback: async ({ wordlistSize = 12 }: { wordlistSize?: 12 | 15 | 18 | 21 | 24 }) => { try { const mnemonic = Mnemonic.of(wordlistSize); const secretKey = Mnemonic.toPrivateKey(mnemonic); const secretKeyHex = Hex.of(secretKey).toString(); const publicKey = Secp256k1.derivePublicKey(secretKey); const publicKeyAddress = Address.ofPublicKey(publicKey).toString(); const result = { mnemonic, secretKey, secretKeyHex, publicKey: publicKeyAddress }; return { content: [ { type: "text", text: JSON.stringify(result, null, 2), }, ], }; } catch (err) { const isAbort = (err as Error)?.name === "AbortError"; return { content: [ { type: "text", text: JSON.stringify( { error: isAbort ? "Request timed out" : "Failed to create wallet", reason: String((err as Error)?.message ?? err), }, null, 2 ), }, ], }; } }
- src/tools.ts:468-473 (schema)Zod input schema defining optional wordlistSize (12,15,18,21,24 words).inputSchema: { wordlistSize: z .union([z.literal(12), z.literal(15), z.literal(18), z.literal(21), z.literal(24)]) .optional() .describe("Length of the BIP-39 mnemonic wordlist. Default: 12") },
- src/tools.ts:464-517 (registration)The tool registration object in the vechainTools array, including name, title, description, inputSchema, and callback handler.{ name: "create_wallet", title: "Create a VeChain wallet (mnemonic + keys)", description: "Generate a BIP-39 mnemonic (12/15/18/21/24 words) and derive the account-level secp256k1 key at path m/44'/818'/0'/0 (VET coin type = 818). By default, the private key is REDACTED in the response. Set includeSecret=true to include it (handle with care).", inputSchema: { wordlistSize: z .union([z.literal(12), z.literal(15), z.literal(18), z.literal(21), z.literal(24)]) .optional() .describe("Length of the BIP-39 mnemonic wordlist. Default: 12") }, callback: async ({ wordlistSize = 12 }: { wordlistSize?: 12 | 15 | 18 | 21 | 24 }) => { try { const mnemonic = Mnemonic.of(wordlistSize); const secretKey = Mnemonic.toPrivateKey(mnemonic); const secretKeyHex = Hex.of(secretKey).toString(); const publicKey = Secp256k1.derivePublicKey(secretKey); const publicKeyAddress = Address.ofPublicKey(publicKey).toString(); const result = { mnemonic, secretKey, secretKeyHex, publicKey: publicKeyAddress }; return { content: [ { type: "text", text: JSON.stringify(result, null, 2), }, ], }; } catch (err) { const isAbort = (err as Error)?.name === "AbortError"; return { content: [ { type: "text", text: JSON.stringify( { error: isAbort ? "Request timed out" : "Failed to create wallet", reason: String((err as Error)?.message ?? err), }, null, 2 ), }, ], }; } } },