Skip to main content
deleted 1 character in body
Source Link
JSRB
  • 113
  • 5

I use the following demo to create a new account on testnet:

import requests

from stellar_sdk import Keypair, Server

# Generate random keypair
keypair = Keypair.random()

print("Public Key: " + keypair.public_key)
print("Secret Seed: " + keypair.secret)

# Call the Api to create a test account via Friendbot
response = requests.get(f"https://friendbot.stellar.org?addr={keypair.public_key}")
if response.status_code == 200:
    print(f"SUCCESS! You have a new account :)\n{response.text}")
else:
    print(f"ERROR! Response: \n{response.text}")

According to the official documentation I'd have expected that the account_id equals the privatepublic key used to create the account, but it does not.

What do I miss?

I use the following demo to create a new account on testnet:

import requests

from stellar_sdk import Keypair, Server

# Generate random keypair
keypair = Keypair.random()

print("Public Key: " + keypair.public_key)
print("Secret Seed: " + keypair.secret)

# Call the Api to create a test account via Friendbot
response = requests.get(f"https://friendbot.stellar.org?addr={keypair.public_key}")
if response.status_code == 200:
    print(f"SUCCESS! You have a new account :)\n{response.text}")
else:
    print(f"ERROR! Response: \n{response.text}")

According to the official documentation I'd have expected that the account_id equals the private key used to create the account, but it does not.

What do I miss?

I use the following demo to create a new account on testnet:

import requests

from stellar_sdk import Keypair, Server

# Generate random keypair
keypair = Keypair.random()

print("Public Key: " + keypair.public_key)
print("Secret Seed: " + keypair.secret)

# Call the Api to create a test account via Friendbot
response = requests.get(f"https://friendbot.stellar.org?addr={keypair.public_key}")
if response.status_code == 200:
    print(f"SUCCESS! You have a new account :)\n{response.text}")
else:
    print(f"ERROR! Response: \n{response.text}")

According to the official documentation I'd have expected that the account_id equals the public key used to create the account, but it does not.

What do I miss?

Source Link
JSRB
  • 113
  • 5

Why does the account_id not equal the private_key when creating a new account?

I use the following demo to create a new account on testnet:

import requests

from stellar_sdk import Keypair, Server

# Generate random keypair
keypair = Keypair.random()

print("Public Key: " + keypair.public_key)
print("Secret Seed: " + keypair.secret)

# Call the Api to create a test account via Friendbot
response = requests.get(f"https://friendbot.stellar.org?addr={keypair.public_key}")
if response.status_code == 200:
    print(f"SUCCESS! You have a new account :)\n{response.text}")
else:
    print(f"ERROR! Response: \n{response.text}")

According to the official documentation I'd have expected that the account_id equals the private key used to create the account, but it does not.

What do I miss?