🚀 Stellar Pre-authorized Transaction

Alice want to make a Paycheck to Bob so she signed the payment to get it hash and use it to create Pre-authorized Transaction and will let Bob use XDR to claim it.

1. Create Account

1.1 Go to Stellar lab to create account

Alice

Public Key
GBGGV4C6SZAIUY4HJWU33MLKC6HPL5BB4OMODJR6FM3O4NSPU4AXC5CP
Secret Key
SBZ5CICP3SJR66MOQY6ZD66KSIJNGJUN3BZDJIARQKPKKZJLIOAOMMJX

Bob

Public Key
GAZWEZ6GHUVSLQQ657Y743UCMXPPZSC3BHUK2TZNEHVQGWHIUXJL3BIB
Secret Key
SDGG4QIEKXP7PBUKUHJZZ72H4LP45NVDLC5BVNVDBOORHMQIQ44E3YRE

2. Create payment

2.1 Goto Stellar lab and target testnet.

2.2 Use Alice’s account and fetch next sequence number (34167538581504005) then +1 so its

34167538581504006

2.3 Select payment operation, paid Bob’s account for some desired amount.

2.4 Copy hash for later use

2da125f6160e3f2a3ef7039686b019e95b9b94fe196bbe40c09973db5f0f0f97
Don’t close this tab just yet we will need XDR later!

3. Add signer

3.1 Open another Stellar lab

3.2 Use Alice’s account then fetch next sequence number (34167538581504005)

3.3 Select Set Options operation

3.4 Select Pre-authorized Transaction Hash and fill with copied hash

3.5 Sign with Alice secret and submit like usual

4. Bob claim payment with XDR

4.1 Copy XDR from step 1

4.2 Paste it to Transaction > Post Transaction and submit

4.3 You should see payment succeed result here

Recap

Alice just let Bob claim her future payment by XDR. BTW for real life use case Alice should add minimum time bound to let Bob claim it sometime later.

TODO

  1. Time bound
  2. Multi-sig
  3. Authorization Required

BRB! Want more tutorials real quick? Funding below! :D

GDI6FBVJSHMF5PF6C7DDM57NAGYTYWMQQW2A6BVA6DTS2ZL7ZDRZBI2S
One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.