Update task list.

[?]
Feb 20, 2015, 12:18 AM
EZQG2APB36DDMIAYDPPDGOIXOD7K2RZZSGC2NKGZIHB2HZBTW7EQC

Dependencies

  • [2] 2G3GNDDU Event logging is now functioning in postgres.
  • [3] Z7KS5XHH Very WIP. Wow.
  • [4] TNR3TEHK Switch to Postgres + snaplet arch compiles.
  • [5] T44T2PDL Rename trust.txt to README.md
  • [6] W35DDBFY Factor common JSON conversions up into client lib module.
  • [7] GKGVYBZG Added JSON serialization to TimeLog
  • [8] NVOCQVAS Initial failing tests.
  • [9] TLQ72DSJ Lenses, sqlite-simple
  • [10] EPOYLP7O A little .gitignore cleanup.
  • [11] A2J7B4SC Initial impl of depreciation function.
  • [12] ADMKQQGC Initial empty Snap project.
  • [13] NTPC7KJE Trivial changes, feature scratchpad.
  • [14] 75N3UJ4J More progression toward lenses.
  • [15] QO4NFWIY Added sample config file.
  • [16] 5W5M56VJ Move library code to 'lib'
  • [17] EQXRXRZD Changed to use tasty instead of test-framework
  • [18] AXKKXBWN Initial attempt at writing down my ideas for a company based on trust.
  • [19] N4NDAZYT Initial implementation of payouts.
  • [20] OBFPJS2G Project successfully builds and tests under nix.
  • [21] 2Y2QZFVF Switch to more modern cabal2nix-based workflow.
  • [22] PBD7LZYQ Postgres & auth are beginning to function.
  • [23] I2KHGVD4 Require project permissions for access to most data.
  • [24] WO2MINIF Auctions now compile!
  • [25] 7DBNV3GV Initial, stack-based impl of time log event reduction.
  • [26] XMONXALY Fix sqlite/readWorkIndex table name
  • [27] 4IQVQL4T Added client for payouts endpoint.
  • [28] RSEB2NFG Replacing Snap with Scotty.
  • [29] EMVTF2IW WIP moving back to snap.
  • [30] Y35QCWYW Minor improvement in WorkIndex type to eliminate duplicated information.
  • [31] LAROLAYU WIP
  • [32] 64C6AWH6 Rename Ananke -> Quixotic, project reboot.
  • [33] 45AI46JN Move readme to inception.md
  • [34] IZEVQF62 Work in progress replacing sqlite with postgres.
  • [35] BROSTG5K Beginning of modularization of server.

Change contents

  • file deletion: TASKS (----------)
    [3.2][3.1532:1561](),[3.1561][3.1:1]()
    General:
    * Convert SQLite code to use Persistent
    User Interface:
    * Login
    * Evaluate OAuth options
    * Invite
    * Record who invited a participant.
    * When a new participant is invited to the project, allow them to create an account.
    * Profile
    * Timeline - Yours
    * Log Start
    * Log Stop
    * Amend Event
    * Amend operations targeting events older than <commit_delay hours> fail.
    * Future work - garnish/reimburse based approach?
    * Payouts
    * History of payouts (read from blockchain?)
    * Projected payout given current data
    * Voting
    * List Proposals
    * Create Proposal
    * Options to be considered
    * Closing date
    * Vote
    * Resource Pooling
    * Create Resource Pool
    * Describe resource need
    * Base resource award set by socialized vote?
    * Voting on continuous values?
    * Set resource contribution timeline
    * Solicit/Suggest resource acquisition designee (& vote)
    * Escrow of resource acquisition contributions.
    * Resource award bidding?
    * In case of oversubscription, award is reduced by a function of the oversubscription amount.
    * "Test Oversubscription" functionality.
    * Read blockchain transactions; when a payment is observed, distribute it to participants.
    * Adjust work index reader to only read work index entries older than <commit_delay hours>.
    * Tabulate votes & randomly pick from weighted distribution.
    * Resource pool awarding
    Payouts Service
    * BTC address alias chains (in case new payouts should go elsewhere)
    * Update Payout Address
    - authenticate by asking the user to sign and broadcast a small txn with a specific
    - amount from the old address to the new address
    - user creates account & provides payout address
    - inviting user asked to sign a txn that transfers a specific amount of btc from their
    - current payout address to the invitee's payout address
  • file addition: TASKS.md (----------)
    [3.2]
    Guiding Principle:
    Trust in your collaborators is the foremost design principle. Any attempt to
    inhibit abuse or fraud within a company will ultimately be circumventable, so
    it's more important to provide features that will be useful to friendly actors.
    Any feature that can be used to retroactively punish a malicious actor can also
    be used to abuse a friendly but unpopular actor, and so should be avoided. The
    correct way to exclude a malicious actor is to fork the company to exclude that
    actor.
    Design Goals:
    * Do not discard information. Mutable caches of state are fine, but
    retain all information necessary to reproduce both the current state and
    all prior states of the cache.
    * Timestamp EVERYTHING.
    * Keep a cryptographically verified audit trail.
    * Use cryptographic signatures for authentication of all requests to secured
    resources.
    Library:
    * Invite
    * When a new participant is invited to the project, allow them to create an account.
    - user creates account ands provides initial payout address
    - inviting user asked to sign a txn that transfers a specific amount of btc from their
    current payout address to the invitee's payout address as confirmation of
    the invitation
    * Timeline
    * Amend Event
    * Amend operations targeting events older than <commit_delay hours> fail.
    * MAYBE garnish/reimburse based approach?
    * Secure the transaction log via inclusion of periodic hashes of the log
    into the public blockchain?
    * User
    * Add public keys that can be used to sign requests. How does this interact
    with certificate-based auth from browsers? Require openpgpjs?
    * Payout Address Update
    - authenticate by asking the user to sign and broadcast a small txn with a specific
    amount from the old address to the new address
    * Payouts
    * Payouts should not include events younger than <commit_delay hours> to permit amends.
    * Find current verified address for each payout.
    * History of payouts (read from blockchain?)
    * Include hours won in resource auction - requires confirmation that contribution
    was actually made (observed in the confirmed blockchain)
    * Resource Pooling
    * Resource auction bids should include the source address which will be used in the CoinJoin txn.
    * Create election for resource acquisition designee
    * Elections
    * Create Election
    - Options to be considered
    - Closing date
    * List Proposals
    * Record Vote
    Webserver:
    * Login
    * Evaluate OpenID options
    * Companion Creation
    * Require user to provide the PGP public key that will be used to authenticate requests
    * Authentication
    * Require bodies of all
    * Timeline
    * Amend Event
    Payouts Service:
    * Read blockchain transactions
    * Invitation validation
    * Payout Address Update validation
    * When a payment is observed, distribute it to participants.
    * When a resource acquisition CoinJoin is observed, record time awards
    * Elections
    * Close voting window
    * Tabulate votes & randomly pick winner from weighted distribution
    * Record & announce winning option
    * Resource Pooling
    * Finalize resource pooling auction
    * Create CoinJoin transaction to award BTC to the resource acquisition designee
    * Notify auction winners so that input addresses & signatures may be collected.
  • replacement in lib/Quixotic/Database/PostgreSQL.hs at line 45
    [3.1646][3.1646:1715]()
    workEventParser = WorkEvent <$> fieldWith eventTypeParser <*> field
    [3.1646]
    [3.1715]
    workEventParser = WorkEvent <$> fieldWith eventTypeParser <*> field <*> field
  • replacement in lib/Quixotic/Database/PostgreSQL.hs at line 117
    [3.3216][3.413:523]()
    "INSERT INTO work_events (project_id, user_id, btc_addr, event_type, event_time) VALUES (?, ?, ?, ?, ?)"
    [3.3216]
    [3.523]
    "INSERT INTO work_events (project_id, user_id, btc_addr, event_type, event_time, event_meta) \
    \VALUES (?, ?, ?, ?, ?, ?)"
  • replacement in lib/Quixotic/Database/PostgreSQL.hs at line 120
    [3.538][3.3321:3340](),[3.3321][3.3321:3340]()
    , a ^. address
    [3.538]
    [3.3340]
    , a ^. _BtcAddr
  • edit in lib/Quixotic/Database/PostgreSQL.hs at line 123
    [3.3399]
    [3.3399]
    , e ^. eventMeta
  • replacement in lib/Quixotic/Database/PostgreSQL.hs at line 175
    [3.240][3.339:427](),[3.5055][3.339:427]()
    (user' ^. (username._UserName), user' ^. (userAddress.address), user' ^. userEmail)
    [3.240]
    [3.5140]
    (user' ^. (username._UserName), user' ^. (userAddress._BtcAddr), user' ^. userEmail)
  • replacement in lib/Quixotic/Json.hs at line 20
    [3.2143][3.654:690](),[3.654][3.654:690]()
    toJSON $ mapKeys (^. address) p
    [3.2143]
    [3.484]
    toJSON $ mapKeys (^. _BtcAddr) p
  • replacement in lib/Quixotic/TimeLog.hs at line 10
    [3.93][3.3595:3620]()
    , eventType, eventTime
    [3.93]
    [3.93]
    , eventType, eventTime, eventMeta
  • edit in lib/Quixotic/TimeLog.hs at line 23
    [3.3656]
    [3.65]
    import Data.Aeson as A
  • edit in lib/Quixotic/TimeLog.hs at line 46
    [3.4037]
    [3.4037]
    -- Permit the inclusion of arbitrary JSON data that may be refactored into
    -- proper typed fields in the future.
    , _eventMeta :: A.Value
  • replacement in lib/Quixotic/TimeLog.hs at line 110
    [3.772][3.4780:4899]()
    reduceToIntervals ((LogEntry addr (WorkEvent StopWork end')) : (LogEntry _ (WorkEvent StartWork start')) : xs, acc) =
    [3.772]
    [3.2859]
    reduceToIntervals ((LogEntry addr (WorkEvent StopWork end' _)) : (LogEntry _ (WorkEvent StartWork start' _)) : xs, acc) =
  • replacement in lib/Quixotic.hs at line 10
    [3.2593][3.1839:1932]()
    newtype BtcAddr = BtcAddr { _address :: Text } deriving (Show, Eq, Ord)
    makeLenses ''BtcAddr
    [3.2593]
    [3.1581]
    newtype BtcAddr = BtcAddr Text deriving (Show, Eq, Ord)
    makePrisms ''BtcAddr
  • replacement in lib/Quixotic.hs at line 14
    [3.2130][3.1239:1310](),[3.1239][3.1239:1310]()
    parseBtcAddr = Just . BtcAddr -- this will be changed to do validation
    [3.2130]
    [3.2763]
    parseBtcAddr = Just . BtcAddr -- FIXME: perform validation
  • edit in server/Quixotic/Snaplet/WorkLog.hs at line 8
    [3.5625]
    [3.5641]
    import qualified Data.Map as M
  • edit in server/Quixotic/Snaplet/WorkLog.hs at line 28
    [3.6005]
    [3.6005]
    requestBody <- readRequestBody 4096
  • replacement in server/Quixotic/Snaplet/WorkLog.hs at line 30
    [3.6042][3.6042:6087]()
    let workEvent = WorkEvent evType timestamp
    [3.6042]
    [3.4128]
    let em = maybe A.Null id $ A.decode requestBody
    workEvent = WorkEvent evType timestamp em
  • replacement in server/Quixotic/Snaplet/WorkLog.hs at line 44
    [3.6581][3.3566:3649]()
    writeLBS . A.encode . fmap (fmap IntervalJ) $ mapKeysWith (++) (^. address) widx
    [3.6581]
    [3.6631]
    writeLBS . A.encode . fmap (fmap IntervalJ) $ M.mapKeysWith (++) (^._BtcAddr) widx
  • replacement in sql/quixotic-pg.sql at line 28
    [3.4371][2.1816:1863]()
    event_time timestamp with time zone not null
    [3.4371]
    [3.4421]
    event_time timestamp with time zone not null,
    event_meta json not null