REST API to create Stellar account?

1

2

In the REST API documentation, I didn't see an option to create an account. Obviously then, the code snippet here to create an account has to be front-ended by some other API so that a request to create an account can be catered to. I am not sure why this is so. Is there a HTTP POST REST API to create an account?

Also, normally, to build a REST interface, one starts with identifying all 'resources' whose state changes over time and can be changed in a state-less operation. Then, for every such resource, the CRUD operations are implemented. For example, in Stellar, the resources could be account, anchor, trustlines, transactions, etc.

cogitoergosum

Posted 2017-02-12T02:54:58.030

Reputation: 317

Answers

2

There is no REST endpoint to create an account. An account is implicitly created after receiving at least 20 lumens.

To create an account:

  1. Generate a private/public keypair. You can use the Stellar Laboratory Account Creator for that.
  2. Get at least 20 lumens, either from an exchange or through another account, sent to the public key you just created.

That's it.

Official guide : https://www.stellar.org/developers/guides/get-started/create-account.html

Tomer Weller

Posted 2017-02-12T02:54:58.030

Reputation: 121

Hello there Mr. Weller, so, is there a way to generate the private/public keypair without having to resort to using the SDKs?jlstr 2017-10-29T00:10:41.733

1

@jlstr Yes, you will need to use a crypto library that implements ed25519. You can see how the Stellar SDKs do that for reference. For example, Here's the Java keypair implementation.

Tomer Weller 2017-10-29T02:59:43.583

0

Just as the documentation clearly mentions,

To create a test account, send Friendbot the public key you created. It’ll create and fund a new account using that public key as the account ID.

  • Create your own public key use ED25519 public-key signature system
  • Perform a GET to the request friendlybot https://friendbot.stellar.org/?addr=

psgganesh

Posted 2017-02-12T02:54:58.030

Reputation: 1

I think he wants to get a real account, not a test one, and he's asking how to create it without going through an exchangeDelio 2019-06-20T15:22:57.587