-
-
-
+
+ {items.slice(1).map((it, k) => (
+
+ ))}
+
{items.map((it, i) => {
- const x = 70 + i * 80;
+ const x = xOf(i);
const above = i % 2 === 0;
const c = it.s === 'done' ? done : it.s === 'prog' ? prog : ink;
return (
-
- {it.s === 'done' ? : null}
- {it.s === 'prog' ? : null}
-
- {it.l}
+
+
+ {it.s === 'done' ? : null}
+ {it.s === 'prog' ? : null}
+
+
+
+ {it.l}
+
);
})}
@@ -388,8 +604,10 @@ export const GigaRoadmapTrack = () => {
export const GigaLanesAndCuts = () => {
const ink = 'currentColor';
const accent = 'var(--sei-maroon-50)';
- const box = { fill: ink, fillOpacity: 0.05, stroke: ink, strokeOpacity: 0.35, strokeWidth: 1 };
+ const hairline = 'rgba(128, 128, 128, 0.25)';
const lanes = [0, 1, 2];
+ const laneY = (i) => 74 + i * 72;
+ const boxX = (j) => 124 + j * 96;
const math = 'var(--sei-font-math)';
const tex = (expr, size, rest) => {
const drop = size * 0.24;
@@ -403,126 +621,989 @@ export const GigaLanesAndCuts = () => {
});
return <>{parts}{rest ? {rest} : null}>;
};
- return (
-
-
-
-
-
-
-
-
-
-
-
-
- committing a tip implicitly commits everything behind it
- {lanes.map((i) => (
-
-
- V{i + 1}
- {[0, 1, 2, 3].map((j) => (
-
-
- pos {j}
- batch
- {j < 3 ? : null}
-
- ))}
- tip
-
- ))}
- arrows: parentRef hash-chains each proposal to its predecessor
-
-
-
- paper: {tex('f + 1', 10.5)} replicas
- stake-weighted in implementation
-
-
-
-
- cut = [tip 1, tip 2, tip 3]
-
-
- committed in one slot
- Prepare, then Commit
-
- missing batch data is fetched after commit,
- off the critical path
-
-
-
Each validator will chain batches into its own lane. The whitepaper uses f + 1 replica votes for availability. The implementation applies stake-weighted thresholds.
-
- );
-};
+ const steps = [
+ {
+ title: 'Stream lanes in parallel',
+ text: <>Each validator chains batches of transactions, called cars, into its own lane. A proposal is ⟨pos, batch, parentRef⟩, and parentRef is the hash of the previous proposal in the same lane. No lane waits for consensus or for another lane.>
+ },
+ {
+ title: 'Certify each batch',
+ text: <>Validators that receive a proposal check that it extends the lane and return a signed vote. With f + 1 matching votes, the proposer assembles a Proof of Availability (PoA). Under the whitepaper's assumptions, at least one honest replica then holds the data. The implementation applies stake-weighted thresholds.>
+ },
+ {
+ title: 'The newest certified proposal is the tip',
+ text: "Lanes keep growing. The latest proposal in a lane that holds a PoA is the lane's tip, and certifying it attests every earlier proposal in that lane. V3's newest proposal has no PoA yet, so V3's tip stays one position back."
+ },
+ {
+ title: 'Commit a cut of tips',
+ text: "The slot's leader bundles every lane's latest certified tip into a cut. Replicas vote in a Prepare phase and then a Commit phase, so one slot commits the cut. They vote on compact certificates, not on full batches."
+ },
+ {
+ title: 'Everything behind the cut commits',
+ text: "Lanes are hash-chained, so committing a tip commits everything behind it, and one decision can finalize many blocks of data. A replica that is missing batch data fetches it after commit, off the critical path. V3's uncertified proposal waits for a later cut."
+ }
+ ];
+ const last = steps.length - 1;
-export const GigaSlotPipeline = () => {
- const ink = 'currentColor';
- const accent = 'var(--sei-maroon-50)';
- const slots = [0, 1, 2];
- const math = 'var(--sei-font-math)';
- const tex = (expr, size, rest) => {
- const drop = size * 0.24;
- let low = false;
- const parts = expr.match(/_\{[^}]*\}|_[A-Za-z0-9]|[A-Za-z]+|[0-9.]+|[-+=]|[^\sA-Za-z0-9_.+=-]/g).map((tok, i) => {
- const sub = tok[0] === '_';
- const body = sub ? tok.replace(/^_\{?|\}$/g, '') : /^[-+=]$/.test(tok) ? '\u2005' + tok.replace('-', '\u2212') + '\u2005' : tok;
- const shift = sub ? drop : low ? -drop : undefined;
- low = sub;
- return {body} ;
- });
- return <>{parts}{rest ? {rest} : null}>;
- };
- return (
-
-
-
-
-
-
-
-
- {slots.map((i) => {
- const x = 130 + i * 105;
- const y = 46 + i * 50;
- return (
-
- slot {tex(i > 0 ? 's+' + i : 's', 11)}
-
- Prepare (PrepareQC)
-
- Commit (CommitQC)
-
- );
- })}
-
- next slot starts once the Prepare message for {tex('s', 9.5)} is seen
-
-
- 1 round trip
-
- +0.5 effective
- steady state: one cut per 1.5 round trips
-
-
-
Slots will overlap: replicas will begin slot s + 1 as soon as they see the Prepare message for slot s . The target is an effective steady-state cadence of one committed cut per 1.5 network round trips, not per-transaction latency.
-
- );
-};
+ const [step, setStep] = useState(0);
+ const [playing, setPlaying] = useState(false);
+ const [reduced, setReduced] = useState(false);
+ const rootRef = useRef(null);
+ const playingRef = useRef(false);
+ const auto = useRef({ armed: true, resume: false });
+ playingRef.current = playing;
+
+ useEffect(() => {
+ if (typeof window === 'undefined' || !window.matchMedia) return undefined;
+ const query = window.matchMedia('(prefers-reduced-motion: reduce)');
+ const update = () => setReduced(query.matches);
+ update();
+ if (!query.addEventListener) return undefined;
+ query.addEventListener('change', update);
+ return () => query.removeEventListener('change', update);
+ }, []);
+
+ useEffect(() => {
+ if (!playing) return undefined;
+ const timer = setTimeout(() => setStep(step >= last ? 0 : step + 1), step >= last ? 3000 : step === 0 ? 800 : 2000);
+ return () => clearTimeout(timer);
+ }, [playing, step]);
+
+ useEffect(() => {
+ const node = rootRef.current;
+ if (!node || typeof IntersectionObserver === 'undefined') return undefined;
+ const observer = new IntersectionObserver(
+ (entries) => {
+ const entry = entries[entries.length - 1];
+ if (entry.intersectionRatio >= 0.3) {
+ const reduceMotion = window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches;
+ if ((auto.current.armed && !reduceMotion) || auto.current.resume) setPlaying(true);
+ auto.current = { armed: false, resume: false };
+ } else if (!entry.isIntersecting && playingRef.current) {
+ setPlaying(false);
+ auto.current = { armed: false, resume: true };
+ }
+ },
+ { threshold: [0, 0.35] }
+ );
+ observer.observe(node);
+ return () => observer.disconnect();
+ }, []);
+
+ const go = (next) => {
+ auto.current = { armed: false, resume: false };
+ setPlaying(false);
+ setStep(Math.max(0, Math.min(last, next)));
+ };
+ const togglePlay = () => {
+ auto.current = { armed: false, resume: false };
+ if (playing) {
+ setPlaying(false);
+ return;
+ }
+ setStep(step >= last ? 0 : step + 1);
+ setPlaying(true);
+ };
+
+ const ease = 'cubic-bezier(0.4, 0, 0.2, 1)';
+ const paint = reduced ? 'none' : 'fill 400ms ease, stroke 400ms ease, fill-opacity 400ms ease, stroke-opacity 400ms ease';
+ const shown = (visible, delay) => ({ opacity: visible ? 1 : 0, transition: reduced ? 'none' : `opacity 400ms ease ${visible ? delay || 0 : 0}ms` });
+ const ghost = (pending) => ({ opacity: pending ? 1 : 0, transition: reduced ? 'none' : 'opacity 300ms ease' });
+ const slideIn = (visible, delay) => ({
+ opacity: visible ? 1 : 0,
+ transform: visible ? 'translate(0px, 0px)' : 'translate(-10px, 0px)',
+ transition: reduced ? 'none' : `transform 500ms ${ease} ${visible ? delay || 0 : 0}ms, opacity 350ms ease ${visible ? delay || 0 : 0}ms`
+ });
+ const pop = (visible, delay) => ({
+ opacity: visible ? 1 : 0,
+ transformBox: 'fill-box',
+ transformOrigin: 'center',
+ transform: visible ? 'scale(1)' : 'scale(0.3)',
+ transition: reduced ? 'none' : `transform 350ms ${ease} ${visible ? delay || 0 : 0}ms, opacity 250ms ease ${visible ? delay || 0 : 0}ms`
+ });
+ const arrives = (j) => (j < 3 ? 0 : 2);
+ const certified = (i, j) => (j < 3 ? step >= 1 : i < 2 && step >= 2);
+ const waiting = (i, j) => i === 2 && j === 3;
+ const tipOf = (i) => (step >= 2 && i < 2 ? 3 : 2);
+
+ const primaryButton = {
+ backgroundColor: 'var(--sei-maroon-100)',
+ color: '#ffffff',
+ fontFamily: 'var(--sei-font-mono)',
+ fontSize: '11px',
+ letterSpacing: '0.04em',
+ textTransform: 'uppercase',
+ padding: '6px 14px',
+ borderRadius: '6px',
+ minWidth: '76px',
+ cursor: 'pointer'
+ };
+ const secondaryButton = (disabled) => ({
+ backgroundColor: 'rgba(128, 128, 128, 0.14)',
+ fontFamily: 'var(--sei-font-mono)',
+ fontSize: '11px',
+ letterSpacing: '0.04em',
+ textTransform: 'uppercase',
+ padding: '6px 12px',
+ borderRadius: '6px',
+ opacity: disabled ? 0.4 : 1,
+ cursor: disabled ? 'default' : 'pointer'
+ });
+
+ return (
+
+
+
+
+
+
+
+
+
+
+
+
+ = 4)} />
+ = 4, 200)}>committing a tip implicitly commits everything behind it
+
+ {lanes.map((i) => (
+
+
+ V{i + 1}
+ {[0, 1, 2, 3].map((j) => {
+ const x = boxX(j);
+ const y = laneY(i);
+ const tip = step >= 1 && j === tipOf(i);
+ return (
+
+
+ = arrives(j), j < 3 ? j * 260 + i * 90 : 150 + i * 160)}>
+ {j > 0 ? : null}
+
+ pos {j}
+ {waiting(i, j) ? 'no PoA yet' : 'batch'}
+
+
+
+
+
+
+ );
+ })}
+ = 1 ? 1 : 0, transform: `translate(${boxX(tipOf(i)) + 36}px, 0px)`, transition: reduced ? 'none' : `opacity 400ms ease ${step >= 1 ? 400 : 0}ms, transform 500ms ${ease} ${step >= 2 ? 750 : 0}ms` }}>
+ tip
+
+
+ ))}
+ arrows: parentRef hash-chains each proposal to its predecessor
+
+
+ = 1)}>
+
+
+
+ Proof of Availability: {tex('f + 1', 10)} replica votes
+ in the whitepaper, stake-weighted in the implementation
+
+
+ = 3)} />
+
+ = 3, 250)}>
+
+
+ cut = [tip 1, tip 2, tip 3]
+ committed in one slot
+ Prepare, then Commit
+
+
+
+ = 4, 400)}>
+
+ missing batch data is fetched after commit,
+ off the critical path
+
+
+
+
+
+
+
+ Step {step + 1} of {steps.length}
+
+
{steps[step].title}
+
{steps[step].text}
+
+
+ go(step - 1)} disabled={step === 0} aria-label="Previous step" className="text-neutral-800 dark:text-neutral-200" style={secondaryButton(step === 0)}>
+ Back
+
+ = last ? 'Replay from the start' : 'Play'} style={primaryButton}>
+ {playing ? 'Pause' : step >= last ? 'Replay' : 'Play'}
+
+ go(step + 1)} disabled={step === last} aria-label="Next step" className="text-neutral-800 dark:text-neutral-200" style={secondaryButton(step === last)}>
+ Next
+
+
+
+
+
+ {steps.map((item, i) => (
+ go(i)}
+ aria-label={`Step ${i + 1}: ${item.title}`}
+ aria-current={i === step ? 'step' : undefined}
+ style={{
+ width: i === step ? 22 : 8,
+ height: 8,
+ borderRadius: 9999,
+ backgroundColor: i <= step ? accent : 'rgba(128, 128, 128, 0.35)',
+ transition: reduced ? 'none' : 'width 300ms ease, background-color 300ms ease',
+ cursor: 'pointer'
+ }}
+ />
+ ))}
+
+
+
Each validator will chain batches into its own lane. The whitepaper uses f + 1 replica votes for availability. The implementation applies stake-weighted thresholds.
+
+ );
+};
+
+export const GigaSlotPipeline = () => {
+ const ink = 'currentColor';
+ const accent = 'var(--sei-maroon-50)';
+ const hairline = 'rgba(128, 128, 128, 0.25)';
+ const slots = [0, 1, 2];
+ const math = 'var(--sei-font-math)';
+ const tex = (expr, size, rest) => {
+ const drop = size * 0.24;
+ let low = false;
+ const parts = expr.match(/_\{[^}]*\}|_[A-Za-z0-9]|[A-Za-z]+|[0-9.]+|[-+=]|[^\sA-Za-z0-9_.+=-]/g).map((tok, i) => {
+ const sub = tok[0] === '_';
+ const body = sub ? tok.replace(/^_\{?|\}$/g, '') : /^[-+=]$/.test(tok) ? '\u2005' + tok.replace('-', '\u2212') + '\u2005' : tok;
+ const shift = sub ? drop : low ? -drop : undefined;
+ low = sub;
+ return {body} ;
+ });
+ return <>{parts}{rest ? {rest} : null}>;
+ };
+ const steps = [
+ {
+ title: 'Prepare a cut',
+ text: <>The slot's leader bundles the latest certified tips into a cut proposal. Replicas validate the PoAs and broadcast prepare votes. At n − f votes, the votes form a PrepareQC.>
+ },
+ {
+ title: 'Commit it',
+ text: <>Replicas exchange commit votes over the PrepareQC. In the whitepaper's replica-count model, a CommitQC formed from n − f votes finalizes the cut.>
+ },
+ {
+ title: 'Start the next slot early',
+ text: <>Slots overlap. As soon as replicas see the Prepare message for slot s , they can begin slot s + 1 . The next leader can propose while the previous cut is still in its commit phase.>
+ },
+ {
+ title: 'Reach the steady-state cadence',
+ text: 'With quadratic communication and pipelining, the design targets an effective steady-state cadence of one committed cut per 1.5 network round trips. Tendermint uses three full rounds. This is a throughput cadence, not a per-transaction finality guarantee.'
+ }
+ ];
+ const last = steps.length - 1;
+
+ const [step, setStep] = useState(0);
+ const [playing, setPlaying] = useState(false);
+ const [reduced, setReduced] = useState(false);
+ const rootRef = useRef(null);
+ const playingRef = useRef(false);
+ const auto = useRef({ armed: true, resume: false });
+ playingRef.current = playing;
+
+ useEffect(() => {
+ if (typeof window === 'undefined' || !window.matchMedia) return undefined;
+ const query = window.matchMedia('(prefers-reduced-motion: reduce)');
+ const update = () => setReduced(query.matches);
+ update();
+ if (!query.addEventListener) return undefined;
+ query.addEventListener('change', update);
+ return () => query.removeEventListener('change', update);
+ }, []);
+
+ useEffect(() => {
+ if (!playing) return undefined;
+ const timer = setTimeout(() => setStep(step >= last ? 0 : step + 1), step >= last ? 3000 : step === 0 ? 800 : 2000);
+ return () => clearTimeout(timer);
+ }, [playing, step]);
+
+ useEffect(() => {
+ const node = rootRef.current;
+ if (!node || typeof IntersectionObserver === 'undefined') return undefined;
+ const observer = new IntersectionObserver(
+ (entries) => {
+ const entry = entries[entries.length - 1];
+ if (entry.intersectionRatio >= 0.3) {
+ const reduceMotion = window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches;
+ if ((auto.current.armed && !reduceMotion) || auto.current.resume) setPlaying(true);
+ auto.current = { armed: false, resume: false };
+ } else if (!entry.isIntersecting && playingRef.current) {
+ setPlaying(false);
+ auto.current = { armed: false, resume: true };
+ }
+ },
+ { threshold: [0, 0.35] }
+ );
+ observer.observe(node);
+ return () => observer.disconnect();
+ }, []);
+
+ const go = (next) => {
+ auto.current = { armed: false, resume: false };
+ setPlaying(false);
+ setStep(Math.max(0, Math.min(last, next)));
+ };
+ const togglePlay = () => {
+ auto.current = { armed: false, resume: false };
+ if (playing) {
+ setPlaying(false);
+ return;
+ }
+ setStep(step >= last ? 0 : step + 1);
+ setPlaying(true);
+ };
+
+ const ease = 'cubic-bezier(0.4, 0, 0.2, 1)';
+ const shown = (visible, delay) => ({ opacity: visible ? 1 : 0, transition: reduced ? 'none' : `opacity 400ms ease ${visible ? delay || 0 : 0}ms` });
+ const ghost = (pending) => ({ opacity: pending ? 1 : 0, transition: reduced ? 'none' : 'opacity 300ms ease' });
+ const grow = (on, delay) => ({
+ transformBox: 'fill-box',
+ transformOrigin: 'left center',
+ transform: `scaleX(${on ? 1 : 0})`,
+ transition: reduced ? 'none' : on ? `transform 650ms ${ease} ${delay}ms` : 'transform 250ms ease'
+ });
+ const label = (on, delay) => ({ opacity: on ? 1 : 0, transition: reduced ? 'none' : on ? `opacity 300ms ease ${delay + 350}ms` : 'opacity 200ms ease' });
+ const prepareOn = (i) => i === 0 || step >= 2;
+ const commitOn = (i) => (i === 0 ? step >= 1 : step >= 2);
+ const prepareAt = (i) => (i === 0 ? 0 : (i - 1) * 700);
+ const commitAt = (i) => (i === 0 ? 0 : (i - 1) * 700 + 500);
+
+ const primaryButton = {
+ backgroundColor: 'var(--sei-maroon-100)',
+ color: '#ffffff',
+ fontFamily: 'var(--sei-font-mono)',
+ fontSize: '11px',
+ letterSpacing: '0.04em',
+ textTransform: 'uppercase',
+ padding: '6px 14px',
+ borderRadius: '6px',
+ minWidth: '76px',
+ cursor: 'pointer'
+ };
+ const secondaryButton = (disabled) => ({
+ backgroundColor: 'rgba(128, 128, 128, 0.14)',
+ fontFamily: 'var(--sei-font-mono)',
+ fontSize: '11px',
+ letterSpacing: '0.04em',
+ textTransform: 'uppercase',
+ padding: '6px 12px',
+ borderRadius: '6px',
+ opacity: disabled ? 0.4 : 1,
+ cursor: disabled ? 'default' : 'pointer'
+ });
+
+ return (
+
+
+
+
+
+
+
+
+
+ {slots.map((i) => {
+ const x = 130 + i * 105;
+ const y = 46 + i * 50;
+ return (
+
+ slot {tex(i > 0 ? 's+' + i : 's', 11)}
+
+
+
+ Prepare (PrepareQC)
+
+ Commit (CommitQC)
+
+ );
+ })}
+ = 2)}>
+
+ slot {tex('s+1', 9.5)} starts once the Prepare message for slot {tex('s', 9.5)} is seen
+
+
+ = 3)}>
+
+ 1 round trip
+
+ = 3, 350)}>
+
+ +0.5 effective
+
+ = 3, 700)}>steady state: one cut per 1.5 round trips
+
+
+
+
+
+
+ Step {step + 1} of {steps.length}
+
+
{steps[step].title}
+
{steps[step].text}
+
+
+ go(step - 1)} disabled={step === 0} aria-label="Previous step" className="text-neutral-800 dark:text-neutral-200" style={secondaryButton(step === 0)}>
+ Back
+
+ = last ? 'Replay from the start' : 'Play'} style={primaryButton}>
+ {playing ? 'Pause' : step >= last ? 'Replay' : 'Play'}
+
+ go(step + 1)} disabled={step === last} aria-label="Next step" className="text-neutral-800 dark:text-neutral-200" style={secondaryButton(step === last)}>
+ Next
+
+
+
+
+
+ {steps.map((item, i) => (
+ go(i)}
+ aria-label={`Step ${i + 1}: ${item.title}`}
+ aria-current={i === step ? 'step' : undefined}
+ style={{
+ width: i === step ? 22 : 8,
+ height: 8,
+ borderRadius: 9999,
+ backgroundColor: i <= step ? accent : 'rgba(128, 128, 128, 0.35)',
+ transition: reduced ? 'none' : 'width 300ms ease, background-color 300ms ease',
+ cursor: 'pointer'
+ }}
+ />
+ ))}
+
+
+
Slots will overlap: replicas will begin slot s + 1 as soon as they see the Prepare message for slot s . The target is an effective steady-state cadence of one committed cut per 1.5 network round trips, not per-transaction latency.
+
+ );
+};
export const GigaAttestationFlow = () => {
const ink = 'currentColor';
const accent = 'var(--sei-maroon-50)';
const gold = 'var(--sei-diagram-gold, var(--sei-gold-100))';
const hairline = 'rgba(128, 128, 128, 0.25)';
- const blocks = [
- { b: 'n-1', from: 0 },
- { b: 'n', from: 0 },
- { b: 'n+1', from: 1 },
- { b: 'n+2', from: 2 },
- { b: 'n+x', from: 4 }
- ];
+ const blocks = [
+ { b: 'n-1', from: 0 },
+ { b: 'n', from: 0 },
+ { b: 'n+1', from: 1 },
+ { b: 'n+2', from: 2 },
+ { b: 'n+x', from: 4 }
+ ];
+ const math = 'var(--sei-font-math)';
+ const tex = (expr, size, rest) => {
+ const drop = size * 0.24;
+ let low = false;
+ const parts = expr.match(/_\{[^}]*\}|_[A-Za-z0-9]|[A-Za-z]+|[0-9.]+|[-+=]|[^\sA-Za-z0-9_.+=-]/g).map((tok, i) => {
+ const sub = tok[0] === '_';
+ const body = sub ? tok.replace(/^_\{?|\}$/g, '') : /^[-+=]$/.test(tok) ? '\u2005' + tok.replace('-', '\u2212') + '\u2005' : tok;
+ const shift = sub ? drop : low ? -drop : undefined;
+ low = sub;
+ return {body} ;
+ });
+ return <>{parts}{rest ? {rest} : null}>;
+ };
+ const stages = [
+ { x: 96, label: <>execute block {tex('n', 10.5)}>, sub: 'deterministic Apply', from: 1 },
+ { x: 296, label: 'write log', sub: 'last write wins', from: 2 },
+ { x: 496, label: tex('d_n = LtHash(...)', 10.5), sub: 'writes, receipts, gas', from: 3 }
+ ];
+
+ const steps = [
+ {
+ title: 'Order the block',
+ text: <>Consensus fixes the position of block n . Its order is final, but nothing in it has executed yet.>
+ },
+ {
+ title: 'Execute it',
+ text: <>Every node applies block n to the same starting state. Execution is deterministic, so conforming nodes derive the same result without communicating. Ordering meanwhile moves on to block n + 1 .>
+ },
+ {
+ title: 'Resolve the write log',
+ text: 'If the block writes a key more than once, the last write wins. The digest covers the surviving writes, the receipts, and the gas accounting.'
+ },
+ {
+ title: 'Hash it into a digest',
+ text: <>A lattice hash, LtHash, combines those records into d n . Validators sign a compact commitment to it, the digest D n .>
+ },
+ {
+ title: 'Attest in a later block',
+ text: <>Once validators with two-thirds of voting power have signed D n , a later block, n + x , includes the attestation. This is state attestation finality for block n .>
+ },
+ {
+ title: 'Contain divergence',
+ text: 'Signing two different digests for the same block is slashable equivocation. Divergence below one-third of voting power can be isolated. Beyond one-third, the chain is designed to halt.'
+ }
+ ];
+ const last = steps.length - 1;
+
+ const [step, setStep] = useState(0);
+ const [playing, setPlaying] = useState(false);
+ const [reduced, setReduced] = useState(false);
+ const rootRef = useRef(null);
+ const playingRef = useRef(false);
+ const auto = useRef({ armed: true, resume: false });
+ playingRef.current = playing;
+
+ useEffect(() => {
+ if (typeof window === 'undefined' || !window.matchMedia) return undefined;
+ const query = window.matchMedia('(prefers-reduced-motion: reduce)');
+ const update = () => setReduced(query.matches);
+ update();
+ if (!query.addEventListener) return undefined;
+ query.addEventListener('change', update);
+ return () => query.removeEventListener('change', update);
+ }, []);
+
+ useEffect(() => {
+ if (!playing) return undefined;
+ const timer = setTimeout(() => setStep(step >= last ? 0 : step + 1), step >= last ? 3000 : step === 0 ? 800 : 2000);
+ return () => clearTimeout(timer);
+ }, [playing, step]);
+
+ useEffect(() => {
+ const node = rootRef.current;
+ if (!node || typeof IntersectionObserver === 'undefined') return undefined;
+ const observer = new IntersectionObserver(
+ (entries) => {
+ const entry = entries[entries.length - 1];
+ if (entry.intersectionRatio >= 0.3) {
+ const reduceMotion = window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches;
+ if ((auto.current.armed && !reduceMotion) || auto.current.resume) setPlaying(true);
+ auto.current = { armed: false, resume: false };
+ } else if (!entry.isIntersecting && playingRef.current) {
+ setPlaying(false);
+ auto.current = { armed: false, resume: true };
+ }
+ },
+ { threshold: [0, 0.35] }
+ );
+ observer.observe(node);
+ return () => observer.disconnect();
+ }, []);
+
+ const go = (next) => {
+ auto.current = { armed: false, resume: false };
+ setPlaying(false);
+ setStep(Math.max(0, Math.min(last, next)));
+ };
+ const togglePlay = () => {
+ auto.current = { armed: false, resume: false };
+ if (playing) {
+ setPlaying(false);
+ return;
+ }
+ setStep(step >= last ? 0 : step + 1);
+ setPlaying(true);
+ };
+
+ const slideIn = (visible, dx, dy, delay) => ({
+ opacity: visible ? 1 : 0,
+ transform: visible ? 'translate(0px, 0px)' : `translate(${dx}px, ${dy}px)`,
+ transition: reduced ? 'none' : `transform 600ms cubic-bezier(0.4, 0, 0.2, 1) ${delay || 0}ms, opacity 400ms ease ${delay || 0}ms`
+ });
+ const ghost = (pending) => ({ opacity: pending ? 1 : 0, transition: reduced ? 'none' : 'opacity 300ms ease' });
+ const attested = step >= 4;
+
+ const primaryButton = {
+ backgroundColor: 'var(--sei-maroon-100)',
+ color: '#ffffff',
+ fontFamily: 'var(--sei-font-mono)',
+ fontSize: '11px',
+ letterSpacing: '0.04em',
+ textTransform: 'uppercase',
+ padding: '6px 14px',
+ borderRadius: '6px',
+ minWidth: '76px',
+ cursor: 'pointer'
+ };
+ const secondaryButton = (disabled) => ({
+ backgroundColor: 'rgba(128, 128, 128, 0.14)',
+ fontFamily: 'var(--sei-font-mono)',
+ fontSize: '11px',
+ letterSpacing: '0.04em',
+ textTransform: 'uppercase',
+ padding: '6px 12px',
+ borderRadius: '6px',
+ opacity: disabled ? 0.4 : 1,
+ cursor: disabled ? 'default' : 'pointer'
+ });
+
+ return (
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {blocks.map((blk, i) => (blk.from > 0 ? : null))}
+ {stages.map((s) => (
+
+ ))}
+
+
+
+ {blocks.map((blk, i) => {
+ const isN = i === 1;
+ const later = i === 4;
+ return (
+ = blk.from, -16, 0)}>
+ {i > 0 ? : null}
+
+ block {tex(blk.b, 11)}
+
+ );
+ })}
+ ordering final
+ state attestation final
+
+ = 1, 0, -8)} />
+ {stages.map((s, i) => (
+ = s.from, -12, 0)}>
+ {i > 0 ? : null}
+
+ {s.label}
+ {s.sub}
+
+ ))}
+ = 3, -12, 0, 250)}>
+
+
+ digest {tex('D_n', 10.5)}
+ compact commitment
+
+
+
+ 2/3 voting power,
+ included in block {tex('n+x', 9.5)}
+
+
+ = 5, 0, 10)}>
+
+ signing two different digests for the same block is slashable equivocation;
+ divergence under 1/3 of voting power can be isolated; over 1/3 is designed to halt the chain
+
+
+
+
+
+
+
+ Step {step + 1} of {steps.length}
+
+
{steps[step].title}
+
{steps[step].text}
+
+
+ go(step - 1)} disabled={step === 0} aria-label="Previous step" className="text-neutral-800 dark:text-neutral-200" style={secondaryButton(step === 0)}>
+ Back
+
+ = last ? 'Replay from the start' : 'Play'} style={primaryButton}>
+ {playing ? 'Pause' : step >= last ? 'Replay' : 'Play'}
+
+ go(step + 1)} disabled={step === last} aria-label="Next step" className="text-neutral-800 dark:text-neutral-200" style={secondaryButton(step === last)}>
+ Next
+
+
+
+
+
+ {steps.map((item, i) => (
+ go(i)}
+ aria-label={`Step ${i + 1}: ${item.title}`}
+ aria-current={i === step ? 'step' : undefined}
+ style={{
+ width: i === step ? 22 : 8,
+ height: 8,
+ borderRadius: 9999,
+ backgroundColor: i <= step ? accent : 'rgba(128, 128, 128, 0.35)',
+ transition: reduced ? 'none' : 'width 300ms ease, background-color 300ms ease',
+ cursor: 'pointer'
+ }}
+ />
+ ))}
+
+
+
Execution results will be committed as a lattice-hash digest rather than a state root. Validators will attest to that digest a bounded number of blocks later.
+
+ );
+};
+
+export const GigaOccDiagram = () => {
+ const ink = 'currentColor';
+ const accent = 'var(--sei-maroon-50)';
+ const hairline = 'rgba(128, 128, 128, 0.25)';
+ const workers = ['worker 1', 'worker 2', 'worker 3'];
+ const rowY = (w) => 50 + w * 66;
+ const runs = [
+ { id: 't1', w: 0, x: 126, len: 100, label: 't1', from: 0, delay: 0 },
+ { id: 't2', w: 1, x: 126, len: 180, label: 't2 writes k', from: 0, delay: 0 },
+ { id: 't3', w: 2, x: 126, len: 190, label: 't3', from: 0, delay: 0 },
+ { id: 't4', w: 0, x: 236, len: 120, label: 't4 reads k', from: 1, delay: 0 },
+ { id: 't5', w: 1, x: 316, len: 110, label: 't5', from: 1, delay: 280 },
+ { id: 't4r', w: 0, x: 384, len: 130, label: 't4 re-executes', from: 3, delay: 0 }
+ ];
+
+ const steps = [
+ {
+ title: 'Start in parallel',
+ text: "Workers start the block's transactions in parallel. Each transaction buffers its writes privately, so nothing reaches shared state yet."
+ },
+ {
+ title: 'Read a value that is about to change',
+ text: "As workers free up, they take t4 and t5. t4 reads k while t2, which comes earlier in the block, is still running. t4 sees the value from before t2's write."
+ },
+ {
+ title: 'Validate against earlier writes',
+ text: "Validation checks whether an earlier transaction in the block wrote to anything a later one read. t2 wrote k after t4 began, so t4's read is stale. The other transactions pass."
+ },
+ {
+ title: 'Re-execute only the conflict',
+ text: "Only t4 rolls back and runs again, this time reading t2's value of k. Every other transaction keeps its first result."
+ },
+ {
+ title: 'Commit in block order',
+ text: 'Results commit in block order, so the outcome is identical to sequential execution. Under sustained contention, the sei-chain scheduler retries a transaction up to 10 times, then falls back to sequential execution.'
+ }
+ ];
+ const last = steps.length - 1;
+
+ const [step, setStep] = useState(0);
+ const [playing, setPlaying] = useState(false);
+ const [reduced, setReduced] = useState(false);
+ const rootRef = useRef(null);
+ const playingRef = useRef(false);
+ const auto = useRef({ armed: true, resume: false });
+ playingRef.current = playing;
+
+ useEffect(() => {
+ if (typeof window === 'undefined' || !window.matchMedia) return undefined;
+ const query = window.matchMedia('(prefers-reduced-motion: reduce)');
+ const update = () => setReduced(query.matches);
+ update();
+ if (!query.addEventListener) return undefined;
+ query.addEventListener('change', update);
+ return () => query.removeEventListener('change', update);
+ }, []);
+
+ useEffect(() => {
+ if (!playing) return undefined;
+ const timer = setTimeout(() => setStep(step >= last ? 0 : step + 1), step >= last ? 3000 : step === 0 ? 800 : 2000);
+ return () => clearTimeout(timer);
+ }, [playing, step]);
+
+ useEffect(() => {
+ const node = rootRef.current;
+ if (!node || typeof IntersectionObserver === 'undefined') return undefined;
+ const observer = new IntersectionObserver(
+ (entries) => {
+ const entry = entries[entries.length - 1];
+ if (entry.intersectionRatio >= 0.3) {
+ const reduceMotion = window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches;
+ if ((auto.current.armed && !reduceMotion) || auto.current.resume) setPlaying(true);
+ auto.current = { armed: false, resume: false };
+ } else if (!entry.isIntersecting && playingRef.current) {
+ setPlaying(false);
+ auto.current = { armed: false, resume: true };
+ }
+ },
+ { threshold: [0, 0.35] }
+ );
+ observer.observe(node);
+ return () => observer.disconnect();
+ }, []);
+
+ const go = (next) => {
+ auto.current = { armed: false, resume: false };
+ setPlaying(false);
+ setStep(Math.max(0, Math.min(last, next)));
+ };
+ const togglePlay = () => {
+ auto.current = { armed: false, resume: false };
+ if (playing) {
+ setPlaying(false);
+ return;
+ }
+ setStep(step >= last ? 0 : step + 1);
+ setPlaying(true);
+ };
+
+ const fade = reduced ? 'none' : 'opacity 400ms ease';
+ const shown = (visible) => ({ opacity: visible ? 1 : 0, transition: fade });
+ const grow = (on, run) => ({
+ transformBox: 'fill-box',
+ transformOrigin: 'left center',
+ transform: `scaleX(${on ? 1 : 0})`,
+ transition: reduced ? 'none' : on ? `transform ${run.len * 3.5}ms linear ${run.delay}ms` : 'transform 250ms ease'
+ });
+ const label = (on, run) => ({ opacity: on ? 1 : 0, transition: reduced ? 'none' : on ? `opacity 300ms ease ${run.delay + 150}ms` : 'opacity 200ms ease' });
+
+ const stale = step >= 2;
+
+ const primaryButton = {
+ backgroundColor: 'var(--sei-maroon-100)',
+ color: '#ffffff',
+ fontFamily: 'var(--sei-font-mono)',
+ fontSize: '11px',
+ letterSpacing: '0.04em',
+ textTransform: 'uppercase',
+ padding: '6px 14px',
+ borderRadius: '6px',
+ minWidth: '76px',
+ cursor: 'pointer'
+ };
+ const secondaryButton = (disabled) => ({
+ backgroundColor: 'rgba(128, 128, 128, 0.14)',
+ fontFamily: 'var(--sei-font-mono)',
+ fontSize: '11px',
+ letterSpacing: '0.04em',
+ textTransform: 'uppercase',
+ padding: '6px 12px',
+ borderRadius: '6px',
+ opacity: disabled ? 0.4 : 1,
+ cursor: disabled ? 'default' : 'pointer'
+ });
+
+ return (
+
+
+
+
+
+
+
+
+
+
+
+
+ {workers.map((w, i) => (
+
+ {w}
+
+
+ ))}
+
+ {runs.map((run) => {
+ const on = step >= run.from;
+ const isStale = run.id === 't4' && stale;
+ const redo = run.id === 't4r';
+ return (
+
+
+ {run.label}
+
+ );
+ })}
+
+ = 1)}>
+
+
+
+ t2 is still running
+
+
+
+
+ conflict
+ validation caught the stale read
+
+
+ = 3)} />
+
+ = 4)}>
+
+
+ commit in block order
+ result identical to
+ sequential execution
+ only conflicting transactions re-run; after 10 retries the implementation falls back to sequential execution
+
+
+
+ time
+
+
+
+
+
+
+ Step {step + 1} of {steps.length}
+
+
{steps[step].title}
+
{steps[step].text}
+
+
+ go(step - 1)} disabled={step === 0} aria-label="Previous step" className="text-neutral-800 dark:text-neutral-200" style={secondaryButton(step === 0)}>
+ Back
+
+ = last ? 'Replay from the start' : 'Play'} style={primaryButton}>
+ {playing ? 'Pause' : step >= last ? 'Replay' : 'Play'}
+
+ go(step + 1)} disabled={step === last} aria-label="Next step" className="text-neutral-800 dark:text-neutral-200" style={secondaryButton(step === last)}>
+ Next
+
+
+
+
+
+ {steps.map((item, i) => (
+ go(i)}
+ aria-label={`Step ${i + 1}: ${item.title}`}
+ aria-current={i === step ? 'step' : undefined}
+ style={{
+ width: i === step ? 22 : 8,
+ height: 8,
+ borderRadius: 9999,
+ backgroundColor: i <= step ? accent : 'rgba(128, 128, 128, 0.35)',
+ transition: reduced ? 'none' : 'width 300ms ease, background-color 300ms ease',
+ cursor: 'pointer'
+ }}
+ />
+ ))}
+
+
+
All transactions in a block will start in parallel with private write buffers. Validation will re-execute only those whose reads collided with an earlier transaction's writes.
+
+ );
+};
+
+export const GigaStorageArchitecture = () => {
+ const ink = 'currentColor';
+ const accent = 'var(--sei-maroon-50)';
+ const gold = 'var(--sei-diagram-gold, var(--sei-gold-100))';
+ const hairline = 'rgba(128, 128, 128, 0.25)';
const math = 'var(--sei-font-math)';
const tex = (expr, size, rest) => {
const drop = size * 0.24;
@@ -536,36 +1617,30 @@ export const GigaAttestationFlow = () => {
});
return <>{parts}{rest ? {rest} : null}>;
};
- const stages = [
- { x: 96, label: <>execute block {tex('n', 10.5)}>, sub: 'deterministic Apply', from: 1 },
- { x: 296, label: 'write log', sub: 'last write wins', from: 2 },
- { x: 496, label: tex('d_n = LtHash(...)', 10.5), sub: 'writes, receipts, gas', from: 3 }
- ];
-
const steps = [
{
- title: 'Order the block',
- text: <>Consensus fixes the position of block n . Its order is final, but nothing in it has executed yet.>
+ title: 'Serve reads from RAM',
+ text: 'Frequently accessed state will be held in RAM, so execution reads are served from memory in the common case.'
},
{
- title: 'Execute it',
- text: <>Every node applies block n to the same starting state. Execution is deterministic, so conforming nodes derive the same result without communicating. Ordering meanwhile moves on to block n + 1 .>
+ title: 'Write to a flat store',
+ text: 'Every account, storage slot, and global variable will map directly to an entry in a log-structured merge (LSM) tree. Writes skip per-write Merkle path updates, so nothing is re-hashed on the write path.'
},
{
- title: 'Resolve the write log',
- text: 'If the block writes a key more than once, the last write wins. The digest covers the surviving writes, the receipts, and the gas accounting.'
+ title: 'Persist asynchronously',
+ text: 'All disk writes will be asynchronous and exist only for durability. An append-only write-ahead log (WAL) protects them and is replayed on crash recovery.'
},
{
- title: 'Hash it into a digest',
- text: <>A lattice hash, LtHash, combines those records into d n . Validators sign a compact commitment to it, the digest D n .>
+ title: 'Tier by age',
+ text: 'Recent and hot data will sit on local high-performance SSDs. Historical data will move to a distributed columnar store built for analytical queries and audit workloads.'
},
{
- title: 'Attest in a later block',
- text: <>Once validators with two-thirds of voting power have signed D n , a later block, n + x , includes the attestation. This is state attestation finality for block n .>
+ title: 'Commit with a lattice hash',
+ text: <>Instead of a state root, each block's write log will be committed with LtHash, a homomorphic multiset hash, as d n . The digest updates incrementally as writes commit, in any order, with no tree walk.>
},
{
- title: 'Contain divergence',
- text: 'Signing two different digests for the same block is slashable equivocation. Divergence below one-third of voting power can be isolated. Beyond one-third, the chain is designed to halt.'
+ title: 'Attest it and settle disputes',
+ text: <>Validators attest the compact commitment D n with two-thirds of voting power. In a dispute, divergent executors compare chunk digests, bisect the key space, and replay only the affected range.>
}
];
const last = steps.length - 1;
@@ -630,13 +1705,14 @@ export const GigaAttestationFlow = () => {
setPlaying(true);
};
- const slideIn = (visible, dx, dy, delay) => ({
+ const ease = 'cubic-bezier(0.4, 0, 0.2, 1)';
+ const ghost = (pending) => ({ opacity: pending ? 1 : 0, transition: reduced ? 'none' : 'opacity 300ms ease' });
+ const slideIn = (visible, delay) => ({
opacity: visible ? 1 : 0,
- transform: visible ? 'translate(0px, 0px)' : `translate(${dx}px, ${dy}px)`,
- transition: reduced ? 'none' : `transform 600ms cubic-bezier(0.4, 0, 0.2, 1) ${delay || 0}ms, opacity 400ms ease ${delay || 0}ms`
+ transform: visible ? 'translate(0px, 0px)' : 'translate(0px, -8px)',
+ transition: reduced ? 'none' : `transform 500ms ${ease} ${visible ? delay || 0 : 0}ms, opacity 350ms ease ${visible ? delay || 0 : 0}ms`
});
- const ghost = (pending) => ({ opacity: pending ? 1 : 0, transition: reduced ? 'none' : 'opacity 300ms ease' });
- const attested = step >= 4;
+ const flow = (at) => (playing && step === at ? 'on' : undefined);
const primaryButton = {
backgroundColor: 'var(--sei-maroon-100)',
@@ -666,62 +1742,72 @@ export const GigaAttestationFlow = () => {
-
+
-
+
-
-
-
- {blocks.map((blk, i) => (blk.from > 0 ? : null))}
- {stages.map((s) => (
-
- ))}
-
-
+
+
+
+
+
+
+
+
- {blocks.map((blk, i) => {
- const isN = i === 1;
- const later = i === 4;
- return (
- = blk.from, -16, 0)}>
- {i > 0 ? : null}
-
- block {tex(blk.b, 11)}
-
- );
- })}
- ordering final
- state attestation final
- = 1, 0, -8)} />
- {stages.map((s, i) => (
- = s.from, -12, 0)}>
- {i > 0 ? : null}
-
- {s.label}
- {s.sub}
-
- ))}
- = 3, -12, 0, 250)}>
-
-
- digest {tex('D_n', 10.5)}
- compact commitment
+ state path
+
+ execution: reads served from RAM
+ = 1)}>
+
+
+ flat key-value store (LSM tree)
+ no per-write Merkle updates
-
-
- 2/3 voting power,
- included in block {tex('n+x', 9.5)}
+ = 2)}>
+
+ async
+
+ append-only WAL
+ crash recovery
+
+ = 3)}>
+
+
+ hot tier: local high-performance SSDs
+
+ = 3, 450)}>
+
+
+ cold tier: distributed columnar store
- = 5, 0, 10)}>
-
- signing two different digests for the same block is slashable equivocation;
- divergence under 1/3 of voting power can be isolated; over 1/3 is designed to halt the chain
+ commitment path
+ = 4)}>
+
+ each block's writes
+
+ write log of block {tex('n', 10.5)}
+
+ = 4, 450)}>
+
+
+ lattice hash {tex('d_n', 10.5, ' (LtHash)')}
+ incremental, order-independent
+
+ = 5)}>
+
+
+ {tex('D_n', 10.5, ' attested by 2/3 voting power')}
+
+ = 5, 450)}>
+
+ disputes: compare chunk digests,
+ bisect, replay one range
@@ -767,46 +1853,54 @@ export const GigaAttestationFlow = () => {
))}
- Execution results will be committed as a lattice-hash digest rather than a state root. Validators will attest to that digest a bounded number of blocks later.
+ In the proposed architecture, the write path avoids Merkle-tree updates. State lives in a RAM-first flat store with an append-only WAL. Commitments come from a homomorphic lattice hash over each block's write log.
);
};
-export const GigaOccDiagram = () => {
+export const GigaBudWindow = () => {
const ink = 'currentColor';
const accent = 'var(--sei-maroon-50)';
+ const gold = 'var(--sei-diagram-gold, var(--sei-gold-100))';
const hairline = 'rgba(128, 128, 128, 0.25)';
- const workers = ['worker 1', 'worker 2', 'worker 3'];
- const rowY = (w) => 50 + w * 66;
- const runs = [
- { id: 't1', w: 0, x: 126, len: 100, label: 't1', from: 0, delay: 0 },
- { id: 't2', w: 1, x: 126, len: 180, label: 't2 writes k', from: 0, delay: 0 },
- { id: 't3', w: 2, x: 126, len: 190, label: 't3', from: 0, delay: 0 },
- { id: 't4', w: 0, x: 236, len: 120, label: 't4 reads k', from: 1, delay: 0 },
- { id: 't5', w: 1, x: 316, len: 110, label: 't5', from: 1, delay: 280 },
- { id: 't4r', w: 0, x: 384, len: 130, label: 't4 re-executes', from: 3, delay: 0 }
- ];
-
+ const leaves = ['(key a, value, n, prev)', '(key b, value, n, prev)', '(key c, value, n, prev)'];
+ const math = 'var(--sei-font-math)';
+ const tex = (expr, size, rest) => {
+ const drop = size * 0.24;
+ let low = false;
+ const parts = expr.match(/_\{[^}]*\}|_[A-Za-z0-9]|[A-Za-z]+|[0-9.]+|[-+=]|[^\sA-Za-z0-9_.+=-]/g).map((tok, i) => {
+ const sub = tok[0] === '_';
+ const body = sub ? tok.replace(/^_\{?|\}$/g, '') : /^[-+=]$/.test(tok) ? '\u2005' + tok.replace('-', '\u2212') + '\u2005' : tok;
+ const shift = sub ? drop : low ? -drop : undefined;
+ low = sub;
+ return
{body} ;
+ });
+ return <>{parts}{rest ?
{rest} : null}>;
+ };
const steps = [
{
- title: 'Start in parallel',
- text: "Workers start the block's transactions in parallel. Each transaction buffers its writes privately, so nothing reaches shared state yet."
+ title: "Sort the block's writes",
+ text: <>Every state entry will carry its last-modified height. For block
n , each write becomes a leaf
(key, newValue, n, prevHeight), and the leaves are sorted by key.>
},
{
- title: 'Read a value that is about to change',
- text: "As workers free up, they take t4 and t5. t4 reads k while t2, which comes earlier in the block, is still running. t4 sees the value from before t2's write."
+ title: 'Root them into a BUD',
+ text: <>The Block Update Digest
U n is the Merkle root over that block's leaves only. Its cost scales with how much the block changed, not with total state size.>
},
{
- title: 'Validate against earlier writes',
- text: "Validation checks whether an earlier transaction in the block wrote to anything a later one read. t2 wrote k after t4 began, so t4's read is stale. The other transactions pass."
+ title: 'Attest it with the digest',
+ text: <>Validators attest
U n on the same delayed two-thirds voting-power schedule as the divergence digest
D n .>
},
{
- title: 'Re-execute only the conflict',
- text: "Only t4 rolls back and runs again, this time reading t2's value of k. Every other transaction keeps its first result."
+ title: 'Prove a value',
+ text: <>A membership proof is a Merkle path to an attested
U n . It certifies that
key held
value right after block
n . Two proofs at heights
a and
b , where the
b -leaf records predecessor
a , prove the key was unmodified in between.>
},
{
- title: 'Commit in block order',
- text: 'Results commit in block order, so the outcome is identical to sequential execution. Under sustained contention, the sei-chain scheduler retries a transaction up to 10 times, then falls back to sequential execution.'
+ title: 'Cover long ranges with SuperBUDs',
+ text: <>SuperBUDs aggregate BUDs over exponentially growing windows, with branching base
e and maximum level
L max set by governance. The guaranteed proof window is
η = e L max blocks. Archive nodes can serve older claims, outside the protocol guarantee.>
+ },
+ {
+ title: 'Keep proof anchors fresh',
+ text: <>Touch transactions rewrite only a key's last-modified metadata, which gives a long-untouched key a fresh proof anchor. Deletions leave tombstones, which anchor exclusion proofs and are garbage-collected after
η .>
}
];
const last = steps.length - 1;
@@ -871,17 +1965,15 @@ export const GigaOccDiagram = () => {
setPlaying(true);
};
- const fade = reduced ? 'none' : 'opacity 400ms ease';
- const shown = (visible) => ({ opacity: visible ? 1 : 0, transition: fade });
- const grow = (on, run) => ({
- transformBox: 'fill-box',
- transformOrigin: 'left center',
- transform: `scaleX(${on ? 1 : 0})`,
- transition: reduced ? 'none' : on ? `transform ${run.len * 3.5}ms linear ${run.delay}ms` : 'transform 250ms ease'
+ const ease = 'cubic-bezier(0.4, 0, 0.2, 1)';
+ const shown = (visible, delay) => ({ opacity: visible ? 1 : 0, transition: reduced ? 'none' : `opacity 400ms ease ${visible ? delay || 0 : 0}ms` });
+ const ghost = (pending) => ({ opacity: pending ? 1 : 0, transition: reduced ? 'none' : 'opacity 300ms ease' });
+ const slideIn = (visible, delay) => ({
+ opacity: visible ? 1 : 0,
+ transform: visible ? 'translate(0px, 0px)' : 'translate(-10px, 0px)',
+ transition: reduced ? 'none' : `transform 500ms ${ease} ${visible ? delay || 0 : 0}ms, opacity 350ms ease ${visible ? delay || 0 : 0}ms`
});
- const label = (on, run) => ({ opacity: on ? 1 : 0, transition: reduced ? 'none' : on ? `opacity 300ms ease ${run.delay + 150}ms` : 'opacity 200ms ease' });
-
- const stale = step >= 2;
+ const flow = (at) => (playing && step === at ? 'on' : undefined);
const primaryButton = {
backgroundColor: 'var(--sei-maroon-100)',
@@ -904,67 +1996,72 @@ export const GigaOccDiagram = () => {
padding: '6px 12px',
borderRadius: '6px',
opacity: disabled ? 0.4 : 1,
- cursor: disabled ? 'default' : 'pointer'
- });
-
- return (
-
-
-
-
-
-
-
-
-
-
-
-
- {workers.map((w, i) => (
-
- {w}
-
-
- ))}
-
- {runs.map((run) => {
- const on = step >= run.from;
- const isStale = run.id === 't4' && stale;
- const redo = run.id === 't4r';
- return (
-
-
- {run.label}
-
- );
- })}
-
- = 1)}>
-
-
-
- t2 is still running
+ cursor: disabled ? 'default' : 'pointer'
+ });
-
-
-
- conflict
- validation caught the stale read
+ return (
+
+
+
+
+
+
+
+
+
+
+
+
+
- = 3)} />
+ this block's writes, sorted by key
+ {leaves.map((l, i) => (
+
+
+ {l}
+ = 1, i * 120)} data-sei-flow={flow(1)} />
+
+ ))}
+ = 1, 350)}>
+
+ root {tex('U_n', 10.5)}
+
+ = 2)}>
+
+
+ attested with {tex('D_n', 10)}
+ same 2/3 voting-power schedule
+
+ = 3)}>
+
+
+ proof = Merkle path to attested {tex('U_n', 9.5, ';')}
+ two proofs bracket an unmodified span
+ cost scales with the block's updates
+
= 4)}>
-
-
- commit in block order
- result identical to
- sequential execution
- only conflicting transactions re-run; after 10 retries the implementation falls back to sequential execution
+
+ {Array.from({ length: 17 }, (_, i) => (
+
+ ))}
+ blocks
-
-
- time
+ {[0, 1, 2, 3].map((i) => (
+ = 4, 250 + i * 180)} />
+ ))}
+ = 4, 300)}>SuperBUD, {tex('e', 9)} blocks
+ = 4, 1100)}>
+
+
+ guaranteed proof window: the last {tex('e', 9.5)}
+ L
+ max
+ blocks (governance-set); older claims need archive nodes
+
+
+ = 5)}>touch transactions refresh a stale key's anchor; deletions leave tombstones for exclusion proofs
@@ -1009,141 +2106,6 @@ export const GigaOccDiagram = () => {
))}
- All transactions in a block will start in parallel with private write buffers. Validation will re-execute only those whose reads collided with an earlier transaction's writes.
-
- );
-};
-
-export const GigaStorageArchitecture = () => {
- const ink = 'currentColor';
- const accent = 'var(--sei-maroon-50)';
- const gold = 'var(--sei-diagram-gold, var(--sei-gold-100))';
- const math = 'var(--sei-font-math)';
- const tex = (expr, size, rest) => {
- const drop = size * 0.24;
- let low = false;
- const parts = expr.match(/_\{[^}]*\}|_[A-Za-z0-9]|[A-Za-z]+|[0-9.]+|[-+=]|[^\sA-Za-z0-9_.+=-]/g).map((tok, i) => {
- const sub = tok[0] === '_';
- const body = sub ? tok.replace(/^_\{?|\}$/g, '') : /^[-+=]$/.test(tok) ? '\u2005' + tok.replace('-', '\u2212') + '\u2005' : tok;
- const shift = sub ? drop : low ? -drop : undefined;
- low = sub;
- return
{body} ;
- });
- return <>{parts}{rest ?
{rest} : null}>;
- };
- return (
-
-
-
-
-
-
-
-
- state path
-
- execution: reads served from RAM
-
-
- flat key-value store (LSM tree)
- no per-write Merkle updates
-
- append-only WAL
- crash recovery
-
- async
-
-
- hot tier: local high-performance SSDs
-
-
- cold tier: distributed columnar store
-
- commitment path
-
- write log of block {tex('n', 10.5)}
-
-
- lattice hash {tex('d_n', 10.5, ' (LtHash)')}
- incremental, order-independent
-
-
- {tex('D_n', 10.5, ' attested by 2/3 voting power')}
-
- disputes: compare chunk digests,
- bisect, replay one range
-
-
-
In the proposed architecture, the write path avoids Merkle-tree updates. State lives in a RAM-first flat store with an append-only WAL. Commitments come from a homomorphic lattice hash over each block's write log.
-
- );
-};
-
-export const GigaBudWindow = () => {
- const ink = 'currentColor';
- const accent = 'var(--sei-maroon-50)';
- const gold = 'var(--sei-diagram-gold, var(--sei-gold-100))';
- const leaves = ['(key a, value, n, prev)', '(key b, value, n, prev)', '(key c, value, n, prev)'];
- const math = 'var(--sei-font-math)';
- const tex = (expr, size, rest) => {
- const drop = size * 0.24;
- let low = false;
- const parts = expr.match(/_\{[^}]*\}|_[A-Za-z0-9]|[A-Za-z]+|[0-9.]+|[-+=]|[^\sA-Za-z0-9_.+=-]/g).map((tok, i) => {
- const sub = tok[0] === '_';
- const body = sub ? tok.replace(/^_\{?|\}$/g, '') : /^[-+=]$/.test(tok) ? '\u2005' + tok.replace('-', '\u2212') + '\u2005' : tok;
- const shift = sub ? drop : low ? -drop : undefined;
- low = sub;
- return
{body} ;
- });
- return <>{parts}{rest ?
{rest} : null}>;
- };
- return (
-
-
-
-
-
-
-
-
- {leaves.map((l, i) => (
-
-
- {l}
-
-
- ))}
- this block's writes, sorted by key
-
- root {tex('U_n', 10.5)}
-
-
- attested with {tex('D_n', 10)}
- same 2/3 voting-power schedule
-
- proof = Merkle path to attested {tex('U_n', 9.5, ';')}
- two proofs bracket an unmodified span
- cost scales with the block's updates
-
-
- {Array.from({ length: 17 }, (_, i) => (
-
- ))}
- blocks
- {[0, 1, 2, 3].map((i) => (
-
- ))}
- SuperBUD, {tex('e', 9)} blocks
-
-
- guaranteed proof window: the last {tex('e', 9.5)}
- L
- max
- blocks (governance-set); older claims need archive nodes
-
- touch transactions refresh a stale key's anchor; deletions leave tombstones for exclusion proofs
-
-
Every block will get a Merkle root over only its own updates. SuperBUDs will aggregate those roots over exponentially sized windows so provers can cover long ranges with a few digests.
);
@@ -1878,31 +2840,201 @@ export const GigaFeeSplit = () => {
const ink = 'currentColor';
const accent = 'var(--sei-maroon-50)';
const gold = 'var(--sei-diagram-gold, var(--sei-gold-100))';
+ const hairline = 'rgba(128, 128, 128, 0.25)';
const parts = [
{ x: 60, w: 300, label: 'execution fee', sub: '1559-style base fee', to: 'pays for gas actually consumed', c: null },
- { x: 360, w: 240, label: 'ordering fee (tip)', sub: 'buys a position in the order', to: 'socialised: epoch pool, stake x liveness', c: 'accent' },
+ { x: 360, w: 240, label: 'ordering fee (tip)', sub: 'buys a position in the order', to: 'socialised: epoch pool, stake × liveness', c: 'accent' },
{ x: 600, w: 200, label: 'distribution fee', sub: 'prices duplicate copies', to: 'only one copy executes; partial refund', c: 'gold' }
];
+
+ const steps = [
+ {
+ title: 'Execution fee',
+ text: <>An EIP-1559-style dynamic base fee will pay for the gas the transaction consumes.
eth_feeHistory and
eth_maxPriorityFeePerGas will remain your estimation tools.>
+ },
+ {
+ title: 'Ordering fee',
+ text: 'The priority fee will buy a position in the merged order. Lanes in each committed cut will be ordered by their highest included tip, so a higher tip buys earlier execution.'
+ },
+ {
+ title: 'Distribution fee',
+ text: 'Each duplicate copy that you submit for censorship resistance will pay a distribution fee. Only one copy executes, and the other copies get part of the tip back.'
+ },
+ {
+ title: 'Tips are socialised',
+ text: 'Priority fees will be pooled per epoch and distributed to validators by stake and liveness. The proposer that carried the transaction is not paid directly.'
+ }
+ ];
+ const last = steps.length - 1;
+
+ const [step, setStep] = useState(0);
+ const [playing, setPlaying] = useState(false);
+ const [reduced, setReduced] = useState(false);
+ const rootRef = useRef(null);
+ const playingRef = useRef(false);
+ const auto = useRef({ armed: true, resume: false });
+ playingRef.current = playing;
+
+ useEffect(() => {
+ if (typeof window === 'undefined' || !window.matchMedia) return undefined;
+ const query = window.matchMedia('(prefers-reduced-motion: reduce)');
+ const update = () => setReduced(query.matches);
+ update();
+ if (!query.addEventListener) return undefined;
+ query.addEventListener('change', update);
+ return () => query.removeEventListener('change', update);
+ }, []);
+
+ useEffect(() => {
+ if (!playing) return undefined;
+ const timer = setTimeout(() => setStep(step >= last ? 0 : step + 1), step >= last ? 3000 : step === 0 ? 800 : 2000);
+ return () => clearTimeout(timer);
+ }, [playing, step]);
+
+ useEffect(() => {
+ const node = rootRef.current;
+ if (!node || typeof IntersectionObserver === 'undefined') return undefined;
+ const observer = new IntersectionObserver(
+ (entries) => {
+ const entry = entries[entries.length - 1];
+ if (entry.intersectionRatio >= 0.3) {
+ const reduceMotion = window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches;
+ if ((auto.current.armed && !reduceMotion) || auto.current.resume) setPlaying(true);
+ auto.current = { armed: false, resume: false };
+ } else if (!entry.isIntersecting && playingRef.current) {
+ setPlaying(false);
+ auto.current = { armed: false, resume: true };
+ }
+ },
+ { threshold: [0, 0.35] }
+ );
+ observer.observe(node);
+ return () => observer.disconnect();
+ }, []);
+
+ const go = (next) => {
+ auto.current = { armed: false, resume: false };
+ setPlaying(false);
+ setStep(Math.max(0, Math.min(last, next)));
+ };
+ const togglePlay = () => {
+ auto.current = { armed: false, resume: false };
+ if (playing) {
+ setPlaying(false);
+ return;
+ }
+ setStep(step >= last ? 0 : step + 1);
+ setPlaying(true);
+ };
+
+ const ease = 'cubic-bezier(0.4, 0, 0.2, 1)';
+ const shown = (visible, delay) => ({ opacity: visible ? 1 : 0, transition: reduced ? 'none' : `opacity 400ms ease ${visible ? delay || 0 : 0}ms` });
+ const ghost = (pending) => ({ opacity: pending ? 1 : 0, transition: reduced ? 'none' : 'opacity 300ms ease' });
+ const slideIn = (visible, delay) => ({
+ opacity: visible ? 1 : 0,
+ transform: visible ? 'translate(0px, 0px)' : 'translate(0px, -10px)',
+ transition: reduced ? 'none' : `transform 500ms ${ease} ${visible ? delay || 0 : 0}ms, opacity 350ms ease ${visible ? delay || 0 : 0}ms`
+ });
+
+ const primaryButton = {
+ backgroundColor: 'var(--sei-maroon-100)',
+ color: '#ffffff',
+ fontFamily: 'var(--sei-font-mono)',
+ fontSize: '11px',
+ letterSpacing: '0.04em',
+ textTransform: 'uppercase',
+ padding: '6px 14px',
+ borderRadius: '6px',
+ minWidth: '76px',
+ cursor: 'pointer'
+ };
+ const secondaryButton = (disabled) => ({
+ backgroundColor: 'rgba(128, 128, 128, 0.14)',
+ fontFamily: 'var(--sei-font-mono)',
+ fontSize: '11px',
+ letterSpacing: '0.04em',
+ textTransform: 'uppercase',
+ padding: '6px 12px',
+ borderRadius: '6px',
+ opacity: disabled ? 0.4 : 1,
+ cursor: disabled ? 'default' : 'pointer'
+ });
+
return (
-
-
-
- {parts.map((p) => {
- const fill = p.c === 'accent' ? accent : p.c === 'gold' ? gold : ink;
- const op = p.c ? 0.16 : 0.06;
- return (
-
-
- {p.label}
- {p.sub}
-
- {p.to}
-
- );
- })}
- one transaction, three priced things
- the protocol pools tips and does not pay the carrying proposer directly
-
+
+
+
+
+
+
+
+
+
+
+ one signed transaction
+ {parts.map((p, k) => {
+ const fill = p.c === 'accent' ? accent : p.c === 'gold' ? gold : ink;
+ const cx = p.x + (p.w - 8) / 2;
+ return (
+
+
+ = k)} data-sei-flow={playing && step === k ? 'on' : undefined} />
+ = k, 250)}>
+
+ {p.label}
+ {p.sub}
+
+ = k, 650)}>
+
+ {p.to}
+
+
+ );
+ })}
+ = 3, 200)}>the protocol pools tips and does not pay the carrying proposer directly
+
+
+
+
+
+
+ Step {step + 1} of {steps.length}
+
+
{steps[step].title}
+
{steps[step].text}
+
+
+ go(step - 1)} disabled={step === 0} aria-label="Previous step" className="text-neutral-800 dark:text-neutral-200" style={secondaryButton(step === 0)}>
+ Back
+
+ = last ? 'Replay from the start' : 'Play'} style={primaryButton}>
+ {playing ? 'Pause' : step >= last ? 'Replay' : 'Play'}
+
+ go(step + 1)} disabled={step === last} aria-label="Next step" className="text-neutral-800 dark:text-neutral-200" style={secondaryButton(step === last)}>
+ Next
+
+
+
+
+
+ {steps.map((item, i) => (
+ go(i)}
+ aria-label={`Step ${i + 1}: ${item.title}`}
+ aria-current={i === step ? 'step' : undefined}
+ style={{
+ width: i === step ? 22 : 8,
+ height: 8,
+ borderRadius: 9999,
+ backgroundColor: i <= step ? accent : 'rgba(128, 128, 128, 0.35)',
+ transition: reduced ? 'none' : 'width 300ms ease, background-color 300ms ease',
+ cursor: 'pointer'
+ }}
+ />
+ ))}
+
Execution, ordering, and duplicate distribution will be priced separately. The tip will be strictly enforced for ordering and then socialised across the validator set.
diff --git a/snippets/nonce-lane-diagrams.jsx b/snippets/nonce-lane-diagrams.jsx
index a43c259..a545428 100644
--- a/snippets/nonce-lane-diagrams.jsx
+++ b/snippets/nonce-lane-diagrams.jsx
@@ -241,74 +241,248 @@ export const NonceLanes = () => {
const math = 'var(--sei-font-math)';
const ok = 'var(--sei-diagram-ok, #1a7a00)';
const bad = 'var(--sei-diagram-error, #c20a00)';
- const chip = (x, y, label, state, key) => {
+ const hairline = 'rgba(128, 128, 128, 0.25)';
+
+ const steps = [
+ {
+ title: 'One nonce, two halves',
+ text: 'EntryPoint v0.8 stores a UserOperation nonce as one uint256: a 192-bit key in the high bits and a 64-bit sequence in the low bits. The repository calls a key a lane.'
+ },
+ {
+ title: 'Each lane keeps its own sequence',
+ text: 'The EntryPoint keeps one sequence counter per lane. Operations on the same lane stay strictly sequential, so the implementation allows at most one in-flight operation per lane.'
+ },
+ {
+ title: 'A revert still consumes its sequence',
+ text: 'An operation that executes and reverts still consumes its lane sequence. Lane 2 moves on to sequence 2.'
+ },
+ {
+ title: 'A fresh lane is valid immediately',
+ text: 'A new lane costs nothing to open. It starts at sequence 0 and is valid immediately.'
+ },
+ {
+ title: 'Lanes never wait on each other',
+ text: 'Operations on different lanes have no ordering relationship. Whatever happens on one lane, the others stay valid.'
+ },
+ {
+ title: 'Lane 0 is rejected',
+ text: 'LaneAccount rejects lane 0. Most SDKs pick key 0 when you do not pass one, and work that lands entirely on key 0 is a single queue again.'
+ }
+ ];
+ const last = steps.length - 1;
+
+ const [step, setStep] = useState(0);
+ const [playing, setPlaying] = useState(false);
+ const [reduced, setReduced] = useState(false);
+ const rootRef = useRef(null);
+ const playingRef = useRef(false);
+ const auto = useRef({ armed: true, resume: false });
+ playingRef.current = playing;
+
+ useEffect(() => {
+ if (typeof window === 'undefined' || !window.matchMedia) return undefined;
+ const query = window.matchMedia('(prefers-reduced-motion: reduce)');
+ const update = () => setReduced(query.matches);
+ update();
+ if (!query.addEventListener) return undefined;
+ query.addEventListener('change', update);
+ return () => query.removeEventListener('change', update);
+ }, []);
+
+ useEffect(() => {
+ if (!playing) return undefined;
+ const timer = setTimeout(() => setStep(step >= last ? 0 : step + 1), step >= last ? 3000 : step === 0 ? 800 : 2000);
+ return () => clearTimeout(timer);
+ }, [playing, step]);
+
+ useEffect(() => {
+ const node = rootRef.current;
+ if (!node || typeof IntersectionObserver === 'undefined') return undefined;
+ const observer = new IntersectionObserver(
+ (entries) => {
+ const entry = entries[entries.length - 1];
+ if (entry.intersectionRatio >= 0.3) {
+ const reduceMotion = window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches;
+ if ((auto.current.armed && !reduceMotion) || auto.current.resume) setPlaying(true);
+ auto.current = { armed: false, resume: false };
+ } else if (!entry.isIntersecting && playingRef.current) {
+ setPlaying(false);
+ auto.current = { armed: false, resume: true };
+ }
+ },
+ { threshold: [0, 0.35] }
+ );
+ observer.observe(node);
+ return () => observer.disconnect();
+ }, []);
+
+ const go = (next) => {
+ auto.current = { armed: false, resume: false };
+ setPlaying(false);
+ setStep(Math.max(0, Math.min(last, next)));
+ };
+ const togglePlay = () => {
+ auto.current = { armed: false, resume: false };
+ if (playing) {
+ setPlaying(false);
+ return;
+ }
+ setStep(step >= last ? 0 : step + 1);
+ setPlaying(true);
+ };
+
+ const ease = 'cubic-bezier(0.4, 0, 0.2, 1)';
+ const shown = (visible, delay) => ({ opacity: visible ? 1 : 0, transition: reduced ? 'none' : `opacity 400ms ease ${visible ? delay || 0 : 0}ms` });
+ const ghost = (pending) => ({ opacity: pending ? 1 : 0, transition: reduced ? 'none' : 'opacity 300ms ease' });
+ const slideIn = (visible, delay) => ({
+ opacity: visible ? 1 : 0,
+ transform: visible ? 'translate(0px, 0px)' : 'translate(-10px, 0px)',
+ transition: reduced ? 'none' : `transform 500ms ${ease} ${visible ? delay || 0 : 0}ms, opacity 350ms ease ${visible ? delay || 0 : 0}ms`
+ });
+ const chip = (x, y, label, state, at, delay) => {
const c = state === 'ok' ? ok : state === 'bad' ? bad : ink;
return (
-
-
- {label}
+
+
+ = at, delay)}>
+
+ {label}
+
);
};
+
+ const primaryButton = {
+ backgroundColor: 'var(--sei-maroon-100)',
+ color: '#ffffff',
+ fontFamily: 'var(--sei-font-mono)',
+ fontSize: '11px',
+ letterSpacing: '0.04em',
+ textTransform: 'uppercase',
+ padding: '6px 14px',
+ borderRadius: '6px',
+ minWidth: '76px',
+ cursor: 'pointer'
+ };
+ const secondaryButton = (disabled) => ({
+ backgroundColor: 'rgba(128, 128, 128, 0.14)',
+ fontFamily: 'var(--sei-font-mono)',
+ fontSize: '11px',
+ letterSpacing: '0.04em',
+ textTransform: 'uppercase',
+ padding: '6px 12px',
+ borderRadius: '6px',
+ opacity: disabled ? 0.4 : 1,
+ cursor: disabled ? 'default' : 'pointer'
+ });
return (
-
-
-
-
-
-
-
-
-
- One uint256 nonce, two dimensions
- bit 255
- bit 64
- bit 0
-
- uint192 key: the lane
-
- any value from 1 to 2
- 192
- {'\u2005\u2212\u20051'}
- , chosen by the caller
-
-
- uint64 sequence
- kept by the EntryPoint per lane
- nonce = (lane << 64) | sequence
-
-
- The EntryPoint keeps one sequence counter per lane
-
- lane 0
-
- rejected by LaneAccount: SDKs default to key 0, and work on key 0 is one queue again
-
- lane 1
- {chip(120, 210, 'seq 0', 'ok', 'l1s0')}
- {chip(172, 210, 'seq 1', 'ok', 'l1s1')}
- {chip(224, 210, 'seq 2', 'ok', 'l1s2')}
- {chip(276, 210, 'next 3', 'next', 'l1n')}
- three operations landed in order
-
- lane 2
- {chip(120, 246, 'seq 0', 'ok', 'l2s0')}
- {chip(172, 246, 'seq 1', 'bad', 'l2s1')}
- {chip(224, 246, 'next 2', 'next', 'l2n')}
- seq 1 executed and reverted: it still consumed its sequence
-
- lane 3
- {chip(120, 282, 'next 0', 'next', 'l3n')}
- a fresh lane starts at 0 and is valid immediately
-
-
- no ordering between lanes
- whatever happens on one lane,
- the others stay valid
-
-
- strictly ordered within a lane, left to right
-
+
+
+
+
+
+
+
+
+
+
+ One uint256 nonce, two dimensions
+ bit 255
+ bit 64
+ bit 0
+
+ uint192 key: the lane
+
+ any value from 1 to 2
+ 192
+ {'\u2005\u2212\u20051'}
+ , chosen by the caller
+
+
+ uint64 sequence
+ kept by the EntryPoint per lane
+ nonce = (lane << 64) | sequence
+
+
+ = 1)}>The EntryPoint keeps one sequence counter per lane
+
+ = 5)}>
+ lane 0
+
+ rejected by LaneAccount: SDKs default to key 0, and work on key 0 is one queue again
+
+
+ = 1)}>lane 1
+ {chip(120, 210, 'seq 0', 'ok', 1, 0)}
+ {chip(172, 210, 'seq 1', 'ok', 1, 300)}
+ {chip(224, 210, 'seq 2', 'ok', 1, 600)}
+ {chip(276, 210, 'next 3', 'next', 1, 900)}
+ = 1, 1000)}>three operations landed in order
+
+ = 2)}>lane 2
+ {chip(120, 246, 'seq 0', 'ok', 2, 0)}
+ {chip(172, 246, 'seq 1', 'bad', 2, 350)}
+ {chip(224, 246, 'next 2', 'next', 2, 700)}
+ = 2, 800)}>seq 1 executed and reverted: it still consumed its sequence
+
+ = 3)}>lane 3
+ {chip(120, 282, 'next 0', 'next', 3, 150)}
+ = 3, 400)}>a fresh lane starts at 0 and is valid immediately
+
+ = 4)}>
+
+ no ordering between lanes
+ whatever happens on one lane,
+ the others stay valid
+
+
+ = 1, 1100)}>
+
+ strictly ordered within a lane, left to right
+
+
+
+
+
+
+
+ Step {step + 1} of {steps.length}
+
+
{steps[step].title}
+
{steps[step].text}
+
+
+ go(step - 1)} disabled={step === 0} aria-label="Previous step" className="text-neutral-800 dark:text-neutral-200" style={secondaryButton(step === 0)}>
+ Back
+
+ = last ? 'Replay from the start' : 'Play'} style={primaryButton}>
+ {playing ? 'Pause' : step >= last ? 'Replay' : 'Play'}
+
+ go(step + 1)} disabled={step === last} aria-label="Next step" className="text-neutral-800 dark:text-neutral-200" style={secondaryButton(step === last)}>
+ Next
+
+
+
+
+
+ {steps.map((item, i) => (
+ go(i)}
+ aria-label={`Step ${i + 1}: ${item.title}`}
+ aria-current={i === step ? 'step' : undefined}
+ style={{
+ width: i === step ? 22 : 8,
+ height: 8,
+ borderRadius: 9999,
+ backgroundColor: i <= step ? accent : 'rgba(128, 128, 128, 0.35)',
+ transition: reduced ? 'none' : 'width 300ms ease, background-color 300ms ease',
+ cursor: 'pointer'
+ }}
+ />
+ ))}
+
EntryPoint v0.8 stores a UserOperation nonce as a 192-bit key plus a 64-bit sequence and tracks one sequence per key. Operations on different keys never queue behind each other. Operations on the same key stay sequential. The repository calls a key a lane and forbids lane 0.
@@ -319,119 +493,486 @@ export const NonceLaneDelegation = () => {
const ink = 'currentColor';
const accent = 'var(--sei-maroon-50)';
const gold = 'var(--sei-diagram-gold, var(--sei-gold-100))';
+ const hairline = 'rgba(128, 128, 128, 0.25)';
const box = { fill: ink, fillOpacity: 0.05, stroke: ink, strokeOpacity: 0.35, strokeWidth: 1 };
+
+ const steps = [
+ {
+ title: 'Start from the funded EOA',
+ text: 'The funded account keeps its address, its native SEI balance, its token balances, and its venue approvals. The same private key signs every UserOperation.'
+ },
+ {
+ title: 'Install the delegation designator',
+ text: <>One type-4 transaction writes
0xef0100 followed by the LaneAccount address into the EOA's code slot. A self-sponsored delegation advances the account's EVM nonce by two. After that, the submission path signs only UserOperations, so the EVM nonce stops moving.>
+ },
+ {
+ title: 'The EntryPoint calls the account',
+ text: <>The EntryPoint v0.8 singleton at
0x4337084D9E255Ff0702461CF8895CE9E3b5Ff108 checks the signature, the lane sequence, and the prefund. Then
handleOps calls
execute(target, value, data) on the EOA.>
+ },
+ {
+ title: "The EOA runs LaneAccount's code",
+ text: "The EVM runs LaneAccount's code in the EOA's context. LaneAccount inherits the reference Simple7702Account and adds one rule: lane 0 is rejected."
+ },
+ {
+ title: 'The venue sees the funded address',
+ text: <>
LaneAccount.execute reaches the venue with the funded EOA as
msg.sender.
tx.origin is the relayer that paid for gas.>
+ }
+ ];
+ const last = steps.length - 1;
+
+ const [step, setStep] = useState(0);
+ const [playing, setPlaying] = useState(false);
+ const [reduced, setReduced] = useState(false);
+ const rootRef = useRef(null);
+ const playingRef = useRef(false);
+ const auto = useRef({ armed: true, resume: false });
+ playingRef.current = playing;
+
+ useEffect(() => {
+ if (typeof window === 'undefined' || !window.matchMedia) return undefined;
+ const query = window.matchMedia('(prefers-reduced-motion: reduce)');
+ const update = () => setReduced(query.matches);
+ update();
+ if (!query.addEventListener) return undefined;
+ query.addEventListener('change', update);
+ return () => query.removeEventListener('change', update);
+ }, []);
+
+ useEffect(() => {
+ if (!playing) return undefined;
+ const timer = setTimeout(() => setStep(step >= last ? 0 : step + 1), step >= last ? 3000 : step === 0 ? 800 : 2000);
+ return () => clearTimeout(timer);
+ }, [playing, step]);
+
+ useEffect(() => {
+ const node = rootRef.current;
+ if (!node || typeof IntersectionObserver === 'undefined') return undefined;
+ const observer = new IntersectionObserver(
+ (entries) => {
+ const entry = entries[entries.length - 1];
+ if (entry.intersectionRatio >= 0.3) {
+ const reduceMotion = window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches;
+ if ((auto.current.armed && !reduceMotion) || auto.current.resume) setPlaying(true);
+ auto.current = { armed: false, resume: false };
+ } else if (!entry.isIntersecting && playingRef.current) {
+ setPlaying(false);
+ auto.current = { armed: false, resume: true };
+ }
+ },
+ { threshold: [0, 0.35] }
+ );
+ observer.observe(node);
+ return () => observer.disconnect();
+ }, []);
+
+ const go = (next) => {
+ auto.current = { armed: false, resume: false };
+ setPlaying(false);
+ setStep(Math.max(0, Math.min(last, next)));
+ };
+ const togglePlay = () => {
+ auto.current = { armed: false, resume: false };
+ if (playing) {
+ setPlaying(false);
+ return;
+ }
+ setStep(step >= last ? 0 : step + 1);
+ setPlaying(true);
+ };
+
+ const ease = 'cubic-bezier(0.4, 0, 0.2, 1)';
+ const ghost = (pending) => ({ opacity: pending ? 1 : 0, transition: reduced ? 'none' : 'opacity 300ms ease' });
+ const slideIn = (visible, dx, dy, delay) => ({
+ opacity: visible ? 1 : 0,
+ transform: visible ? 'translate(0px, 0px)' : `translate(${dx}px, ${dy}px)`,
+ transition: reduced ? 'none' : `transform 500ms ${ease} ${visible ? delay || 0 : 0}ms, opacity 350ms ease ${visible ? delay || 0 : 0}ms`
+ });
+ const flow = (at) => (playing && step === at ? 'on' : undefined);
+
+ const primaryButton = {
+ backgroundColor: 'var(--sei-maroon-100)',
+ color: '#ffffff',
+ fontFamily: 'var(--sei-font-mono)',
+ fontSize: '11px',
+ letterSpacing: '0.04em',
+ textTransform: 'uppercase',
+ padding: '6px 14px',
+ borderRadius: '6px',
+ minWidth: '76px',
+ cursor: 'pointer'
+ };
+ const secondaryButton = (disabled) => ({
+ backgroundColor: 'rgba(128, 128, 128, 0.14)',
+ fontFamily: 'var(--sei-font-mono)',
+ fontSize: '11px',
+ letterSpacing: '0.04em',
+ textTransform: 'uppercase',
+ padding: '6px 12px',
+ borderRadius: '6px',
+ opacity: disabled ? 0.4 : 1,
+ cursor: disabled ? 'default' : 'pointer'
+ });
+
return (
-
-
-
-
-
-
-
-
-
-
-
-
-
- Funded EOA, same address
- same native SEI balance
- same token balances and venue approvals
- same private key signs every UserOperation
- EVM nonce: a self-sponsored delegation spends two,
- then it is frozen on the submission path
-
- code slot (delegation designator)
- 0xef0100 || LaneAccount address
-
-
- EntryPoint v0.8 singleton
- 0x4337084D9E255Ff0702461CF8895CE9E3b5Ff108
- checks signature, lane sequence, and prefund
-
- handleOps calls
- execute(target, value, data)
-
-
- LaneAccount implementation
- inherits the reference Simple7702Account
- adds one rule: lane 0 is rejected
- ADMIN_LANE = max uint192 for ordered admin calls
-
- runs this code
-
-
-
- venue contract
- msg.sender = the funded EOA, not a proxy
- tx.origin = the gas-paying relayer
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Funded EOA, same address
+ same native SEI balance
+ same token balances and venue approvals
+ same private key signs every UserOperation
+ EVM nonce: a self-sponsored delegation spends two,
+ then it is frozen on the submission path
+ = 1, 0, 10)}>
+
+ code slot (delegation designator)
+ 0xef0100 || LaneAccount address
+
+
+ = 2, 12, 0)}>
+
+ EntryPoint v0.8 singleton
+ 0x4337084D9E255Ff0702461CF8895CE9E3b5Ff108
+ checks signature, lane sequence, and prefund
+
+ = 2, 12, 0, 300)}>
+
+ handleOps calls
+ execute(target, value, data)
+
+
+ = 3, 12, 0, 250)}>
+
+ LaneAccount implementation
+ inherits the reference Simple7702Account
+ adds one rule: lane 0 is rejected
+ ADMIN_LANE = max uint192 for ordered admin calls
+
+ = 3, -12, 0)}>
+
+ runs this code
+
+
+ = 4, 0, -10)}>
+
+
+ venue contract
+
+ = 4, -10, 0, 350)}>
+ msg.sender = the funded EOA, not a proxy
+ tx.origin = the gas-paying relayer
+
+
+
+
+
+
+
+ Step {step + 1} of {steps.length}
+
+
{steps[step].title}
+
{steps[step].text}
+
+
+ go(step - 1)} disabled={step === 0} aria-label="Previous step" className="text-neutral-800 dark:text-neutral-200" style={secondaryButton(step === 0)}>
+ Back
+
+ = last ? 'Replay from the start' : 'Play'} style={primaryButton}>
+ {playing ? 'Pause' : step >= last ? 'Replay' : 'Play'}
+
+ go(step + 1)} disabled={step === last} aria-label="Next step" className="text-neutral-800 dark:text-neutral-200" style={secondaryButton(step === last)}>
+ Next
+
+
+
+
+
+ {steps.map((item, i) => (
+ go(i)}
+ aria-label={`Step ${i + 1}: ${item.title}`}
+ aria-current={i === step ? 'step' : undefined}
+ style={{
+ width: i === step ? 22 : 8,
+ height: 8,
+ borderRadius: 9999,
+ backgroundColor: i <= step ? accent : 'rgba(128, 128, 128, 0.35)',
+ transition: reduced ? 'none' : 'width 300ms ease, background-color 300ms ease',
+ cursor: 'pointer'
+ }}
+ />
+ ))}
+
One type-4 transaction writes the designator into the EOA's code slot. The address, balances, and approvals do not move. When the EntryPoint calls the account, the EVM runs LaneAccount's code in the EOA's context, so the venue sees the funded address as msg.sender.
);
};
-export const NonceLanePipeline = () => {
- const ink = 'currentColor';
- const accent = 'var(--sei-maroon-50)';
- const gold = 'var(--sei-diagram-gold, var(--sei-gold-100))';
- const box = { fill: ink, fillOpacity: 0.05, stroke: ink, strokeOpacity: 0.35, strokeWidth: 1 };
- const relayers = ['relayer 0', 'relayer 1', 'relayer 2', 'relayer N'];
- return (
-
-
-
-
-
-
-
-
-
-
- holds the funds, signs intents
- holds gas only, cannot forge an operation
-
-
- Funded EOA
- delegated to LaneAccount
- signs one UserOperation per lane
- EIP-712 digest, no nonce RPCs
- EVM nonce does not move
-
-
-
- Bundling queue
- in-process FIFO of signed ops
- one op per lane per bundle
- no ERC-7562 4-op sender cap
- bundles ≤ MAX_OPS_PER_BUNDLE
-
- {relayers.map((r, i) => {
- const y = 40 + i * 72;
- return (
-
-
-
- {r}
- own sequential nonce, 1 tx in flight
-
-
- );
- })}
- the sequential constraint moved here, away from the funds
-
-
- EntryPoint v0.8
- handleOps(ops[], relayer)
- validates every op, then executes
- each one, refunds gas to the relayer
-
-
-
- LaneAccount.execute → venue
- msg.sender is the funded EOA
-
+export const NonceLanePipeline = () => {
+ const ink = 'currentColor';
+ const accent = 'var(--sei-maroon-50)';
+ const gold = 'var(--sei-diagram-gold, var(--sei-gold-100))';
+ const hairline = 'rgba(128, 128, 128, 0.25)';
+ const box = { fill: ink, fillOpacity: 0.05, stroke: ink, strokeOpacity: 0.35, strokeWidth: 1 };
+ const relayers = ['relayer 0', 'relayer 1', 'relayer 2', 'relayer N'];
+
+ const steps = [
+ {
+ title: 'Sign one operation per lane',
+ text: "The funded EOA, delegated to LaneAccount, signs one UserOperation per lane over an EIP-712 digest. The signing path reads no nonces, and the account's EVM nonce does not move."
+ },
+ {
+ title: 'Queue the signed operations',
+ text: <>Signed operations go into an in-process FIFO, not a mempool. A bundle takes up to
MAX_OPS_PER_BUNDLE operations, never two from the same lane. The ERC-7562 cap of four pending operations per sender does not apply.>
+ },
+ {
+ title: 'Relayers wrap the bundles',
+ text: <>Each gas-only relayer wraps a bundle in an
EntryPoint.handleOps transaction and pays for it. A relayer has its own sequential EVM nonce and keeps one outer transaction in flight.>
+ },
+ {
+ title: 'The EntryPoint validates and executes',
+ text: <>
handleOps validates every operation, executes each one, and refunds gas to the relayer.>
+ },
+ {
+ title: 'The venue sees the funded EOA',
+ text: <>Each operation reaches the venue through
LaneAccount.execute, with the funded EOA as
msg.sender.>
+ },
+ {
+ title: 'The queue moved away from the funds',
+ text: "The sequential constraint now sits with the relayers, which hold only gas. A relayer key can lose its own gas balance, but it cannot create a valid operation without the funded account's signature."
+ }
+ ];
+ const last = steps.length - 1;
+
+ const [step, setStep] = useState(0);
+ const [playing, setPlaying] = useState(false);
+ const [reduced, setReduced] = useState(false);
+ const rootRef = useRef(null);
+ const playingRef = useRef(false);
+ const auto = useRef({ armed: true, resume: false });
+ playingRef.current = playing;
+
+ useEffect(() => {
+ if (typeof window === 'undefined' || !window.matchMedia) return undefined;
+ const query = window.matchMedia('(prefers-reduced-motion: reduce)');
+ const update = () => setReduced(query.matches);
+ update();
+ if (!query.addEventListener) return undefined;
+ query.addEventListener('change', update);
+ return () => query.removeEventListener('change', update);
+ }, []);
+
+ useEffect(() => {
+ if (!playing) return undefined;
+ const timer = setTimeout(() => setStep(step >= last ? 0 : step + 1), step >= last ? 3000 : step === 0 ? 800 : 2000);
+ return () => clearTimeout(timer);
+ }, [playing, step]);
+
+ useEffect(() => {
+ const node = rootRef.current;
+ if (!node || typeof IntersectionObserver === 'undefined') return undefined;
+ const observer = new IntersectionObserver(
+ (entries) => {
+ const entry = entries[entries.length - 1];
+ if (entry.intersectionRatio >= 0.3) {
+ const reduceMotion = window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches;
+ if ((auto.current.armed && !reduceMotion) || auto.current.resume) setPlaying(true);
+ auto.current = { armed: false, resume: false };
+ } else if (!entry.isIntersecting && playingRef.current) {
+ setPlaying(false);
+ auto.current = { armed: false, resume: true };
+ }
+ },
+ { threshold: [0, 0.35] }
+ );
+ observer.observe(node);
+ return () => observer.disconnect();
+ }, []);
+
+ const go = (next) => {
+ auto.current = { armed: false, resume: false };
+ setPlaying(false);
+ setStep(Math.max(0, Math.min(last, next)));
+ };
+ const togglePlay = () => {
+ auto.current = { armed: false, resume: false };
+ if (playing) {
+ setPlaying(false);
+ return;
+ }
+ setStep(step >= last ? 0 : step + 1);
+ setPlaying(true);
+ };
+
+ const ease = 'cubic-bezier(0.4, 0, 0.2, 1)';
+ const shown = (visible, delay) => ({ opacity: visible ? 1 : 0, transition: reduced ? 'none' : `opacity 400ms ease ${visible ? delay || 0 : 0}ms` });
+ const ghost = (pending) => ({ opacity: pending ? 1 : 0, transition: reduced ? 'none' : 'opacity 300ms ease' });
+ const slideIn = (visible, delay) => ({
+ opacity: visible ? 1 : 0,
+ transform: visible ? 'translate(0px, 0px)' : 'translate(-10px, 0px)',
+ transition: reduced ? 'none' : `transform 500ms ${ease} ${visible ? delay || 0 : 0}ms, opacity 350ms ease ${visible ? delay || 0 : 0}ms`
+ });
+ const flow = (at) => (playing && step === at ? 'on' : undefined);
+
+ const primaryButton = {
+ backgroundColor: 'var(--sei-maroon-100)',
+ color: '#ffffff',
+ fontFamily: 'var(--sei-font-mono)',
+ fontSize: '11px',
+ letterSpacing: '0.04em',
+ textTransform: 'uppercase',
+ padding: '6px 14px',
+ borderRadius: '6px',
+ minWidth: '76px',
+ cursor: 'pointer'
+ };
+ const secondaryButton = (disabled) => ({
+ backgroundColor: 'rgba(128, 128, 128, 0.14)',
+ fontFamily: 'var(--sei-font-mono)',
+ fontSize: '11px',
+ letterSpacing: '0.04em',
+ textTransform: 'uppercase',
+ padding: '6px 12px',
+ borderRadius: '6px',
+ opacity: disabled ? 0.4 : 1,
+ cursor: disabled ? 'default' : 'pointer'
+ });
+
+ return (
+
+
+
+
+
+
+
+
+
+
+
+ {relayers.map((r, i) => (
+
+ ))}
+
+
+
+
+ = 5)}>
+
+ holds the funds, signs intents
+ holds gas only, cannot forge an operation
+
+
+
+ Funded EOA
+ delegated to LaneAccount
+ signs one UserOperation per lane
+ EIP-712 digest, no nonce RPCs
+ EVM nonce does not move
+
+ = 1)}>
+
+
+ Bundling queue
+ in-process FIFO of signed ops
+ one op per lane per bundle
+ no ERC-7562 4-op sender cap
+ bundles ≤ MAX_OPS_PER_BUNDLE
+
+
+ {relayers.map((r, i) => {
+ const y = 40 + i * 72;
+ return (
+
+ = 2, i * 180)}>
+
+
+ {r}
+ own sequential nonce, 1 tx in flight
+
+ = 3, i * 120)} data-sei-flow={flow(3)} />
+
+ );
+ })}
+ = 5 ? accent : ink} fillOpacity={step >= 5 ? 1 : 0.6} fontWeight={step >= 5 ? '600' : '400'} style={shown(step >= 2, 800)}>the sequential constraint moved here, away from the funds
+
+ = 3, 450)}>
+
+ EntryPoint v0.8
+ handleOps(ops[], relayer)
+ validates every op, then executes
+ each one, refunds gas to the relayer
+
+
+ = 4)}>
+
+
+ LaneAccount.execute → venue
+ msg.sender is the funded EOA
+
+
+
+
+
+
+
+ Step {step + 1} of {steps.length}
+
+
{steps[step].title}
+
{steps[step].text}
+
+
+ go(step - 1)} disabled={step === 0} aria-label="Previous step" className="text-neutral-800 dark:text-neutral-200" style={secondaryButton(step === 0)}>
+ Back
+
+ = last ? 'Replay from the start' : 'Play'} style={primaryButton}>
+ {playing ? 'Pause' : step >= last ? 'Replay' : 'Play'}
+
+ go(step + 1)} disabled={step === last} aria-label="Next step" className="text-neutral-800 dark:text-neutral-200" style={secondaryButton(step === last)}>
+ Next
+
+
+
+
+
+ {steps.map((item, i) => (
+ go(i)}
+ aria-label={`Step ${i + 1}: ${item.title}`}
+ aria-current={i === step ? 'step' : undefined}
+ style={{
+ width: i === step ? 22 : 8,
+ height: 8,
+ borderRadius: 9999,
+ backgroundColor: i <= step ? accent : 'rgba(128, 128, 128, 0.35)',
+ transition: reduced ? 'none' : 'width 300ms ease, background-color 300ms ease',
+ cursor: 'pointer'
+ }}
+ />
+ ))}
+
UserOperations are not transactions. Gas-only relayers wrap each bundle in an EntryPoint.handleOps transaction and pay for it. Each relayer still has one sequential EVM nonce, but a relayer key can only lose its own gas. It cannot create a valid operation without the funded account's signature.
@@ -713,50 +1254,215 @@ export const NonceLaneBundleLifecycle = () => {
export const NonceLaneFailureIsolation = () => {
const ink = 'currentColor';
+ const accent = 'var(--sei-maroon-50)';
const ok = 'var(--sei-diagram-ok, #1a7a00)';
const bad = 'var(--sei-diagram-error, #c20a00)';
const warn = 'var(--sei-diagram-warning, #b45309)';
- const lane = (x, y, label, sub, c, dashed, key) => (
-
-
- {label}
- {sub}
+ const hairline = 'rgba(128, 128, 128, 0.25)';
+
+ const steps = [
+ {
+ title: 'An execution revert stays in its lane',
+ text: 'The EntryPoint treats an account execution failure as a per-operation result. Lane 30 emits a failed UserOperationEvent and pays gas, all four lane sequences advance, and the bundle continues.'
+ },
+ {
+ title: 'A validation failure reverts the bundle',
+ text: 'A bad signature, a stale sequence, or an insufficient prefund fails before anything executes. The whole handleOps transaction reverts, and nothing in it is consumed. Every bundle is simulated before broadcast, so this is normally caught for free.'
+ },
+ {
+ title: 'A dropped bundle costs nothing',
+ text: 'A signed operation whose outer transaction was dropped, evicted, or never broadcast leaves its lane sequence untouched. Neighboring lanes stay valid, and the journal requeues the operation.'
+ }
+ ];
+ const last = steps.length - 1;
+
+ const [step, setStep] = useState(0);
+ const [playing, setPlaying] = useState(false);
+ const [reduced, setReduced] = useState(false);
+ const rootRef = useRef(null);
+ const playingRef = useRef(false);
+ const auto = useRef({ armed: true, resume: false });
+ playingRef.current = playing;
+
+ useEffect(() => {
+ if (typeof window === 'undefined' || !window.matchMedia) return undefined;
+ const query = window.matchMedia('(prefers-reduced-motion: reduce)');
+ const update = () => setReduced(query.matches);
+ update();
+ if (!query.addEventListener) return undefined;
+ query.addEventListener('change', update);
+ return () => query.removeEventListener('change', update);
+ }, []);
+
+ useEffect(() => {
+ if (!playing) return undefined;
+ const timer = setTimeout(() => setStep(step >= last ? 0 : step + 1), step >= last ? 3000 : step === 0 ? 800 : 2000);
+ return () => clearTimeout(timer);
+ }, [playing, step]);
+
+ useEffect(() => {
+ const node = rootRef.current;
+ if (!node || typeof IntersectionObserver === 'undefined') return undefined;
+ const observer = new IntersectionObserver(
+ (entries) => {
+ const entry = entries[entries.length - 1];
+ if (entry.intersectionRatio >= 0.3) {
+ const reduceMotion = window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches;
+ if ((auto.current.armed && !reduceMotion) || auto.current.resume) setPlaying(true);
+ auto.current = { armed: false, resume: false };
+ } else if (!entry.isIntersecting && playingRef.current) {
+ setPlaying(false);
+ auto.current = { armed: false, resume: true };
+ }
+ },
+ { threshold: [0, 0.35] }
+ );
+ observer.observe(node);
+ return () => observer.disconnect();
+ }, []);
+
+ const go = (next) => {
+ auto.current = { armed: false, resume: false };
+ setPlaying(false);
+ setStep(Math.max(0, Math.min(last, next)));
+ };
+ const togglePlay = () => {
+ auto.current = { armed: false, resume: false };
+ if (playing) {
+ setPlaying(false);
+ return;
+ }
+ setStep(step >= last ? 0 : step + 1);
+ setPlaying(true);
+ };
+
+ const ease = 'cubic-bezier(0.4, 0, 0.2, 1)';
+ const shown = (visible, delay) => ({ opacity: visible ? 1 : 0, transition: reduced ? 'none' : `opacity 400ms ease ${visible ? delay || 0 : 0}ms` });
+ const ghost = (pending) => ({ opacity: pending ? 1 : 0, transition: reduced ? 'none' : 'opacity 300ms ease' });
+ const rise = (visible, delay) => ({
+ opacity: visible ? 1 : 0,
+ transform: visible ? 'translate(0px, 0px)' : 'translate(0px, 8px)',
+ transition: reduced ? 'none' : `transform 500ms ${ease} ${visible ? delay || 0 : 0}ms, opacity 350ms ease ${visible ? delay || 0 : 0}ms`
+ });
+ const lane = (x, y, label, sub, c, dashed, at, delay) => (
+
+
+ = at, delay)}>
+
+ {label}
+ {sub}
+
);
+
+ const primaryButton = {
+ backgroundColor: 'var(--sei-maroon-100)',
+ color: '#ffffff',
+ fontFamily: 'var(--sei-font-mono)',
+ fontSize: '11px',
+ letterSpacing: '0.04em',
+ textTransform: 'uppercase',
+ padding: '6px 14px',
+ borderRadius: '6px',
+ minWidth: '76px',
+ cursor: 'pointer'
+ };
+ const secondaryButton = (disabled) => ({
+ backgroundColor: 'rgba(128, 128, 128, 0.14)',
+ fontFamily: 'var(--sei-font-mono)',
+ fontSize: '11px',
+ letterSpacing: '0.04em',
+ textTransform: 'uppercase',
+ padding: '6px 12px',
+ borderRadius: '6px',
+ opacity: disabled ? 0.4 : 1,
+ cursor: disabled ? 'default' : 'pointer'
+ });
+
return (
-
-
-
- Execution revert: isolated to its lane
-
- one handleOps transaction, one block
- {lane(46, 70, 'lane 29', 'filled', ok, false, 'a29')}
- {lane(142, 70, 'lane 30', 'reverted', bad, false, 'a30')}
- {lane(238, 70, 'lane 31', 'filled', ok, false, 'a31')}
- {lane(334, 70, 'lane 32', 'filled', ok, false, 'a32')}
- all four sequences advance; lane 30 emits a failed UserOperationEvent and pays gas
- the EntryPoint treats an account call failure as a per-operation result
- and continues with the next operation in the bundle
-
-
-
- Validation failure: the whole bundle
-
- handleOps reverts, nothing in it is consumed
- {lane(486, 70, 'lane 29', 'not consumed', ink, true, 'b29')}
- {lane(582, 70, 'lane 30', 'AA25 stale seq', bad, false, 'b30')}
- {lane(678, 70, 'lane 31', 'not consumed', ink, true, 'b31')}
- {lane(774, 70, 'lane 32', 'not consumed', ink, true, 'b32')}
- bad signature, stale sequence, or insufficient prefund fails before any execution
- every bundle is simulated before broadcast, so this is normally caught
- for free; MAX_OPS_PER_BUNDLE sets the size of this failure domain
-
-
-
- Never submitted: nothing consumed
- a signed operation whose outer transaction was dropped, evicted, or never broadcast
- leaves its lane sequence untouched; neighboring lanes stay valid and the journal requeues it
-
+
+
+
+
+ Execution revert: isolated to its lane
+
+ one handleOps transaction, one block
+ {lane(46, 70, 'lane 29', 'filled', ok, false, 0, 0)}
+ {lane(142, 70, 'lane 30', 'reverted', bad, false, 0, 0)}
+ {lane(238, 70, 'lane 31', 'filled', ok, false, 0, 0)}
+ {lane(334, 70, 'lane 32', 'filled', ok, false, 0, 0)}
+ all four sequences advance; lane 30 emits a failed UserOperationEvent and pays gas
+ the EntryPoint treats an account call failure as a per-operation result
+ and continues with the next operation in the bundle
+
+
+
+ = 1)}>
+ Validation failure: the whole bundle
+
+ handleOps reverts, nothing in it is consumed
+
+ {lane(582, 70, 'lane 30', 'AA25 stale seq', bad, false, 1, 150)}
+ {lane(486, 70, 'lane 29', 'not consumed', ink, true, 1, 550)}
+ {lane(678, 70, 'lane 31', 'not consumed', ink, true, 1, 650)}
+ {lane(774, 70, 'lane 32', 'not consumed', ink, true, 1, 750)}
+ = 1, 900)}>
+ bad signature, stale sequence, or insufficient prefund fails before any execution
+ every bundle is simulated before broadcast, so this is normally caught
+ for free; MAX_OPS_PER_BUNDLE sets the size of this failure domain
+
+
+
+
+ = 2, 150)}>
+
+ Never submitted: nothing consumed
+ a signed operation whose outer transaction was dropped, evicted, or never broadcast
+ leaves its lane sequence untouched; neighboring lanes stay valid and the journal requeues it
+
+
+
+
+
+
+
+ Step {step + 1} of {steps.length}
+
+
{steps[step].title}
+
{steps[step].text}
+
+
+ go(step - 1)} disabled={step === 0} aria-label="Previous step" className="text-neutral-800 dark:text-neutral-200" style={secondaryButton(step === 0)}>
+ Back
+
+ = last ? 'Replay from the start' : 'Play'} style={primaryButton}>
+ {playing ? 'Pause' : step >= last ? 'Replay' : 'Play'}
+
+ go(step + 1)} disabled={step === last} aria-label="Next step" className="text-neutral-800 dark:text-neutral-200" style={secondaryButton(step === last)}>
+ Next
+
+
+
+
+
+ {steps.map((item, i) => (
+ go(i)}
+ aria-label={`Step ${i + 1}: ${item.title}`}
+ aria-current={i === step ? 'step' : undefined}
+ style={{
+ width: i === step ? 22 : 8,
+ height: 8,
+ borderRadius: 9999,
+ backgroundColor: i <= step ? accent : 'rgba(128, 128, 128, 0.35)',
+ transition: reduced ? 'none' : 'width 300ms ease, background-color 300ms ease',
+ cursor: 'pointer'
+ }}
+ />
+ ))}
+
The three failures have different blast radii. An execution revert costs one lane sequence and nothing else. A validation failure costs the outer transaction attempt but no sequences. A dropped bundle costs nothing on chain, which is exactly the case that strands a sequential account.
@@ -792,8 +1498,37 @@ export const NonceLaneThroughputComparison = () => {
const scale = 6.5; // px per landed op/s, 0..80 across 520 px
const rowTop = (i) => 62 + i * 40;
const plotBottom = rowTop(rows.length) - 6;
+ const [drawn, setDrawn] = useState(true);
+ const rootRef = useRef(null);
+
+ useEffect(() => {
+ const node = rootRef.current;
+ if (!node || typeof window === 'undefined' || typeof IntersectionObserver === 'undefined') return undefined;
+ if (window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches) return undefined;
+ if (node.getBoundingClientRect().top < window.innerHeight) return undefined;
+ setDrawn(false);
+ const observer = new IntersectionObserver(
+ (entries) => {
+ if (entries[entries.length - 1].intersectionRatio >= 0.3) {
+ setDrawn(true);
+ observer.disconnect();
+ }
+ },
+ { threshold: [0, 0.35] }
+ );
+ observer.observe(node);
+ return () => observer.disconnect();
+ }, []);
+
+ const reveal = (delay) => ({ opacity: drawn ? 1 : 0, transition: drawn ? `opacity 350ms ease ${delay}ms` : 'none' });
+ const grow = (delay) => ({
+ transformBox: 'fill-box',
+ transformOrigin: 'left center',
+ transform: `scaleX(${drawn ? 1 : 0})`,
+ transition: drawn ? `transform 700ms cubic-bezier(0.4, 0, 0.2, 1) ${delay}ms` : 'none'
+ });
return (
-
+
Landed operations per second, same venue call, Sei Testnet
@@ -810,19 +1545,21 @@ export const NonceLaneThroughputComparison = () => {
))}
landed operations per second
-
- block-gas ceiling
- ≈ 73 per second
+
+
+ block-gas ceiling
+ ≈ 73 per second
+
{rows.map((r, i) => {
const y = rowTop(i);
return (
{r.label}
-
- {r.chain.toFixed(1)}
-
- {r.client.toFixed(1)}
+
+ {r.chain.toFixed(1)}
+
+ {r.client.toFixed(1)}
);
})}
@@ -849,8 +1586,37 @@ export const NonceLaneBlockGasUtilization = () => {
const scale = 4.3; // px per percent, 0..100 across 430 px
const rowTop = (i) => 62 + i * 40;
const plotBottom = rowTop(rows.length) - 6;
+ const [drawn, setDrawn] = useState(true);
+ const rootRef = useRef(null);
+
+ useEffect(() => {
+ const node = rootRef.current;
+ if (!node || typeof window === 'undefined' || typeof IntersectionObserver === 'undefined') return undefined;
+ if (window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches) return undefined;
+ if (node.getBoundingClientRect().top < window.innerHeight) return undefined;
+ setDrawn(false);
+ const observer = new IntersectionObserver(
+ (entries) => {
+ if (entries[entries.length - 1].intersectionRatio >= 0.3) {
+ setDrawn(true);
+ observer.disconnect();
+ }
+ },
+ { threshold: [0, 0.35] }
+ );
+ observer.observe(node);
+ return () => observer.disconnect();
+ }, []);
+
+ const reveal = (delay) => ({ opacity: drawn ? 1 : 0, transition: drawn ? `opacity 350ms ease ${delay}ms` : 'none' });
+ const grow = (delay) => ({
+ transformBox: 'fill-box',
+ transformOrigin: 'left center',
+ transform: `scaleX(${drawn ? 1 : 0})`,
+ transition: drawn ? `transform 700ms cubic-bezier(0.4, 0, 0.2, 1) ${delay}ms` : 'none'
+ });
return (
-
+
Block gas used during each run, percent of the 12,500,000 limit
@@ -877,11 +1643,13 @@ export const NonceLaneBlockGasUtilization = () => {
return (
{r.label}
-
- {r.avg.toFixed(1)}%
-
- {r.max.toFixed(1)}%
- {r.full}
+
+ {r.avg.toFixed(1)}%
+
+
+ {r.max.toFixed(1)}%
+
+ {r.full}
);
})}
@@ -921,8 +1689,32 @@ export const NonceLaneScalingSeries = () => {
}
];
const points = (p, series) => series.map((v, i) => `${p.x0 + i * p.step},${yFor(v)}`).join(' ');
+ const trace = (p, series) => Math.ceil(series.reduce((sum, v, i) => (i === 0 ? 0 : sum + Math.hypot(p.step, yFor(v) - yFor(series[i - 1]))), 0));
+ const [drawn, setDrawn] = useState(true);
+ const rootRef = useRef(null);
+
+ useEffect(() => {
+ const node = rootRef.current;
+ if (!node || typeof window === 'undefined' || typeof IntersectionObserver === 'undefined') return undefined;
+ if (window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches) return undefined;
+ if (node.getBoundingClientRect().top < window.innerHeight) return undefined;
+ setDrawn(false);
+ const observer = new IntersectionObserver(
+ (entries) => {
+ if (entries[entries.length - 1].intersectionRatio >= 0.3) {
+ setDrawn(true);
+ observer.disconnect();
+ }
+ },
+ { threshold: [0, 0.35] }
+ );
+ observer.observe(node);
+ return () => observer.disconnect();
+ }, []);
+
+ const reveal = (delay) => ({ opacity: drawn ? 1 : 0, transition: drawn ? `opacity 350ms ease ${delay}ms` : 'none' });
return (
-
+
{panels.map((p) => {
@@ -940,18 +1732,20 @@ export const NonceLaneScalingSeries = () => {
))}
block-gas ceiling ≈ 73
-
-
+
+
{p.cats.map((c, i) => {
const x = p.x0 + i * p.step;
// Near the axis a label below the dot would land on the category tick, so it moves beside it.
const low = yFor(p.client[i]) + 15 > yBottom - 4;
return (
-
-
- {p.chain[i].toFixed(1)}
- {p.client[i].toFixed(1)}
+
+
+
+ {p.chain[i].toFixed(1)}
+ {p.client[i].toFixed(1)}
+
{c}
);
diff --git a/snippets/statesync-diagrams.jsx b/snippets/statesync-diagrams.jsx
new file mode 100644
index 0000000..99c599c
--- /dev/null
+++ b/snippets/statesync-diagrams.jsx
@@ -0,0 +1,284 @@
+// StateSyncFlow — a steppable, animated walk through state sync on a new node:
+// pick a trusted block, configure the node, find a snapshot, verify forward
+// from the trust height, restore the snapshot, and block sync to the tip. It
+// uses the same player as the Giga diagrams: it starts when it scrolls into
+// view, loops until a reader pauses it, pauses while off screen, and does not
+// autoplay under prefers-reduced-motion.
+//
+// Mintlify evaluates each export in isolation, and module-level declarations
+// crash, so every constant lives inside the component.
+//
+// Usage in MDX:
+// import { StateSyncFlow } from '/snippets/statesync-diagrams.jsx';
+//
+export const StateSyncFlow = () => {
+ const ink = 'currentColor';
+ const accent = 'var(--sei-maroon-50)';
+ const gold = 'var(--sei-diagram-gold, var(--sei-gold-100))';
+ const ok = 'var(--sei-diagram-ok, #1a7a00)';
+ const hairline = 'rgba(128, 128, 128, 0.25)';
+ const axisY = 214;
+ const at = { genesis: 46, trust: 470, snapshot: 640, tip: 820 };
+
+ const steps = [
+ {
+ title: 'Start from an empty node',
+ text: 'State sync lets a new node join without fetching and replaying every historical block. It is not attempted if the node already has local state.'
+ },
+ {
+ title: 'Pick a trusted block',
+ text: "The script reads the latest height from an RPC endpoint, rounds it down to the nearest 100,000, and fetches that block's hash. The block must fall within the 112h trust period built into seid for Sei Mainnet and Sei Testnet."
+ },
+ {
+ title: 'Configure state sync',
+ text: <>The script enables [statesync] in config.toml and sets rpc-servers, trust-height, and trust-hash. rpc-servers needs at least two entries. Set ss-backend = "pebbledb" in app.toml before you start.>
+ },
+ {
+ title: 'Find a snapshot',
+ text: 'The node discovers peers that take and serve state snapshots. Each snapshot is taken at a specific block height.'
+ },
+ {
+ title: 'Verify forward',
+ text: 'A light client verifies the state, over RPC by default. The trust height is meant to sit below the snapshot height, so verification runs forward and avoids backward verification.'
+ },
+ {
+ title: 'Restore the snapshot',
+ text: 'The node fetches the snapshot from peers and restores the application state at the snapshot height. This can cut the time to sync from days to minutes.'
+ },
+ {
+ title: 'Catch up from the snapshot',
+ text: 'Block sync takes the node from the snapshot height to the tip. Its block history starts at the snapshot height, which is why state sync is not for archive nodes.'
+ }
+ ];
+ const last = steps.length - 1;
+
+ const [step, setStep] = useState(0);
+ const [playing, setPlaying] = useState(false);
+ const [reduced, setReduced] = useState(false);
+ const rootRef = useRef(null);
+ const playingRef = useRef(false);
+ const auto = useRef({ armed: true, resume: false });
+ playingRef.current = playing;
+
+ useEffect(() => {
+ if (typeof window === 'undefined' || !window.matchMedia) return undefined;
+ const query = window.matchMedia('(prefers-reduced-motion: reduce)');
+ const update = () => setReduced(query.matches);
+ update();
+ if (!query.addEventListener) return undefined;
+ query.addEventListener('change', update);
+ return () => query.removeEventListener('change', update);
+ }, []);
+
+ useEffect(() => {
+ if (!playing) return undefined;
+ const timer = setTimeout(() => setStep(step >= last ? 0 : step + 1), step >= last ? 3000 : step === 0 ? 800 : 2000);
+ return () => clearTimeout(timer);
+ }, [playing, step]);
+
+ useEffect(() => {
+ const node = rootRef.current;
+ if (!node || typeof IntersectionObserver === 'undefined') return undefined;
+ const observer = new IntersectionObserver(
+ (entries) => {
+ const entry = entries[entries.length - 1];
+ if (entry.intersectionRatio >= 0.3) {
+ const reduceMotion = window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches;
+ if ((auto.current.armed && !reduceMotion) || auto.current.resume) setPlaying(true);
+ auto.current = { armed: false, resume: false };
+ } else if (!entry.isIntersecting && playingRef.current) {
+ setPlaying(false);
+ auto.current = { armed: false, resume: true };
+ }
+ },
+ { threshold: [0, 0.35] }
+ );
+ observer.observe(node);
+ return () => observer.disconnect();
+ }, []);
+
+ const go = (next) => {
+ auto.current = { armed: false, resume: false };
+ setPlaying(false);
+ setStep(Math.max(0, Math.min(last, next)));
+ };
+ const togglePlay = () => {
+ auto.current = { armed: false, resume: false };
+ if (playing) {
+ setPlaying(false);
+ return;
+ }
+ setStep(step >= last ? 0 : step + 1);
+ setPlaying(true);
+ };
+
+ const ease = 'cubic-bezier(0.4, 0, 0.2, 1)';
+ const paint = reduced ? 'none' : 'stroke 400ms ease, stroke-opacity 400ms ease';
+ const shown = (visible, delay) => ({ opacity: visible ? 1 : 0, transition: reduced ? 'none' : `opacity 400ms ease ${visible ? delay || 0 : 0}ms` });
+ const ghost = (pending) => ({ opacity: pending ? 1 : 0, transition: reduced ? 'none' : 'opacity 300ms ease' });
+ const slideIn = (visible, dx, dy, delay) => ({
+ opacity: visible ? 1 : 0,
+ transform: visible ? 'translate(0px, 0px)' : `translate(${dx}px, ${dy}px)`,
+ transition: reduced ? 'none' : `transform 500ms ${ease} ${visible ? delay || 0 : 0}ms, opacity 350ms ease ${visible ? delay || 0 : 0}ms`
+ });
+ const grow = (on, delay) => ({
+ transformBox: 'fill-box',
+ transformOrigin: 'left center',
+ transform: `scaleX(${on ? 1 : 0})`,
+ transition: reduced ? 'none' : on ? `transform 900ms ${ease} ${delay || 0}ms` : 'transform 250ms ease'
+ });
+ const flow = (k) => (playing && step === k ? 'on' : undefined);
+ const status = step >= 6 ? 'in sync with the chain' : step >= 5 ? 'state restored at the snapshot height' : step >= 2 ? 'state sync enabled' : 'no local state';
+
+ const primaryButton = {
+ backgroundColor: 'var(--sei-maroon-100)',
+ color: '#ffffff',
+ fontFamily: 'var(--sei-font-mono)',
+ fontSize: '11px',
+ letterSpacing: '0.04em',
+ textTransform: 'uppercase',
+ padding: '6px 14px',
+ borderRadius: '6px',
+ minWidth: '76px',
+ cursor: 'pointer'
+ };
+ const secondaryButton = (disabled) => ({
+ backgroundColor: 'rgba(128, 128, 128, 0.14)',
+ fontFamily: 'var(--sei-font-mono)',
+ fontSize: '11px',
+ letterSpacing: '0.04em',
+ textTransform: 'uppercase',
+ padding: '6px 12px',
+ borderRadius: '6px',
+ opacity: disabled ? 0.4 : 1,
+ cursor: disabled ? 'default' : 'pointer'
+ });
+
+ return (
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ = 6 ? ok : ink} fillOpacity={step >= 6 ? 0.1 : 0.05} stroke={step >= 6 ? ok : accent} strokeOpacity={step >= 6 ? 1 : 0.9} strokeWidth="1.3" style={{ transition: reduced ? 'none' : 'fill 400ms ease, stroke 400ms ease, fill-opacity 400ms ease' }} />
+ new node
+ {status}
+
+
+ state sync peers
+ take and serve snapshots
+
+
+ RPC servers
+ light client verification
+
+
+ = 2, 0, -8)}>
+
+ [statesync] enable = true
+ rpc-servers, trust-height, trust-hash
+ [state-store] ss-backend = "pebbledb"
+
+
+
+ block height
+
+ genesis
+
+ chain tip
+
+ = 1, 350)}>
+
+ trust height + hash
+ a multiple of 100,000
+
+ = 1)}>
+
+ round the latest height down,
+ fetch that block's hash
+
+
+ = 3, 350)}>
+
+ snapshot height
+
+ = 3)}>
+
+ snapshot at a recent height
+
+
+ = 4, -10, 0)}>
+
+ verify forward
+
+
+ = 5, 12, 0)}>
+
+ fetch and restore the snapshot
+
+
+ = 6)}>
+
+ history this node never replays
+
+ = 6, 200)} />
+ = 6, 700)}>block sync to the tip; history starts at the snapshot
+
+
+
+
+
+
+ Step {step + 1} of {steps.length}
+
+
{steps[step].title}
+
{steps[step].text}
+
+
+ go(step - 1)} disabled={step === 0} aria-label="Previous step" className="text-neutral-800 dark:text-neutral-200" style={secondaryButton(step === 0)}>
+ Back
+
+ = last ? 'Replay from the start' : 'Play'} style={primaryButton}>
+ {playing ? 'Pause' : step >= last ? 'Replay' : 'Play'}
+
+ go(step + 1)} disabled={step === last} aria-label="Next step" className="text-neutral-800 dark:text-neutral-200" style={secondaryButton(step === last)}>
+ Next
+
+
+
+
+
+ {steps.map((item, i) => (
+ go(i)}
+ aria-label={`Step ${i + 1}: ${item.title}`}
+ aria-current={i === step ? 'step' : undefined}
+ style={{
+ width: i === step ? 22 : 8,
+ height: 8,
+ borderRadius: 9999,
+ backgroundColor: i <= step ? accent : 'rgba(128, 128, 128, 0.35)',
+ transition: reduced ? 'none' : 'width 300ms ease, background-color 300ms ease',
+ cursor: 'pointer'
+ }}
+ />
+ ))}
+
+
+
Heights are schematic. The script on this page picks the trust height, and the snapshot height depends on which snapshots your peers serve.
+
+ );
+};
diff --git a/snippets/x402-diagrams.jsx b/snippets/x402-diagrams.jsx
new file mode 100644
index 0000000..4ee315f
--- /dev/null
+++ b/snippets/x402-diagrams.jsx
@@ -0,0 +1,258 @@
+// X402PaymentFlow — a steppable, animated sequence diagram of one paid x402 v2
+// request on Sei Testnet, from the first 402 response through the signed
+// retry, verification, settlement, and the released response. It uses the
+// same player as the Giga diagrams: it starts when it scrolls into view, loops
+// until a reader pauses it, pauses while off screen, and does not autoplay
+// under prefers-reduced-motion.
+//
+// Mintlify evaluates each export in isolation, and module-level declarations
+// crash, so every constant lives inside the component.
+//
+// Usage in MDX:
+// import { X402PaymentFlow } from '/snippets/x402-diagrams.jsx';
+//
+export const X402PaymentFlow = () => {
+ const ink = 'currentColor';
+ const accent = 'var(--sei-maroon-50)';
+ const gold = 'var(--sei-diagram-gold, var(--sei-gold-100))';
+ const hairline = 'rgba(128, 128, 128, 0.25)';
+ const col = { client: 110, server: 370, facilitator: 600, sei: 790 };
+ const actors = [
+ { key: 'client', label: 'client', sub: 'dApp, agent, or service' },
+ { key: 'server', label: 'resource server', sub: 'prices the route' },
+ { key: 'facilitator', label: 'facilitator', sub: 'optional', dashed: true },
+ { key: 'sei', label: 'Sei Testnet', sub: 'eip155:1328' }
+ ];
+
+ const steps = [
+ {
+ title: 'Request the resource',
+ text: <>The client sends a normal HTTP request to the paid endpoint. In this example, that is GET /weather on Sei Testnet.>
+ },
+ {
+ title: 'Receive the payment requirements',
+ text: <>The server returns 402 Payment Required. Its PAYMENT-REQUIRED header lists the accepted scheme, amount, asset, network, recipient, and resource. Here, that is 0.001 USDC on eip155:1328.>
+ },
+ {
+ title: 'Sign a transfer authorization',
+ text: 'The client picks an accepted option and signs the payload with its wallet. Native USDC on Sei supports EIP-3009, so with the exact scheme the client signs a transfer authorization instead of sending a transaction.'
+ },
+ {
+ title: 'Retry with the signature',
+ text: <>The client sends the same request again with the signed payload in the PAYMENT-SIGNATURE header. The x402 Fetch and Axios adapters automate this retry.>
+ },
+ {
+ title: 'Verify the payload',
+ text: 'The resource server verifies the payload against its payment requirements, here through a facilitator. Your route handler runs after verification, and the middleware holds its response.'
+ },
+ {
+ title: 'Settle on Sei',
+ text: <>The facilitator submits the authorized transfer of Sei Testnet USDC (0x4fCF1784B31630811181f670Aea7A7bEF803eaED) and pays the gas. It waits for the settlement result and returns it to the server. You can also run your own facilitator or settle directly.>
+ },
+ {
+ title: 'Return the resource',
+ text: <>The middleware sends the held response only after settlement succeeds. The PAYMENT-RESPONSE header carries the settlement details.>
+ }
+ ];
+ const last = steps.length - 1;
+
+ const [step, setStep] = useState(0);
+ const [playing, setPlaying] = useState(false);
+ const [reduced, setReduced] = useState(false);
+ const rootRef = useRef(null);
+ const playingRef = useRef(false);
+ const auto = useRef({ armed: true, resume: false });
+ playingRef.current = playing;
+
+ useEffect(() => {
+ if (typeof window === 'undefined' || !window.matchMedia) return undefined;
+ const query = window.matchMedia('(prefers-reduced-motion: reduce)');
+ const update = () => setReduced(query.matches);
+ update();
+ if (!query.addEventListener) return undefined;
+ query.addEventListener('change', update);
+ return () => query.removeEventListener('change', update);
+ }, []);
+
+ useEffect(() => {
+ if (!playing) return undefined;
+ const timer = setTimeout(() => setStep(step >= last ? 0 : step + 1), step >= last ? 3000 : step === 0 ? 800 : 2000);
+ return () => clearTimeout(timer);
+ }, [playing, step]);
+
+ useEffect(() => {
+ const node = rootRef.current;
+ if (!node || typeof IntersectionObserver === 'undefined') return undefined;
+ const observer = new IntersectionObserver(
+ (entries) => {
+ const entry = entries[entries.length - 1];
+ if (entry.intersectionRatio >= 0.3) {
+ const reduceMotion = window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches;
+ if ((auto.current.armed && !reduceMotion) || auto.current.resume) setPlaying(true);
+ auto.current = { armed: false, resume: false };
+ } else if (!entry.isIntersecting && playingRef.current) {
+ setPlaying(false);
+ auto.current = { armed: false, resume: true };
+ }
+ },
+ { threshold: [0, 0.35] }
+ );
+ observer.observe(node);
+ return () => observer.disconnect();
+ }, []);
+
+ const go = (next) => {
+ auto.current = { armed: false, resume: false };
+ setPlaying(false);
+ setStep(Math.max(0, Math.min(last, next)));
+ };
+ const togglePlay = () => {
+ auto.current = { armed: false, resume: false };
+ if (playing) {
+ setPlaying(false);
+ return;
+ }
+ setStep(step >= last ? 0 : step + 1);
+ setPlaying(true);
+ };
+
+ const ease = 'cubic-bezier(0.4, 0, 0.2, 1)';
+ const slideIn = (visible, dx, delay) => ({
+ opacity: visible ? 1 : 0,
+ transform: visible ? 'translate(0px, 0px)' : `translate(${dx}px, 0px)`,
+ transition: reduced ? 'none' : `transform 500ms ${ease} ${visible ? delay || 0 : 0}ms, opacity 350ms ease ${visible ? delay || 0 : 0}ms`
+ });
+ const message = (at, y, from, to, label, sub, tone, dashed, delay) => {
+ const x1 = col[from];
+ const x2 = col[to];
+ const dir = x2 > x1 ? 1 : -1;
+ const color = tone === 'accent' ? accent : tone === 'gold' ? gold : ink;
+ const marker = tone === 'accent' ? 'url(#x4-b)' : tone === 'gold' ? 'url(#x4-g)' : 'url(#x4-a)';
+ return (
+ = at, -12 * dir, delay)}>
+
+ {label}
+ {sub ? {sub} : null}
+
+ );
+ };
+
+ const primaryButton = {
+ backgroundColor: 'var(--sei-maroon-100)',
+ color: '#ffffff',
+ fontFamily: 'var(--sei-font-mono)',
+ fontSize: '11px',
+ letterSpacing: '0.04em',
+ textTransform: 'uppercase',
+ padding: '6px 14px',
+ borderRadius: '6px',
+ minWidth: '76px',
+ cursor: 'pointer'
+ };
+ const secondaryButton = (disabled) => ({
+ backgroundColor: 'rgba(128, 128, 128, 0.14)',
+ fontFamily: 'var(--sei-font-mono)',
+ fontSize: '11px',
+ letterSpacing: '0.04em',
+ textTransform: 'uppercase',
+ padding: '6px 12px',
+ borderRadius: '6px',
+ opacity: disabled ? 0.4 : 1,
+ cursor: disabled ? 'default' : 'pointer'
+ });
+
+ return (
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {actors.map((a) => (
+
+
+
+ {a.label}
+ {a.sub}
+
+ ))}
+
+ {message(0, 84, 'client', 'server', 'GET /weather', null, null, false, 0)}
+ {message(1, 120, 'server', 'client', '402 Payment Required', 'PAYMENT-REQUIRED: 0.001 USDC, eip155:1328', 'accent', false, 0)}
+
+ = 2, 0, 0)}>
+
+ signs an EIP-3009 transfer authorization
+ no transaction is sent
+
+
+ {message(3, 196, 'client', 'server', 'GET /weather, again', 'PAYMENT-SIGNATURE: signed payload', 'accent', false, 0)}
+ {message(4, 232, 'server', 'facilitator', 'verify the payload', null, null, false, 0)}
+ {message(4, 246, 'facilitator', 'server', '', 'valid', null, true, 350)}
+
+ = 4, 0, 650)}>
+
+ route handler runs, response held
+
+
+ {message(5, 306, 'facilitator', 'sei', 'submit the transfer, pay gas', null, 'gold', false, 0)}
+ {message(5, 320, 'sei', 'server', '', 'settled: result returned to the server', null, true, 400)}
+ {message(6, 352, 'server', 'client', 'the held response', 'PAYMENT-RESPONSE: settlement details', 'accent', false, 0)}
+
+
+
+
+
+
+ Step {step + 1} of {steps.length}
+
+
{steps[step].title}
+
{steps[step].text}
+
+
+ go(step - 1)} disabled={step === 0} aria-label="Previous step" className="text-neutral-800 dark:text-neutral-200" style={secondaryButton(step === 0)}>
+ Back
+
+ = last ? 'Replay from the start' : 'Play'} style={primaryButton}>
+ {playing ? 'Pause' : step >= last ? 'Replay' : 'Play'}
+
+ go(step + 1)} disabled={step === last} aria-label="Next step" className="text-neutral-800 dark:text-neutral-200" style={secondaryButton(step === last)}>
+ Next
+
+
+
+
+
+ {steps.map((item, i) => (
+ go(i)}
+ aria-label={`Step ${i + 1}: ${item.title}`}
+ aria-current={i === step ? 'step' : undefined}
+ style={{
+ width: i === step ? 22 : 8,
+ height: 8,
+ borderRadius: 9999,
+ backgroundColor: i <= step ? accent : 'rgba(128, 128, 128, 0.35)',
+ transition: reduced ? 'none' : 'width 300ms ease, background-color 300ms ease',
+ cursor: 'pointer'
+ }}
+ />
+ ))}
+
+
+
One paid request with the exact scheme, following the Express example on this page. The facilitator is optional: a resource server can also run its own or settle payments directly.
+
+ );
+};