This project demonstrates how to generate Ed25519 signed URLs for the Ramp widget.
- Ed25519 key pair generation
- Signed URL creation for Ramp widget
- TypeScript implementation with full type safety
Install dependencies:
npm installTo generate keys (if needed) and create a signed widget URL:
npm startTo only generate Ed25519 key pair:
npm run generate-keysThis will:
- Generate a new Ed25519 key pair
- Save the keys to the
keys/directory - Display the public key in both PEM and Ramp formats
Important: Share the public key (in the ====begin public key==== format) with Ramp Network.
To compile TypeScript to JavaScript:
npm run build.
├── src/
│ ├── index.ts # Main entry point
│ ├── generateKeys.ts # Key pair generation
│ └── rampWidget.ts # Signed URL generation
├── keys/ # Generated key pairs (created automatically)
│ ├── private_key.pem
│ └── public_key.pem
├── dist/ # Compiled JavaScript (created on build)
├── package.json
├── tsconfig.json
└── README.md
- Never commit your private key to version control
- The
keys/directory is excluded from git (add to .gitignore) - Only share your public key with Ramp Network
- Key Generation: Creates an Ed25519 key pair using Node.js crypto module
- URL Construction: Builds query string with widget parameters and timestamp
- Signing: Signs the query string using the private key
- URL Assembly: Combines base URL, query parameters, and signature
The public key will be displayed in the format required by Ramp:
====begin public key====
MCowBQYDK2VwAyEA...base64content...
====end public key====