Urbit Docs
  • What is Urbit?
  • Get on Urbit
  • Build on Urbit
    • Contents
    • Environment Setup
    • Hoon School
      • 1. Hoon Syntax
      • 2. Azimuth (Urbit ID)
      • 3. Gates (Functions)
      • 4. Molds (Types)
      • 5. Cores
      • 6. Trees and Addressing
      • 7. Libraries
      • 8. Testing Code
      • 9. Text Processing I
      • 10. Cores and Doors
      • 11. Data Structures
      • 12. Type Checking
      • 13. Conditional Logic
      • 14. Subject-Oriented Programming
      • 15. Text Processing II
      • 16. Functional Programming
      • 17. Text Processing III
      • 18. Generic and Variant Cores
      • 19. Mathematics
    • App School I
      • 1. Arvo
      • 2. The Agent Core
      • 3. Imports and Aliases
      • 4. Lifecycle
      • 5. Cards
      • 6. Pokes
      • 7. Structures and Marks
      • 8. Subscriptions
      • 9. Vanes
      • 10. Scries
      • 11. Failure
      • 12. Next Steps
      • Appendix: Types
    • App School II (Full-Stack)
      • 1. Types
      • 2. Agent
      • 3. JSON
      • 4. Marks
      • 5. Eyre
      • 6. React app setup
      • 7. React app logic
      • 8. Desk and glob
      • 9. Summary
    • Core Academy
      • 1. Evaluating Nock
      • 2. Building Hoon
      • 3. The Core Stack
      • 4. Arvo I: The Main Sequence
      • 5. Arvo II: The Boot Sequence
      • 6. Vere I: u3 and the Serf
      • 7. Vere II: The Loom
      • 8. Vanes I: Behn, Dill, Kahn, Lick
      • 9. Vanes II: Ames
      • 10. Vanes III: Eyre, Iris
      • 11. Vanes IV: Clay
      • 12. Vanes V: Gall and Userspace
      • 13. Vanes VI: Khan, Lick
      • 14. Vanes VII: Jael, Azimuth
    • Runtime
      • U3
      • Conn.c Guide
      • How to Write a Jet
      • API Overview by Prefix
      • C in Urbit
      • Cryptography
      • Land of Nouns
    • Tools
      • Useful Links
      • JS Libraries
        • HTTP API
      • Docs App
        • File Format
        • Index File
        • Suggested Structure
    • Userspace
      • Command-Line App Tutorial
      • Remote Scry
      • Unit Tests
      • Software Distribution
        • Software Distribution Guide
        • Docket File
        • Glob
      • Examples
        • Building a CLI App
        • Debugging Wrapper
        • Host a Website
        • Serving a JS Game
        • Ship Monitoring
        • Styled Text
  • Urbit ID
    • What is Urbit ID?
    • Azimuth Data Flow
    • Life and Rift
    • Urbit HD Wallet
    • Advanced Azimuth Tools
    • Custom Roller Tutorial
    • Azimuth.eth Reference
    • Ecliptic.eth Reference
    • Layer 2
      • L2 Actions
      • L2 Rollers
      • L2 Roller HTTP RPC-API
      • L2 Transaction Format
  • Urbit OS
    • What is Urbit OS?
    • Base
      • Hood
      • Threads
        • Basics Tutorial
          • Bind
          • Fundamentals
          • Input
          • Output
          • Summary
        • HTTP API Guide
        • Spider API Reference
        • Strandio Reference
        • Examples
          • Child Thread
          • Fetch JSON
          • Gall
            • Poke Thread
            • Start Thread
            • Stop Thread
            • Take Facts
            • Take Result
          • Main-loop
          • Poke Agent
          • Scry
          • Take Fact
    • Kernel
      • Arvo
        • Cryptography
        • Move Trace
        • Scries
        • Subscriptions
      • Ames
        • Ames API Reference
        • Ames Cryptography
        • Ames Data Types
        • Ames Scry Reference
      • Behn
        • Behn API Reference
        • Behn Examples
        • Behn Scry Reference
      • Clay
        • Clay API Reference
        • Clay Architecture
        • Clay Data Types
        • Clay Examples
        • Clay Scry Reference
        • Filesystem Hierarchy
        • Marks
          • Mark Examples
          • Using Marks
          • Writing Marks
        • Using Clay
      • Dill
        • Dill API Reference
        • Dill Data Types
        • Dill Scry Reference
      • Eyre
        • EAuth
        • Eyre Data Types
        • Eyre External API
        • Eyre Internal API
        • Eyre Scry Reference
        • Low-Level Eyre Guide
        • Noun channels
      • Gall
        • Gall API Reference
        • Gall Data Types
        • Gall Scry Reference
      • Iris
        • Iris API Reference
        • Iris Data Types
        • Iris Example
      • Jael
        • Jael API Reference
        • Jael Data Types
        • Jael Examples
        • Jael Scry Reference
      • Khan
        • Khan API Reference
        • Khan Data Types
        • Khan Example
      • Lick
        • Lick API Reference
        • Lick Guide
        • Lick Examples
        • Lick Scry Reference
  • Hoon
    • Why Hoon?
    • Advanced Types
    • Arvo
    • Auras
    • Basic Types
    • Cheat Sheet
    • Cryptography
    • Examples
      • ABC Blocks
      • Competitive Programming
      • Emirp
      • Gleichniszahlenreihe
      • Islands
      • Luhn Number
      • Minimum Path Sum
      • Phone Letters
      • Restore IP
      • Rhonda Numbers
      • Roman Numerals
      • Solitaire Cipher
      • Water Towers
    • Generators
    • Hoon Errors
    • Hoon Style Guide
    • Implementing an Aura
    • Irregular forms
    • JSON
    • Limbs and wings
      • Limbs
      • Wings
    • Mips (Maps of Maps)
    • Parsing Text
    • Runes
      • | bar · Cores
      • $ buc · Structures
      • % cen · Calls
      • : col · Cells
      • . dot · Nock
      • / fas · Imports
      • ^ ket · Casts
      • + lus · Arms
      • ; mic · Make
      • ~ sig · Hints
      • = tis · Subject
      • ? wut · Conditionals
      • ! zap · Wild
      • Constants (Atoms and Strings)
      • --, == · Terminators
    • Sail (HTML)
    • Serialization
    • Sets
    • Standard Library
      • 1a: Basic Arithmetic
      • 1b: Tree Addressing
      • 1c: Molds and Mold-Builders
      • 2a: Unit Logic
      • 2b: List Logic
      • 2c: Bit Arithmetic
      • 2d: Bit Logic
      • 2e: Insecure Hashing
      • 2f: Noun Ordering
      • 2g: Unsigned Powers
      • 2h: Set Logic
      • 2i: Map Logic
      • 2j: Jar and Jug Logic
      • 2k: Queue Logic
      • 2l: Container from Container
      • 2m: Container from Noun
      • 2n: Functional Hacks
      • 2o: Normalizing Containers
      • 2p: Serialization
      • 2q: Molds and Mold-Builders
      • 3a: Modular and Signed Ints
      • 3b: Floating Point
      • 3c: Urbit Time
      • 3d: SHA Hash Family
      • 3e: AES encryption (Removed)
      • 3f: Scrambling
      • 3g: Molds and Mold-Builders
      • 4a: Exotic Bases
      • 4b: Text Processing
      • 4c: Tank Printer
      • 4d: Parsing (Tracing)
      • 4e: Parsing (Combinators)
      • 4f: Parsing (Rule-Builders)
      • 4g: Parsing (Outside Caller)
      • 4h: Parsing (ASCII Glyphs)
      • 4i: Parsing (Useful Idioms)
      • 4j: Parsing (Bases and Base Digits)
      • 4k: Atom Printing
      • 4l: Atom Parsing
      • 4m: Formatting Functions
      • 4n: Virtualization
      • 4o: Molds
      • 5a: Compiler Utilities
      • 5b: Macro Expansion
      • 5c: Compiler Backend & Prettyprinter
      • 5d: Parser
      • 5e: Molds and mold builders
      • 5f: Profiling support
    • Strings
    • The Engine Pattern
    • Udon (Markdown-esque)
    • Vases
    • Zuse
      • 2d(1-5): To JSON, Wains
      • 2d(6): From JSON
      • 2d(7): From JSON (unit)
      • 2e(2-3): Print & Parse JSON
      • 2m: Ordered Maps
  • Nock
    • What is Nock?
    • Decrement
    • Definition
    • Fast Hints and Jets
    • Implementations
    • Specification
  • User Manual
    • Contents
    • Running Urbit
      • Cloud Hosting
      • Home Servers
      • Runtime Reference
      • Self-hosting S3 Storage with MinIO
    • Urbit ID
      • Bridge Troubleshooting
      • Creating an Invite Pool
      • Get an Urbit ID
      • Guide to Factory Resets
      • HD Wallet (Master Ticket)
      • Layer 2 for planets
      • Layer 2 for stars
      • Proxies
      • Using Bridge
    • Urbit OS
      • Basics
      • Configuring S3 Storage
      • Dojo Tools
      • Filesystem
      • Shell
      • Ship Troubleshooting
      • Star and Galaxy Operations
      • Updates
Powered by GitBook

GitHub

  • Urbit ID
  • Urbit OS
  • Runtime

Resources

  • YouTube
  • Whitepaper
  • Awesome Urbit

Contact

  • X
  • Email
  • Gather
On this page
  • $address
  • $verb
  • $blob
  • $error
  • $lane
  • $plea
  • $spar
  • $bone
  • $fragment
  • $fragment-num
  • $message-blob
  • $message-num
  • $public-key
  • $symmetric-key
  • $ack
  • $ship-state
  • $alien-agenda
  • $peer-state
  • $keen-state
  • $want
  • $have
  • $meow
  • $peep
  • $wail
  • $roar
  • $purr
  • $qos
  • $ossuary
  • $message-pump-state
  • $static-fragment
  • $packet-pump-state
  • $pump-metrics
  • $live-packet
  • $live-packet-key
  • $live-packet-val
  • $packet-state
  • $message-sink-state
  • $partial-rcv-message
Edit on GitHub
  1. Urbit OS
  2. Kernel
  3. Ames

Ames Data Types

Here are the data types used by Ames, as defined in lull.hoon.

$address

+$  address  @uxaddress

Opaque atomic transport address to or from Unix. For Ames over UDP, it will encode the IP address and port.

$verb

+$  verb  ?(%snd %rcv %odd %msg %ges %for %rot)

Verbosity flag for Ames. Use with |ames/verb %flag1 %flag2 ... and turn off with |ames/verb.

  • %snd - Sending packets.

  • %rcv - Receiving packets.

  • %odd - Unusual events.

  • %msg - Message-level events.

  • %ges - Congestion control.

  • %for - Packet forwarding.

  • %rot - Routing attempts.

$blob

+$  blob  @uxblob

Raw atom to or from Unix, representing a packet.

$error

+$  error  [tag=@tas =tang]

Tagged diagnostic trace.

$lane

+$  lane  (each @pC address)

Ship transport address; either opaque $address or galaxy. The runtime knows how to look up galaxies, so we don't need to know their transport addresses.

$plea

+$  plea  [vane=@tas =path payload=*]

Application-level message, as a %pass.

  • vane - Destination vane on remote ship.

  • path - Internal route on the receiving ship.

  • payload - Semantic message contents.

$spar

+$  spar  [=ship =path]

Instead of a fully qualifying scry path, Ames infers rift and life based on the ship.

$bone

+$  bone  @udbone

Message flow index - mapped to ducts in the $ossuary.

The first bone is 0. They increment by 4, since each flow includes a bit for each message determining forward vs. backward and a second bit for whether the message is on the normal flow or the associated diagnostic flow (for naxplanations).

The least significant bit of a bone is:

  • 1 if "forward", i.e. we send %pleas on this flow.

  • 0 if "backward", i.e. we receive %pleas on this flow.

The second-least significant bit is 1 if the bone is a naxplanation bone, and 0 otherwise. Only naxplanation messages can be sent on a naxplanation bone, as %boons.

$fragment

+$  fragment  @uwfragment

A message fragment.

$fragment-num

+$  fragment-num  @udfragmentnum

Message fragment count.

$message-blob

+$  message-blob  @udmessageblob

Unfragmented message blob.

$message-num

+$  message-num  @udmessagenum

Message count.

$public-key

+$  public-key  @uwpublickey

A peer's public key.

$symmetric-key

+$  symmetric-key  @uwsymmetrickey

A symmetric key for encrypting messages to a peer. This is produced by performing an elliptic curve Diffie-Hellman using our private key and the peer's public key.

$ack

+$  ack
  $%  [%ok ~]
      [%nack ~]
      [%naxplanation =error]
  ==

A message acknowledgement.

  • %ok - Positive acknowledgement.

  • %nack - Negative acknowledgement.

  • %naxplanation - Nack trace.

$ship-state

+$  ship-state
  $%  [%alien alien-agenda]
      [%known peer-state]
  ==

All Ames knows about a peer.

  • %alien - No PKI data, so enqueue actions to perform once we learn it.

  • %known - We know their life and public keys, so we have a channel.

$alien-agenda

+$  alien-agenda
  $:  messages=(list [=duct =plea])
      packets=(set =blob)
      heeds=(set duct)
      keens=(jug path duct)
  ==

What to do when Ames learns a peer's life and keys.

  • messages - $pleas local vanes have asked Ames to send.

  • packets - Packets we've tried to send.

  • heeds - Local tracking requests; passed through into $peer-state.

  • keens - Subscribers to remote scry paths.

$peer-state

+$  peer-state
  $:  $:  =symmetric-key
          =life
          =rift
          =public-key
          sponsor=ship
      ==
      route=(unit [direct=? =lane])
      =qos
      =ossuary
      snd=(map bone message-pump-state)
      rcv=(map bone message-sink-state)
      nax=(set [=bone =message-num])
      heeds=(set duct)
      closing=(set bone)
      corked=(set bone)
      keens=(map path keen-state)
  ==

State for a peer with known life and keys.

  • route - Transport-layer destination for packets to the peer.

  • qos - Quality of service; connection status to the peer.

  • ossuary - $bone to duct mapper.

  • snd - Per-bone message pumps to send messages as fragments.

  • rcv - Per-bone message sinks to assemble messages from fragments.

  • nax - Unprocessed nacks (negative acknowledgments).

  • heeds - Listeners for %clog notifications.

  • closing: Bones closed on the sender side.

  • corked: Bones closed on both sender and receiver.

  • keens: Remote scry state.

$keen-state

+$  keen-state
  $:  wan=((mop @ud want) lte)  ::  request packets, sent
      nex=(list want)           ::  request packets, unsent
      hav=(list have)           ::  response packets, backward
      num-fragments=@ud
      num-received=@ud
      next-wake=(unit @da)
      listeners=(set duct)
      metrics=pump-metrics
  ==

Remote scry state for a peer.

  • wan: Request packets, sent.

  • nex: Request packets, unsent.

  • hav: Response packets, backwards.

  • num-fragments: Total fragment count.

  • num-received: Fragments received.

  • next-wake: Retry timing.

  • listeners: Ducts waiting for a response.

  • metrics: Stats.

$want

+$  want
  $:  fra=@ud
      =hoot
      packet-state
  ==

Remote scry request fragment.

$have

+$  have
  $:  fra=@ud
      meow
  ==

Remote scry response fragment.

$meow

+$  meow
  $:  sig=@ux
      num=@ud
      dat=@ux
  ==

Remote scry response fragment data.

  • sig: signature.

  • num: number of fragments.

  • dat: contents.

$peep

+$  peep
  $:  =path
      num=@ud
  ==

Remote scry fragment request.

$wail

+$  wail
  $%  [%0 peep]
  ==

Tagged remote scry request fragment.

$roar

+$  roar
  (tale:pki:jael (pair path (unit (cask))))

Remote scry response message.

A tale:pki:jael is a:

++  tale                               ::  urbit-signed *
  |$  [typ]                            ::  payload mold
  $:  dat=typ                          ::  data
      syg=(map ship (pair life oath))  ::  signatures
  ==                                   ::

Therefore, a $roar looks like:

> *roar:ames
[dat=[p=/ q=~] syg=~]

In dat, for the (pair path (unit (cask))), the path is the remote scry path and the (unit (cask)) contains the value, or is null if there's no value at this path and will never be one (equivalent to the [~ ~] case of a local scry).

$purr

+$  purr
  $:  peep
      meow
  ==

Response packet payload.

$qos

+$  qos
  $~  [%unborn *@da]
  [?(%live %dead %unborn) last-contact=@da]

Quality of service; how is the connection to a peer doing?

  • %live - Peer is ok.

  • %dead - Peer is not responding.

  • %unborn - Peer is sunken.

  • last-contact - Last time Ames heard from the peer, or if %unborn, the time when we first started tracking then.

$ossuary

+$  ossuary
  $:  =next=bone
      by-duct=(map duct bone)
      by-bone=(map bone duct)
  ==

$bone to duct mapping, next is the next bone to map to a duct.

$message-pump-state

+$  message-pump-state
  $:  current=_`message-num`1
      next=_`message-num`1
      unsent-messages=(qeu message-blob)
      unsent-fragments=(list static-fragment)
      queued-message-acks=(map message-num ack)
      =packet-pump-state
  ==

Persistent state for a |message-pump.

  • current- Sequence number of earliest message sent or being sent.

  • next - Sequence number of next message to send.

  • unsent-messages - Messages to be sent after current message.

  • unsent-fragments - Fragments of current message waiting for sending.

  • queued-message-acks - Future message acks to be applied after current.

  • packet-pump-state - State of corresponding |packet-pump.

$static-fragment

+$  static-fragment
  $:  =message-num
      num-fragments=fragment-num
      =fragment-num
      =fragment
  ==

A packet; a fragment of a message and metadata.

$packet-pump-state

+$  packet-pump-state
  $:  next-wake=(unit @da)
      live=(tree [live-packet-key live-packet-val])
      metrics=pump-metrics
  ==

Persistent state for a |packet-pump.

  • next-wake - Last timer we've set, or null.

  • live - Packets in flight; sent but not yet acked.

  • metrics - Congestion control information.

$pump-metrics

+$  pump-metrics
  $:  rto=_~s1
      rtt=_~s1
      rttvar=_~s1
      ssthresh=_10.000
      cwnd=_1
      num-live=@ud
      counter=@ud
  ==

Congestion control state for a |packet-pump.

  • rto - Retransmission timeout.

  • rtt - Roundtrip time estimate, low-passed using EWMA.

  • rttvar - Mean deviation of rtt, also low-passed with EWMA.

  • num-live - How many packets sent, awaiting ack.

  • ssthresh - Slow-start threshold.

  • cwnd - Congestion window; max unacked packets.

$live-packet

+$  live-packet
  $:  key=live-packet-key
      val=live-packet-val
  ==

A packet in flight, as tracked in the $packet-pump-state.

$live-packet-key

+$  live-packet-key
  $:  =message-num
      =fragment-num
  ==

Identifier of a packet in flight.

$live-packet-val

+$  live-packet-val
  $:  packet-state
      num-fragments=fragment-num
      =fragment
  ==

Content and metadata about a packet in flight.

$packet-state

+$  packet-state
  $:  last-sent=@da
      retries=@ud
      skips=@ud
  ==

Sending statistics about a packet in flight.

$message-sink-state

+$  message-sink-state
  $:  last-acked=message-num
      last-heard=message-num
      pending-vane-ack=(qeu [=message-num message=*])
      live-messages=(map message-num partial-rcv-message)
      nax=(set message-num)
  ==

State of a |message-sink to assemble received messages.

  • last-acked - Highest $message-num Ames has fully acknowledged.

  • last-heard - Highest message-num Ames has heard all fragments for.

  • pending-vane-ack - Heard but not processed by local vane.

  • live-messages - Partially received messages.

$partial-rcv-message

+$  partial-rcv-message
  $:  num-fragments=fragment-num
      num-received=fragment-num
      fragments=(map fragment-num fragment)
  ==

A message for which Ames has received some fragments.

  • num-fragments - Total number of fragments in the message.

  • num-received - How many fragments Ames has received so far.

  • fragments - The received fragments themselves.

PreviousAmes CryptographyNextAmes Scry Reference

Last updated 1 day ago