Skip to content

Instantly share code, notes, and snippets.

@ilap
ilap / Playground.hs
Last active Oct 4, 2021
Plutus Playground Smart Contract
View Playground.hs
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeFamilies #-}
@ilap
ilap / Playground.hs
Created Oct 3, 2021
Plutus Playground Smart Contract
View Playground.hs
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeFamilies #-}
@ilap
ilap / Playground.hs
Last active Oct 2, 2021
Plutus Playground Smart Contract
View Playground.hs
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeFamilies #-}
@ilap
ilap / get_hydra_build.md
Last active Sep 13, 2021
Retrieve Hydra Build based on Git tag
View get_hydra_build.md
@ilap
ilap / standalone_gLiveView.md
Last active Aug 4, 2021
Standalone gLiveView
View standalone_gLiveView.md

Prerequisities

You must be able to run ss or lsof as root to gather the node-s PID in their ouput, as I HIGHLY DO NOT RECOMMEND running a node and this script as root.

The easiest way is just add simmilar entries as the following into the /etc/sudoers or create a file under /etc/sudoers.d/

The /etc/sudoers example, but pls ensure that the path to those files are correct:

User_Alias SPO=spo,ahtn,shmn
@ilap
ilap / Playground.hs
Last active Feb 7, 2021
Plutus Playground Smart Contract
View Playground.hs
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE TemplateHaskell #-}
import Control.Applicative (Applicative (pure))
import Control.Monad (void)
import Language.Plutus.Contract
import qualified Language.Plutus.Contract.Constraints as Constraints
import qualified Language.Plutus.Contract.Typed.Tx as Typed
@ilap
ilap / byron_recovery.md
Last active Feb 27, 2021
ByronRevovery
View byron_recovery.md

Explanation

USE EVERYTHING BELOW AT YOUR OWN RISKS!

A Cardano community member has lost one word of his the 12-words menomic/"recovery phrase", and he would like to recover his wallet from these 11 words.

It is be possible based on the following assumptions:

  • he knows the address the ADA is stored (he knows)
  • the order of the 11 words is correct
    • if it's not correct then it's would need around 11! * 1550 = 60bn tries i.e. 1700 years:(.
@ilap
ilap / CardanoPoolRankinginDaedalus.md
Last active Jul 4, 2021
Cardano Pool Ranking in Daedalus
View CardanoPoolRankinginDaedalus.md

Cardano Pool Ranking in Daedalus

DISCLAIMER: The following example is based on the Chapter 4.3 and 5.6 in latest design spec and the Ranking Specification. But it seems that the ranking mechanism specified in the Design Specification, and explained below, is not fully implemented and/or enabled or I missed some of the details of the spec (more realistic assumption). Also, I have not checked what is the difference between the design doc and the current implementation of the haskell code to check if there is any difference, or I misinterpreted some of the both sources (design doc, haskell code). Anyway, I will check the code when I have some spare time.

UPDATED 09/23/2020

Layman explanation

The pool ranking in wallet is based on the stake the user intend to delegate and the expected `

@ilap
ilap / shelley_staking_ledger_addr_gen.md
Last active Oct 14, 2021
Extracting Pool Staking keys from Ledger wallet
View shelley_staking_ledger_addr_gen.md

Introduction for Ledger wallet based addresses

DISCLAIMER: NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK

UPDATED: 16:51pm AEST 09/Aug/2020

There are two keypairs that are required to register a pool:

  1. reward account (costs and rewards) and
  2. owner stake (pledge) keypair.
@ilap
ilap / shelley_staking_gen.md
Last active Sep 16, 2021
Extracting Pool Staking keys from Daedalus/Yoroi wallet
View shelley_staking_gen.md

Intorduction

DISCLAIMER: NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK

UPDATED: 14:08am AEST 29/Sept/2020, The IDX was incorrectly used. Fixed now

There are two keypairs that are required to register a pool:

  1. reward account (costs and rewards) and
  2. owner stake (pledge) keypair.