🚀 Stellar Pre-signed and Pre-authorized Transaction — Part 2: A pre-signed scenario

Thomas Dang
3 min readJan 30, 2019

--

Scenario

Alice wants to write a check (ie pre-signed transaction) to Bob so that Bob can redeem it later whenever he wants.

Preparation

Suppose we have following Stellar accounts

Alice

Public Key
GCBJBEM3EMFVT6I3JRRFL5ZJYMA7BKTFZOJCARWAJNXQ4KPMIAORVP6I
Secret Key
SCDEMUCNLDIT46DCGE5CPXS4E6TXABQBCXEKHDNWVAGXQ3VOKBG5XEXA

Bob

Public Key
GBMETSSKYVSBD2KBQHIJRWI76H3BBZOYKVDUFJKK2MWLN2PVTEQWW5MY
Secret Key
SB6E6GFNKSKS4SWMD7FHFMIJRKHFLFAISVAKFK3BXHSDFLYE6HKIVEYG

Step 1. Alice prepares pre-signed payment transaction

1.a. Prepare payment transaction

Specify source and Sequence number
Pay XLM 25 to Bob
Store this for later use
Hash
17f4a4c94cd3a2a2aa2b4aa15a9d11cbe38b50553f24795ecfc566814614c5a9
XDR
AAAAAIKQkZsjC1n5G0xiVfcpwwHwqmXLkiBGwEtvDinsQB0aAAAAZAAeJKkAAAAFAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAWEnKSsVkEelBgdCY2R/x9hDl2FVHQqVK0yy26fWZIWsAAAAAAAAAAA7msoAAAAAAAAAAAA==

This XDR is called: “unsigned XDR”!

1.b. Prepare pre-signed transaction

Open a new Stellar Lab page

Specify the same source and sequence number
Set operation type to Set Options
Set pre-authorized hash and weight

Go to Sign page

…and sign it with Alice’s signature

Store the generated XDR data for later use. We’ll name it as “signed XDR”

Note: don’t submit!!

Step 2. Bob claims the payment.

Open a Stellar Lab page and go to Transaction Signer

Copy and Paste Alice’s “unsigned XDR” in step 1

Copy/Paste “unsigned XDR” from step 1

Then sign it using Hash from step 1

…and Submit to go to Post Transaction page

In the Post Transaction, copy/paste “signed XDR”.

Copy and paste “signed XDR”

…and Submit

…and Woala!

We can check the Alice’s and Bob’s account balance to see the result too.

Happy Stellar discovering ;-)

Next Part, I will present how to make a “pre-authorized” transaction via Compliance service.

--

--