Protocol status: Draft architecture. eCoin is under development. These pages describe the Version 0.1 design direction and illustrative developer models, not a finalized wire protocol, production API, or live mainnet.
Pseudocode
assert network.id == configuredNetwork
recipient = wallet.validateDestination(userInput)
quote = network.estimateFee(recipient, amount)
draft = wallet.preparePayment(recipient, amount, quote)
ui.showReview(draft)
user.confirm()
signed = wallet.authorize(draft)
receipt = network.submit(signed)
while receipt.status not in ["finalized", "rejected"]:
receipt = network.refresh(receipt.id)
if receipt.status == "finalized":
ui.showSuccess(receipt)
else:
ui.showFailure(receipt.error)
What this example is teaching
- Validate the destination before signing.
- Display the amount and estimated fee before authorization.
- Keep signing local to the wallet security boundary.
- Do not call an observed transaction “paid” if your business rule requires finality.
- Handle rejection as a normal state, not an exceptional mystery.
Previous
‹ Testing Applications
Next
Payment Processing ›