Skip to content

Instantly share code, notes, and snippets.

View sdbondi's full-sized avatar

Stan Bondi sdbondi

View GitHub Profile
@sdbondi
sdbondi / confidential_transfers.md
Last active February 23, 2023 05:32
DAN Confidential transfers

Given account1 owned by $P_1$ (sender) and account2 owned by $P_2$ (receiver) Transfer transaction manifest:

// The sender wallet generates the withdraw_proof by first retrieving the receiver account public key 
let withdraw_proof = global!["withdraw_proof"];
let confidential_resource_addr = global!["confidential_resource_addr"];
let bucket = account1.withdraw(confidential_resource_addr, withdraw_proof);
account2.deposit(bucket); // No authorisation required to deposit
@sdbondi
sdbondi / tari-covenants.md
Last active November 9, 2021 08:09
Covenants on Tari

[DRAFT] Covenants on Tari

Composable covenant rules

convenants field on TransactionOutput containing an ordered list of additional dynamic consensus rules. These rules act as filters for outputs in the aggregate body (either transaction or block). With each rule filtering the output validation set for the next rule. For the transaction/block to be valid, there MUST be at least one output that passes all rules. For a covenant to be secure, it should include rules that either require some secret to produce a passing output, or leverages existing consensus.

## Base Node
6e77da12535e0ed7851761ae6c6729f2dd3ae8050840e8c08e10e279dadfde8a osx/tari_base_node-0.8.10-65fc65a-release.pkg
fa2623588f0891caa39344d4b1b6ca1ba6256fede52b0f7cb96b285a125dff6d linux/tari_base_node-ubuntu-18.04-x64-0.8.10-65fc65a-release.zip

Keybase proof

I hereby claim:

  • I am sdbondi on github.
  • I am stanimal (https://keybase.io/stanimal) on keybase.
  • I have a public key whose fingerprint is 337B 91EF C5F1 027D 8AED F63D 1885 B149 504C 0A64

To claim this, I am signing this object:

@sdbondi
sdbondi / retry.rs
Last active January 30, 2020 07:18
Generic retry stream
use futures::{ready, stream::FusedStream, task::Context, Future, Stream};
use pin_project::{pin_project, project};
use std::{pin::Pin, task::Poll};
use tokio::time::{delay_for, Delay};
pub trait Backoff {
fn calculate_backoff(&self, attempts: usize) -> Duration;
}
#[pin_project]
@sdbondi
sdbondi / async_job_future.rs
Last active January 14, 2019 05:51
First attempt at a future with a call back which runs in it's own thread (Does not compile)
use futures::{Future, Poll, task, Async};
use std::sync::Arc;
use std::sync::mpsc;
use std::sync::mpsc::{Sender, Receiver};
use std::error::Error;
use std::thread;
use std::marker::{Send, Sync};
use std::sync::Mutex;
///

Keybase proof

I hereby claim:

  • I am sdbondi on github.
  • I am stanimal (https://keybase.io/stanimal) on keybase.
  • I have a public key ASDT83RI6sEvIDkVS5fyGYBTjkch9xlt97JC3zAKgRJwDAo

To claim this, I am signing this object:

import {put, call, select} from 'redux-saga/effects';
import {takeEvery} from 'redux-saga';
import feathers from '../feathers';
import createResourceActionCreators from '../actions/resource';
import {resource as resourceActions} from '../actions';
import resourceEndpoints from './endpoints';
const initialOptions = {
pagination: {perPage: 10, page: 1},
[2017-07-31 18:21:14] __rvm_make
__rvm_make ()
{
\make "$@" || return $?
}
current path: /home/stan/.rvm/src/ruby-2.3.4
PATH=/home/stan/.rvm/usr/bin:/home/stan/.rbenv/shims:/home/stan/.rbenv/bin:/home/stan/bin:/home/stan/.local/bin:/home/stan/.bin/google-cloud-sdk/bin:/home/stan/.git-subrepo/lib:/home/stan/.nvm/versions/node/v6.3.1/bin:/home/stan/.bin/jdk1.8.0_77/bin:/home/stan/bin:/home/stan/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/stan/.rvm/bin:/home/stan/.bin:/home/stan/.npm/bin:/home/stan/.n/bin:/home/stan/applications/Android/android-studio/bin:/home/stan/applications/Android/Sdk/platform-tools:/home/stan/applications/Android/Sdk/tools:/usr/local/go/bin:/bin:/usr/local/android-studio/bin:/home/stan/.bin:/home/stan/.bin
command(2): __rvm_make -j8
++ make -j8
CC = gcc
@sdbondi
sdbondi / sendwithus - yeartag
Created June 28, 2017 11:33
Sendwithus current year format tag
{{ iso_date|iso8601_to_time|datetimeformat('%Y') }}