digraph paymentchannel {
size=6.66;
rankdir=LR;
splines = true;
nodesep = 0.4;

//edge [ minlen = 2 ];
node [ style = invis, shape = box ];

subgraph cluster_client {
    c0;
    c2 [ style = "", label = "Pay 10 mBTC\nTo example.com\n(VERIFIED)\nExp. In 10 Min.\nMemo: [...]" ];
    c3 [ label = " \n \n \n \n \n \n " ];

    label = "Spender"

}

subgraph cluster_wallet {
    w0;
    w1;
    w2 [ style = "", label = <<FONT FACE="Courier-Bold">Payment</FONT><BR/> <BR/>TX1<BR/>[TX...]<BR/>Memo<BR/>Refund<BR/>address(es)> ];
    w3;

    label = "Spender's\nWallet"
}
subgraph cluster_merchant {
    subgraph cluster_payment_request {
        label = <<FONT FACE="Courier-Bold">Payment<BR/>Request</FONT>>
        m1 [ style = "", label = <<FONT FACE="Courier-Bold">Payment<BR/>Details</FONT><BR/> <BR/><FONT FACE="Courier-Bold">Outputs</FONT><BR/>Exp. Time<BR/>Memo<BR/>Pay URL<BR/>Ref #>];
        sig [ style = "", label = "X.509 Sig" ];
    }
    m3 [ style = "", label = "TX1\n[TX...]\nMemo" ];

    label = "Receiver"
}

uri [ style = "", label = "Pay Now\nLink/QR Code" ]

uri -> c0 [constraint = false, label = "bitcoin:\n  ?r=http://example.com/pay/123\n \n \n \n"];
c0 -> w0 [ label = "I clicked a\nbitcoin: URI", weight = 100 ]; 
w0 -> m1 [ label = "Send the\ninvoice from\n[...]/pay/123", weight = 100 ];

m1 -> w1 [ label = "Here's the invoice" ];
w1 -> c2 [ label = "Do you agree to\nthe invoice terms?" ];

p2p [ style = "invis",  label="", width=0, height=0 ];
c2 -> w2 [ label = "Yes.\nPay the invoice" ];
w2 -> m3 [ label = "TX(es) attached\nwith refund\naddresses and\na memo" ];
m3 -> p2p [ label = "", style = dashed ]

m3 -> w3 [ label = <<FONT FACE="Courier-Bold">PaymentACK</FONT><BR/>Thanks!<BR/>payment accepted<BR/>for processing> ];
w3 -> c3 [ label = "Payment accepted;\nyou can go do\nsomething else" ];

label = "\nThe Bitcoin Payment Protocol As Described In BIP70"
}
