Christopher Goes
Research Day 2023
(thanks Andrew Miller!)
(thanks Xyn from Flashbots!)
Bonus credit 1: where is this from?
Bonus credit 2: where is this from?
type Commitment = Commitment -> Strategy
commitment =
if rand() < 0.01 then Cooperate else
if other(me) = Cooperate then Cooperate else Defect
type Commitment = Set Strategy -> Bool
commitment (Defect, Defect) = True
commitment (Cooperate, Cooperate) = True
commitment _ = False
data Change = Created | Consumed
data ResourceLogic = ResourceLogic {
predicate :: PartialTx -> Change -> Bool,
arguments :: ByteString
}
data Resource = Resource {
logic :: ResourceLogic,
prefix :: ByteString,
suffix :: Nonce,
quantity :: Integer,
value :: ByteString
}
data PartialTx = PartialTx {
consumed :: Set Resource,
created :: Set Resource,
extradata :: ByteString
}
valid ptx@(PartialTx consumed created _) =
all (map (\r -> logic r ptx Consumed) consumed) &&
all (map (\r -> logic r ptx Created) created)
type Balance = [(ByteString, Integer)]
denomination :: Resource -> ByteString
denomination (Resource logic prefix _ _ _) =
hash (logic, prefix)
delta :: Resource -> Balance
delta r = [(denomination r, quantity r)]
balanced :: PartialTx -> Bool
balanced ptx@(PartialTx consumed created _) =
sum (map delta created) - sum (map delta consumed) = 0
a
is valid and b
is valid, compose(a, b)
is also valid.PartialTx
, or by balance)x
, you can know any f(x)
Find me: