Skip to content

Instantly share code, notes, and snippets.

@andrewschaaf
Created March 28, 2011 16:58
Show Gist options
  • Save andrewschaaf/890835 to your computer and use it in GitHub Desktop.
Save andrewschaaf/890835 to your computer and use it in GitHub Desktop.
(incomplete)

Terms

address     RIPEMD160 hash of the node's signing key
host        IP[:port?]

uint32      32-bit unsigned integer, (TODO)-endian

Message {Transport,Header}

  • TLS over TCP
  • socket.write(header + body)

9-byte header

type          uint4   (message:0, reply:1, error:2)
more_chunks   uint1
padding       uint3
msgno         uint32
size          uint32

Messages

Everything via Protobuf

Core Messages

Time:        "here's my clock's current time" -- reply: Time

                    header        Header

Relay:       "here's an encrypted message for [recipient] -- pass it on"

                    header        Header
                    message       EncryptedMessage

Nodes:       "here are some (address, host, auth_key, enc_key)s"

                    header        Header
                    nodes         (NodeInfo)-list

NodeRequest: "can you tell me more about these (address)s?" -- reply: Nodes

                    header        Header
                    addresses     (bytes)-list

Account Messages

Connect:     "I want to open a line of credit with you"

                    header                    Header
                    line_of_credit_id         bytes
                    linked_line_of_credit_id  bytes
                    units                     string
                    credit_offered            string
                    iou_offered               string
                    commit_arbiters           bytes
                    note                      string
                    proof_of_id               bytes

IOU:        "I owe you [positive amount] more than I did on [line of credit]"
                    (signed by sender)

                    header                    Header
                    line_of_credit_id         bytes
                    amount                    string
                    transaction_id            bytes
                    memo                      string

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment